FS#16764 - pacdiff from pacman-contrib 3.3.1-1 doesn't find every *.pac{new;save;orig} file
Attached to Project:
Pacman
Opened by Heiko Baums (cyberpatrol) - Wednesday, 21 October 2009, 11:11 GMT
Last edited by Xavier (shining) - Thursday, 05 November 2009, 17:17 GMT
Opened by Heiko Baums (cyberpatrol) - Wednesday, 21 October 2009, 11:11 GMT
Last edited by Xavier (shining) - Thursday, 05 November 2009, 17:17 GMT
|
Details
Description:
pacdiff from pacman-contrib 3.3.1-1 doesn't find every *.pac{new;save;orig} file except if it's run with the parameter -l, but then it doesn't find the new ones. I think it's because of this line in the function cmd: find /etc/ \( -name \*.pacnew -o -name \*.pacorig -o -name \*.pacsave \) -print0 It would be better if it would search the whole directory tree: find / \( -name \*.pacnew -o -name \*.pacorig -o -name \*.pacsave \) -print0 It's because of the NoUpgrade option in /etc/pacman.conf, which can contain files in any directories. I e.g. set some .desktop files in /usr/share/applications to NoUpgrade to be able to reorganize my DE menu. To find the new files with the -l parameter it would probably a good idea to add an optional updatedb or sudo updatedb before locate is run. It could be implemented by another parameter which could be given in addition to the -l parameter (e.g. pacdiff -l -u). |
This task depends upon
Closed by Xavier (shining)
Thursday, 05 November 2009, 17:17 GMT
Reason for closing: Fixed
Additional comments about closing: fixed by 6ed7d001f6
Thursday, 05 November 2009, 17:17 GMT
Reason for closing: Fixed
Additional comments about closing: fixed by 6ed7d001f6
I guess this is done as "find /" will be very, very slow. So it is a trade-off between a very long find operation and a locate one that requires updatedb to be run before-hand. I'm not sure there is a better option here...
2) running updatedb is not the job of pacdiff
closing as "not a bug" ?
This is what pacdiff says: "pacdiff : a simple pacnew/pacorig/pacsave updater". And pacdiff could be pretty useful.
I know, that find / is pretty slow. But find /etc is not sufficient. Otherwise pacdiff is pretty useless.
Probably /etc/pacman.conf could be parsed for the NoUpgrade options and find could search these directories in addition to /etc. This would be faster than find /.
If you start adding more directories, you end up adding them all, because config files can be put ANYWHERE. And this has nothing to do with NoUpgrade !
For example grub has a config in /boot, some other apps might have them in /usr/, some in /opt, it never ends..
The only compromise I see is adding a configuration option, something like this in pseudo-bash :
searchdir=SEARCHDIR:-/etc
find $searchdir ...
then you could do SEARCHDIR="/" pacdiff or SEARCHDIR="/etc/ /boot/ /usr" pacdiff or whatever makes you happy.
And now I just thought of a completely different approach, which would be to make use of $(pacman -Qii) output. I would have to experiment with this idea.
The problem with $(pacman -Qii) output is that it doesn't catch the NoUpgrade files.
Both together could be the ultimate solution.
$searchdir could probably be set in pacman.conf, commented by default.
It should be inside pacdiff, like diffprog :
20 diffprog=${DIFFPROG:-vimdiff}
and the default value can be overridden using the environment variable DIFFPROG
Do you want to try to implement searchdir in a similar way than diffprog ?
Otherwise I can probably do it.
I added a variable $diffsearchpath. The default value is /etc which can be changed by setting the environment variable DIFFSEARCHPATH="path1 path2 path3 ...". Separator is " " because of the syntax of find.
Anyway, what about this ?
pacdiff : a simple pacnew/pacorig/pacsave updater
Usage : pacdiff [-l]
-l/--locate makes pacdiff use locate rather than find
DIFFPROG variable allows to override the default vimdiff
DIFFSEARCHPATH allows to override the default /etc path
DIFFSEARCHPATH allows to override the default /etc path (Use " " as separator.)
or
DIFFSEARCHPATH allows to override the default /etc path ("path1 path2 path3 ...")
or something similar if you know how to explain it better.
Usage : pacdiff [-l]
-l/--locate makes pacdiff use locate rather than find
DIFFPROG variable allows to override the default vimdiff
DIFFSEARCHPATH allows to override the default /etc path
Example : DIFFPROG=meld DIFFSEARCHPATH="/boot /etc /usr" pacdiff