[pacman-dev] RFC: pacdiff finding pacnews through libalpm
I made up a program to help find pacnews that are in odd locations. It includes a c utility based on vodiks pacrat. It uses libalpm to return the path to pacnews and pacsaves from all active configs in the local db. Then there is a version of pacdiff which has it run in place of find. This is better than the current find or locate used in pacdiff which doesn't look outside of /etc/ by default for performance reasons. With this pacdiff can find syslinux config in /boot, or avahi's db in /usr/lib with no noticeable delay. The only drawback I am aware of with using the local db is cannot find pacsaves unless the package is reinstalled. I think this would be a useful inclusion to the contrib tools, so let me know of what sucks about it and what it can be done to to get that accomplished. it currently is in github, but I can make up patches against pacman.git if wanted. https://github.com/JohnFrazier/pacnewrat John Frazier
On 31.05.2013 20:27, John Frazier wrote:
This is better than the current find or locate used in pacdiff which doesn't look outside of /etc/ by default for performance reasons.
find doesn't look outside /etc, but locate looks everywhere. Just put a .pacnew somewhere, updatedb and "locate -e -b \*.pacnew \*.pacorig \*.pacsave" (that's what pacdiff runs if you have locate installed.
On 05/31/13 at 08:51pm, Florian Pritz wrote:
On 31.05.2013 20:27, John Frazier wrote:
This is better than the current find or locate used in pacdiff which doesn't look outside of /etc/ by default for performance reasons.
find doesn't look outside /etc, but locate looks everywhere.
Just put a .pacnew somewhere, updatedb and "locate -e -b \*.pacnew \*.pacorig \*.pacsave" (that's what pacdiff runs if you have locate installed.
My issue with locate is just the indexing time, which can take a minute on my x86_64 machines. On arm with root on an SD card I don't want to even try. John
On Fri, May 31, 2013 at 02:27:06PM -0400, John Frazier wrote:
I made up a program to help find pacnews that are in odd locations. It includes a c utility based on vodiks pacrat. It uses libalpm to return the path to pacnews and pacsaves from all active configs in the local db. Then there is a version of pacdiff which has it run in place of find.
This is better than the current find or locate used in pacdiff which doesn't look outside of /etc/ by default for performance reasons. With this pacdiff can find syslinux config in /boot, or avahi's db in /usr/lib with no noticeable delay. The only drawback I am aware of with using the local db is cannot find pacsaves unless the package is reinstalled.
I think this would be a useful inclusion to the contrib tools, so let me know of what sucks about it and what it can be done to to get that accomplished. it currently is in github, but I can make up patches against pacman.git if wanted.
https://github.com/JohnFrazier/pacnewrat
John Frazier
Unused code, crash on initialization failure, hex codes instead of human readable characters, and odd warnings for unreadable files when the pac{orig,save,new} is (why does this even matter?). In general, I tend to think this sort of thing is better left to shell. It's *easily* made fast. Here's a proof of concept: https://gist.github.com/falconindy/5687111 d
On 05/31/13 at 02:55pm, Dave Reisner wrote:
On Fri, May 31, 2013 at 02:27:06PM -0400, John Frazier wrote:
I made up a program to help find pacnews that are in odd locations. It includes a c utility based on vodiks pacrat. It uses libalpm to return the path to pacnews and pacsaves from all active configs in the local db. Then there is a version of pacdiff which has it run in place of find.
This is better than the current find or locate used in pacdiff which doesn't look outside of /etc/ by default for performance reasons. With this pacdiff can find syslinux config in /boot, or avahi's db in /usr/lib with no noticeable delay. The only drawback I am aware of with using the local db is cannot find pacsaves unless the package is reinstalled.
I think this would be a useful inclusion to the contrib tools, so let me know of what sucks about it and what it can be done to to get that accomplished. it currently is in github, but I can make up patches against pacman.git if wanted.
https://github.com/JohnFrazier/pacnewrat
John Frazier
Unused code, crash on initialization failure, hex codes instead of human readable characters, and odd warnings for unreadable files when the pac{orig,save,new} is (why does this even matter?).
In general, I tend to think this sort of thing is better left to shell. It's *easily* made fast. Here's a proof of concept:
https://gist.github.com/falconindy/5687111
d
Thanks for the input. As for the odd warnings, I wanted to show a warning for a missing config. This is to show if they are lost somehow, and to make people aware of the configs not packaged but still in backup. As that is odd situation. At first glance they appear to be forgotten. perhaps it is used as an upgrade workaround. Seeing that your shell version is just as fast as my c code, and keeping it in one language is a plus. I will work on integrating that code into pacdiff. John
participants (4)
-
Dave Reisner
-
Florian Pritz
-
John Frazier
-
Jonathan Frazier