[pacman-dev] [PATCH] '-Spp and -Supp' options were added to generate uri list without the downloaded package uris

Xyne xyne at archlinux.ca
Tue Sep 1 23:16:36 EDT 2009


> --print-pkg and --print-uris looks good to me
> 
> but would you keep your new feature on top of these two options :
> --print-pkg and --print-uris only show non-download packages
> --print-pkg --print-pkg and --print-uris --print-uris show all
> ?
> 
> an alternative :
> what if we added the download size when ShowSize is used?
> 
> pacman -Sp fontconfig
> ftp://ftp.archlinux.org/extra/os/i686/fontconfig-2.4.2-1.pkg.tar.gz [1234]
> pacman -Spq fontconfig
> ftp://ftp.archlinux.org/extra/os/i686/fontconfig-2.4.2-1.pkg.tar.gz
> 
> pacman -Sp ... | grep -v "\[0\]" | cut -d' ' -f1
> ftp://ftp.archlinux.org/extra/os/i686/fontconfig-2.4.2-1.pkg.tar.gz


I'm trying to follow this right now but I haven't understood what
"non-download packages" vs "all" means. Can someone please refer me to
the discussion about this? I tried grepping the list but didn't find
anything.

Instead of adding several options, wouldn't it be possible to let "-p"
accept a string argument with formatting information similar to the way
the date command works. This would be extensible in the future and
could include the following interpretted sequences (among others)

%u - url
%n - pkgname
%v - pkgver-pkgrel
%s - size

I don't know how difficult it would be to code but that seems the most
elegant to me, rather than hardcoding the output format and having to
worry about extensibility and breakage in the future.

This might not make sense though in terms of "non-download" vs "all"
but as pointed out, "-yy" and "-cc" mean "all", so  "-pp" should too.
I'm not sure how the double flag would work with accepting an argument.
Maybe there should be an additional argument "--print-format" which
accepts the string, but then we're back to extra argument silliness
again (although that would enable "-p" to easily default to printing
URLs).

As far as backwards compatibility with "--print-uris" goes, I would
suggest breaking it if a better solution is found. Holding back better
design because people can't slightly modify a few simple scripts is not
a valid justification imho.

Xyne


More information about the pacman-dev mailing list