[pacman-dev] pacman files database operations
Hi all, On my "files" branch I have implemented some operations on the .files databases. (remember these are unconditionally created with the repo-add in git now) Download .files databases: $ pacman -Fy :: Synchronizing package databases... ... List files in packages: $ pacman -Fl abs abs /etc/ abs /etc/abs.conf ... Check file ownership using sync databases: $ pacman -Fo /usr/bin/pacman /usr/bin/pacman is owned by pacman 4.2.1-1 Search file lists: $ pacman -Fs libpng.so libpng 1.6.16-1: /usr/lib/libpng.so darktable 1.6.7-1: /usr/lib/darktable/plugins/imageio/format/libpng.so lib32-libpng 1.6.16-1: /usr/lib32/libpng.so Search with regexes: $ pacman -Fsx kcm.*print.*\.so print-manager 15.04.2-1: /usr/lib/qt/plugins/kcm_printer_manager.so kmymoney 4.7.2-1: /usr/lib/kde4/kcm_kmm_printcheck.so Anything else that is worth implementing before I do the much needed rebase on that branch? A
On 18.06.2015 14:46, Allan McRae wrote:
$ pacman -Fl abs abs /etc/ abs /etc/abs.conf
Does this come with -q to disable the prepended package name in the output? What happens if the package exists in multiple repos? Will I get the list of only one of them or all of them? Can I use -Fl testing/abs to get the list of the testing package only?
...
Check file ownership using sync databases: $ pacman -Fo /usr/bin/pacman /usr/bin/pacman is owned by pacman 4.2.1-1
-q to only output the packages that own the path?
Search file lists: $ pacman -Fs libpng.so libpng 1.6.16-1: /usr/lib/libpng.so darktable 1.6.7-1: /usr/lib/darktable/plugins/imageio/format/libpng.so lib32-libpng 1.6.16-1: /usr/lib32/libpng.so
Search with regexes: $ pacman -Fsx kcm.*print.*\.so print-manager 15.04.2-1: /usr/lib/qt/plugins/kcm_printer_manager.so kmymoney 4.7.2-1: /usr/lib/kde4/kcm_kmm_printcheck.so
Anything else that is worth implementing before I do the much needed rebase on that branch?
case (in)sensitive search? Also why is the output format different between -Fl, -Fo and -Fs? I think they should probably all use the same one (the one with "$pkgname $pkgver: $file") so it's easier to parse. If this is implemented you can ignore the -q wishes above. I see that the output is similar to -Ql and -Qo, but I think it's still better to use a more verbose and easier to parse (e.g. `cut -d\ -f 2-`) format. Especially with regard to the possibility of a package being in multiple repositories which can't happen with -Q.
On 20/06/15 04:32, Florian Pritz wrote:
On 18.06.2015 14:46, Allan McRae wrote:
$ pacman -Fl abs abs /etc/ abs /etc/abs.conf
Does this come with -q to disable the prepended package name in the output?
Yes
What happens if the package exists in multiple repos? Will I get the list of only one of them or all of them?
Can I use -Fl testing/abs to get the list of the testing package only?
I can add that.
...
Check file ownership using sync databases: $ pacman -Fo /usr/bin/pacman /usr/bin/pacman is owned by pacman 4.2.1-1
-q to only output the packages that own the path?
That works.
Search file lists: $ pacman -Fs libpng.so libpng 1.6.16-1: /usr/lib/libpng.so darktable 1.6.7-1: /usr/lib/darktable/plugins/imageio/format/libpng.so lib32-libpng 1.6.16-1: /usr/lib32/libpng.so
Search with regexes: $ pacman -Fsx kcm.*print.*\.so print-manager 15.04.2-1: /usr/lib/qt/plugins/kcm_printer_manager.so kmymoney 4.7.2-1: /usr/lib/kde4/kcm_kmm_printcheck.so
Anything else that is worth implementing before I do the much needed rebase on that branch?
case (in)sensitive search?
Also why is the output format different between -Fl, -Fo and -Fs? I think they should probably all use the same one (the one with "$pkgname $pkgver: $file") so it's easier to parse. If this is implemented you can ignore the -q wishes above.
I see that the output is similar to -Ql and -Qo, but I think it's still better to use a more verbose and easier to parse (e.g. `cut -d\ -f 2-`) format. Especially with regard to the possibility of a package being in multiple repositories which can't happen with -Q.
All have -q options so this is moot. I will deal with the multiple repo issue. A
On 20/06/15 04:32, Florian Pritz wrote:
On 18.06.2015 14:46, Allan McRae wrote:
$ pacman -Fl abs abs /etc/ abs /etc/abs.conf
What happens if the package exists in multiple repos? Will I get the list of only one of them or all of them?
It now only prints the first occurance.
Can I use -Fl testing/abs to get the list of the testing package only?
Implemented.
Search file lists: $ pacman -Fs libpng.so libpng 1.6.16-1: /usr/lib/libpng.so darktable 1.6.7-1: /usr/lib/darktable/plugins/imageio/format/libpng.so lib32-libpng 1.6.16-1: /usr/lib32/libpng.so
Search with regexes: $ pacman -Fsx kcm.*print.*\.so print-manager 15.04.2-1: /usr/lib/qt/plugins/kcm_printer_manager.so kmymoney 4.7.2-1: /usr/lib/kde4/kcm_kmm_printcheck.so
Anything else that is worth implementing before I do the much needed rebase on that branch?
case (in)sensitive search?
I am not interested in doing this...
Also why is the output format different between -Fl, -Fo and -Fs? I think they should probably all use the same one (the one with "$pkgname $pkgver: $file") so it's easier to parse. If this is implemented you can ignore the -q wishes above.
I see that the output is similar to -Ql and -Qo, but I think it's still better to use a more verbose and easier to parse (e.g. `cut -d\ -f 2-`) format. Especially with regard to the possibility of a package being in multiple repositories which can't happen with -Q.
-Fo and -Fs now always show the repo for the results. $ pacman -Fs pacman core/pacman 4.2.1-1 usr/bin/pacman usr/share/bash-completion/completions/pacman extra/xscreensaver 5.32-1 usr/lib/xscreensaver/pacman $ pacman -Fo /usr/lib/libmpfr.so /usr/lib/libmpfr.so is owned by testing/mpfr 3.1.3-1 /usr/lib/libmpfr.so is owned by core/mpfr 3.1.2.p11-1 A
On 20.06.2015 09:31, Allan McRae wrote:
I see that the output is similar to -Ql and -Qo, but I think it's still better to use a more verbose and easier to parse (e.g. `cut -d\ -f 2-`) format. Especially with regard to the possibility of a package being in multiple repositories which can't happen with -Q.
As discussed on IRC I'll work on a -m switch that outputs an easy to parse format ($repo/$pkgname $pkgver: $file) once the patches are reviewed and merged.
On Sat, 20 Jun 2015 12:39:17 +0200 Florian Pritz <bluewind@xinu.at> wrote:
As discussed on IRC I'll work on a -m switch that outputs an easy to parse format ($repo/$pkgname $pkgver: $file) once the patches are reviewed and merged.
I'm working on this now and I've noticed that the output is not consistent with regards to leading slashes. Is that intentional?
src/pacman/pacman -Fo usr/bin/fb /usr/bin/pacman usr/bin/fb is owned by community/fb-client 1.5.0-1 /usr/bin/pacman is owned by core/pacman 4.2.1-4
src/pacman/pacman -Fs fb community/fb-client 1.5.0-1 usr/bin/fb
Florian
On Sat, 17 Oct 2015 10:06:07 +0200 Florian Pritz <bluewind@xinu.at> wrote:
On Sat, 20 Jun 2015 12:39:17 +0200 Florian Pritz <bluewind@xinu.at> wrote:
As discussed on IRC I'll work on a -m switch that outputs an easy to parse format ($repo/$pkgname $pkgver: $file) once the patches are reviewed and merged.
I'm working on this now and I've noticed that the output is not consistent with regards to leading slashes. Is that intentional?
Oops, forgot to mention -Fl.
src/pacman/pacman -Fl fb-client fb-client /usr/ fb-client /usr/bin/ fb-client /usr/bin/fb fb-client /usr/lib/ fb-client /usr/lib/fb-client/ fb-client /usr/lib/fb-client/fb-helper fb-client /usr/share/ fb-client /usr/share/man/ fb-client /usr/share/man/man1/ fb-client /usr/share/man/man1/fb.1.gz
participants (2)
-
Allan McRae
-
Florian Pritz