Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #231212
| From | Vincent Lefevre <vincent@vinc17.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: URL to source file |
| Date | 2021-01-27 12:40 +0100 |
| Message-ID | <BBRkZ-41M-3@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <BBPMd-31u-3@gated-at.bofh.it> <BBPVU-3jT-3@gated-at.bofh.it> <BBQ5z-3n5-1@gated-at.bofh.it> <BBQyC-3wL-3@gated-at.bofh.it> <BBQRZ-3Su-23@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 2021-01-27 12:02:53 +0100, Emanuel Berg wrote:
> > Or even better, with dpkg-query(1)
> >
> > file-url () {
> > local debian=https://sources.debian.org/src
> > local pack=$1
> > local ver=$(dpkg-query -f '${Version}\n' -W $pack)
> > local file=$2
> > local url=$debian/$pack/$ver/$file
> > echo $url
> > }
>
> Advantage compared to previous version: more stable with
> dpkg-query, it also saves a fork (no pipe).
But dpkg-query will work only if the package is installed.
With zsh, you can avoid the pipe with zsh expansions:
local ver=${${(M)${(f)"$(aptitude show $pack)"}:#Version:*}#* }
or with apt-cache (which is faster than aptitude):
local ver=${${(M)${(f)"$(apt-cache show --no-all-versions $pack)"}:#Version:*}#* }
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 10:30 +0100
Re: URL to source file <tomas@tuxteam.de> - 2021-01-27 10:40 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 11:00 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 11:10 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 11:20 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 11:50 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 12:10 +0100
Re: URL to source file Vincent Lefevre <vincent@vinc17.net> - 2021-01-27 12:40 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 14:50 +0100
Re: URL to source file Vincent Lefevre <vincent@vinc17.net> - 2021-01-28 02:30 +0100
Re: URL to source file Greg Wooledge <wooledg@eeg.ccf.org> - 2021-01-28 14:20 +0100
Re: URL to source file Vincent Lefevre <vincent@vinc17.net> - 2021-01-28 15:40 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-29 05:00 +0100
Re: URL to source file Andrei POPESCU <andreimpopescu@gmail.com> - 2021-01-27 17:10 +0100
Re: URL to source file <tomas@tuxteam.de> - 2021-01-27 11:30 +0100
Re: URL to source file Stefan Monnier <monnier@iro.umontreal.ca> - 2021-01-27 16:00 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 16:20 +0100
Re: URL to source file Emanuel Berg <moasenwood@zoho.eu> - 2021-01-27 16:30 +0100
csiph-web