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

Xavier shiningxc at gmail.com
Wed Sep 2 03:00:24 EDT 2009


On Wed, Sep 2, 2009 at 5:16 AM, Xyne<xyne at archlinux.ca> wrote:
>> --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.
>

it just means package already downloaded, so packages for which the
download size is 0.

> 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.
>

hmm I think I like all these suggestions, I will give it a try :)

It should indeed not break too much all scripts using -Sp. They might
just need to switch to -Spp if they want all packages.
and for a different output one could use -Sp or -Spp with an
additional --print-format '%n'
(then probably -p --print-uris needs to be renamed to -p --print)


More information about the pacman-dev mailing list