Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #231202 > unrolled thread

URL to source file

Started byEmanuel Berg <moasenwood@zoho.eu>
First post2021-01-27 10:30 +0100
Last post2021-01-27 16:30 +0100
Articles 18 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  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

#231202 — URL to source file

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 10:30 +0100
SubjectURL to source file
Message-ID<BBPjb-2RD-1@gated-at.bofh.it>
Hello, how can I get a hyperlink to a particular file in
a pack? e.g., definitions.units of the units pack, i.e.
units-2.21/definitions.units ? TIA

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [next] | [standalone]


#231203

From<tomas@tuxteam.de>
Date2021-01-27 10:40 +0100
Message-ID<BBPsS-2UQ-9@gated-at.bofh.it>
In reply to#231202

[Multipart message — attachments visible in raw view] — view raw

On Wed, Jan 27, 2021 at 10:21:29AM +0100, Emanuel Berg wrote:
> Hello, how can I get a hyperlink to a particular file in
> a pack?

You mean... a Debian package?

> e.g., definitions.units of the units pack, i.e.
> units-2.21/definitions.units ? TIA

If I understood you correctly, there are several ways to skin
that cat. Here's one:

Start at sources.debian.org:

  https://sources.debian.org/src/units/

then, decide on version (I'm going with Buster, aka stable):

  https://sources.debian.org/src/units/2.18-1/

(perhaps that's the 2.21 in your request up there?).

Then, there it is:

  https://sources.debian.org/src/units/2.18-1/definitions.units/  

Leave out the trailing slash if you want to get the raw file.

I don't know whether there is an automatic way to get at that
stuff (short of installing the package and asking `apt-file'
where that file is).

But sources.debian.org rocks (try its search engine, reachable
from the top):

  https://sources.debian.org/

Cheers
 - t

[toc] | [prev] | [next] | [standalone]


#231205

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 11:00 +0100
Message-ID<BBPMd-31u-3@gated-at.bofh.it>
In reply to#231203
tomas wrote:

> https://sources.debian.org/src/units/2.18-1/definitions.units  

It is still in some interface but good enough for a reference.

Good enough for government work!

So it is: https://sources.debian.org/src/ + package name +
package version + file name

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231207

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 11:10 +0100
Message-ID<BBPVU-3jT-3@gated-at.bofh.it>
In reply to#231205
> It is still in some interface but good enough for a reference.
>
> Good enough for government work!
>
> So it is: https://sources.debian.org/src/ + package name +
> package version + file name

$ file-url units definitions.units # https://sources.debian.org/src/units/2.21-1/definitions.units

#! /bin/zsh

file-url () {
    local debian=https://sources.debian.org/src
    local pack=$1
    local ver=$(aptitude show units | grep '^Version: ' | awk '{print $2}')
    local file=$2
    local url=$debian/$pack/$ver/$file
    echo $url
} # [1]

[1] https://dataswamp.org/~incal/conf/.zsh/apt lines 168-175

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231208

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 11:20 +0100
Message-ID<BBQ5z-3n5-1@gated-at.bofh.it>
In reply to#231207
> #! /bin/zsh
>
> file-url () {
>     local debian=https://sources.debian.org/src
>     local pack=$1
>     local ver=$(aptitude show units | grep '^Version: ' | awk '{print $2}')
>     local file=$2
>     local url=$debian/$pack/$ver/$file
>     echo $url
> } # [1]
>
> [1] https://dataswamp.org/~incal/conf/.zsh/apt lines 168-175

Oh, forgot the awk + grep trick :)

file-url () {
    local debian=https://sources.debian.org/src
    local pack=$1
    local ver=$(aptitude show units | awk '/Version/{print $2}')
    local file=$2
    local url=$debian/$pack/$ver/$file
    echo $url
}

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231210

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 11:50 +0100
Message-ID<BBQyC-3wL-3@gated-at.bofh.it>
In reply to#231208
> Oh, forgot the awk + grep trick :)

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
}

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231211

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 12:10 +0100
Message-ID<BBQRZ-3Su-23@gated-at.bofh.it>
In reply to#231210
> 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).

The definition of a pipe BTW: a cylinder with two holes, and
the diameter of the holes cannot be bigger than that of the
cylinder...

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231212

FromVincent Lefevre <vincent@vinc17.net>
Date2021-01-27 12:40 +0100
Message-ID<BBRkZ-41M-3@gated-at.bofh.it>
In reply to#231211
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)

[toc] | [prev] | [next] | [standalone]


#231213

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 14:50 +0100
Message-ID<BBTmN-5bT-9@gated-at.bofh.it>
In reply to#231212
Vincent Lefevre wrote:

> 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:*}#* }

Cool :) Thank you!

However...

I have a rule not to use code I don't understand, so can you
please explain that syntax or provide a URL where it is
explained? (Or, just a list with names and/or examples should
be sufficient, actually.)

The M, f, quotes, colons, and hashes?

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231222

FromVincent Lefevre <vincent@vinc17.net>
Date2021-01-28 02:30 +0100
Message-ID<BC4ie-3Dx-1@gated-at.bofh.it>
In reply to#231213
On 2021-01-27 14:46:14 +0100, Emanuel Berg wrote:
> Vincent Lefevre wrote:
> 
> > 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:*}#* }
> 
> Cool :) Thank you!
> 
> However...
> 
> I have a rule not to use code I don't understand,

The zsh parameter expansion syntax is very cryptic (and the above
command is far from being the worst).

> so can you please explain that syntax or provide a URL where it is
> explained? (Or, just a list with names and/or examples should be
> sufficient, actually.)
> 
> The M, f, quotes, colons, and hashes?

Using the "units" example, we start with:

  print -r "$(aptitude show units)"

The double quotes are necessary, as the zshexpn(1) man page says:
for command substitution:

"If the substitution is not enclosed in double quotes, the output
is broken into words using the IFS parameter."

But here, we want to keep the end of lines.

Then one wants to get the "Version:" line, and one can do this via
an array. The "(f)" will turn the aptitude output to an array with
splitting at the end of lines (\n). This can be seen with

  for i in ${(f)"$(aptitude show units)"}; print -r "[$i]"

Without the "(f)", one just gets one element.

The ${name:#pattern} syntax on an array does filtering of elements
matching the pattern. By default, matching array elements are removed.
Here, we want the opposite: to keep the matching array elements. This
is done with the "(M)" flag. Here, the pattern to use is "Version:*",
which matches lines that start with "Version:", the * character
matching any sequence of characters, like in filename generation
(a.k.a. globbing). So,

  print -r ${(M)${(f)"$(aptitude show units)"}:#Version:*}

gives on my machine:

Version: 2.21-1

Then, we want to remove the "Version: " prefix. This is done with
the ${name#pattern} syntax. One could use the "Version: " pattern,
but "* " is shorter and safe since there should be a single space.
Hence

  print -r ${${(M)${(f)"$(aptitude show units)"}:#Version:*}#* }

Note: instead of nested substitutions, one can use intermediate
variables, which can make the code easier to understand.

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

[toc] | [prev] | [next] | [standalone]


#231228

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2021-01-28 14:20 +0100
Message-ID<BCfnk-20K-3@gated-at.bofh.it>
In reply to#231222
On Thu, Jan 28, 2021 at 02:26:47AM +0100, Vincent Lefevre wrote:
> Using the "units" example, we start with:
> 
>   print -r "$(aptitude show units)"
> 
> The double quotes are necessary, as the zshexpn(1) man page says:
> for command substitution:
> 
> "If the substitution is not enclosed in double quotes, the output
> is broken into words using the IFS parameter."
> 
> But here, we want to keep the end of lines.
> 
> Then one wants to get the "Version:" line, and one can do this via
> an array. The "(f)" will turn the aptitude output to an array with
> splitting at the end of lines (\n). This can be seen with
> 
>   for i in ${(f)"$(aptitude show units)"}; print -r "[$i]"
> 
> Without the "(f)", one just gets one element.
> 
> The ${name:#pattern} syntax on an array does filtering of elements
> matching the pattern. By default, matching array elements are removed.
> Here, we want the opposite: to keep the matching array elements. This
> is done with the "(M)" flag. Here, the pattern to use is "Version:*",
> which matches lines that start with "Version:", the * character
> matching any sequence of characters, like in filename generation
> (a.k.a. globbing). So,
> 
>   print -r ${(M)${(f)"$(aptitude show units)"}:#Version:*}
> 
> gives on my machine:
> 
> Version: 2.21-1
> 
> Then, we want to remove the "Version: " prefix. This is done with
> the ${name#pattern} syntax. One could use the "Version: " pattern,
> but "* " is shorter and safe since there should be a single space.
> Hence
> 
>   print -r ${${(M)${(f)"$(aptitude show units)"}:#Version:*}#* }

I have one major objection to this: how do you handle a package that
has more than one version available?

unicorn:~$ apt-cache show firefox-esr | grep ^Version:
Version: 78.7.0esr-1~deb10u1
Version: 78.5.0esr-1~deb10u1

Setting that aside for now....

Here's how the same set of operations might look in bash:

myfunc() {
  local IFS=": " key value
  while read -r key value; do
    if [[ $key = Version ]]; then
      printf %s\\n "$value"
      return
    fi
  done < <(aptitude show units)
}

Other variations are possible, of course.  This one reads the output
of the aptitude command a line at a time, splitting each line into
two variables, before and after the first colon plus any spaces that
are adjacent to said colon.  If the first field is "Version" then it
prints the second field (plus a newline) to standard output, and stops.

The aptitude command is run via a process substitution, which means
aptitude is run in a background process that's connected via a sort
of pipe (on Linux, it'll use /dev/fd/something).  The while loop runs
in the foreground shell process and reads from that.  The read command
does the field splitting on each line, using IFS, which is local to
the function and therefore doesn't need to be set temporarily in the
read command, or restored after we're done with the function.

The [[ command is a keyword, meaning it has magic juju (special
syntax exceptions), so the $key expansion inside it doesn't need to
be double-quoted.  We could double-quote it if we wanted to.

"$value" must be double-quoted because it's being passed as a single
argument to printf, which is "only" a builtin and therefore doesn't
have any magic juju.

One of the advantages of this version over the zsh version is that it
doesn't need to read the whole output of aptitude into memory all at
once.  For this particular task, it won't matter much.  The output of
aptitude show isn't very large, and shouldn't take very long to produce,
or much memory to store.  But for commands that take a really long time
to run, or which produce copious output, reading only a line at a time
and then stopping when you've got the line you want could be a huge win.

[toc] | [prev] | [next] | [standalone]


#231229

FromVincent Lefevre <vincent@vinc17.net>
Date2021-01-28 15:40 +0100
Message-ID<BCgCJ-2Gy-5@gated-at.bofh.it>
In reply to#231228
On 2021-01-28 08:07:51 -0500, Greg Wooledge wrote:
> On Thu, Jan 28, 2021 at 02:26:47AM +0100, Vincent Lefevre wrote:
> >   print -r ${${(M)${(f)"$(aptitude show units)"}:#Version:*}#* }
> 
> I have one major objection to this: how do you handle a package that
> has more than one version available?
> 
> unicorn:~$ apt-cache show firefox-esr | grep ^Version:
> Version: 78.7.0esr-1~deb10u1
> Version: 78.5.0esr-1~deb10u1

The units package has 2 versions available:

zira:~> apt-cache show units | grep "^Version:"
Version: 2.21-1
Version: 2.18-1

but "aptitude show units" only returns one of them (the preferred one,
I suppose). So, no issues with my code.

In my previous message, I also gave the equivalent with apt-cache,
by using the --no-all-versions option.

[...]
> One of the advantages of this version over the zsh version is that it
> doesn't need to read the whole output of aptitude into memory all at
> once.

Note that with zsh, one can also do a process substitution. However,
I would tend to say that process substitution is more complex and
would have more overhead. At least there are more system calls with
bash:

zira:~> strace -f -o str.out bash -c 'v=$(date)' ; wc -l str.out
471 str.out

zira:~> strace -f -o str.out bash -c ': < <(date)' ; wc -l str.out
535 str.out

So I would say that command substitution is here more efficient.

Not much difference with zsh, though:

zira:~> strace -f -o str.out zsh -fc 'v=$(date)' ; wc -l str.out
725 str.out

zira:~> strace -f -o str.out zsh -fc ': < <(date)' ; wc -l str.out
726 str.out

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

[toc] | [prev] | [next] | [standalone]


#231247

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-29 05:00 +0100
Message-ID<BCt6W-1Te-1@gated-at.bofh.it>
In reply to#231222
Vincent Lefevre wrote:

> The zsh parameter expansion syntax is very cryptic (and the
> above command is far from being the worst).
>
>> so can you please explain that syntax or provide a URL
>> where it is explained? (Or, just a list with names and/or
>> examples should be sufficient, actually.)
>> 
>> The M, f, quotes, colons, and hashes?
>
> Using the "units" example, we start with:
>
>   print -r "$(aptitude show units)"
>
> The double quotes are necessary, as the zshexpn(1) man page
> says: for command substitution:
>
> "If the substitution is not enclosed in double quotes, the
> output is broken into words using the IFS parameter."
>
> But here, we want to keep the end of lines.
>
> Then one wants to get the "Version:" line, and one can do
> this via an array. The "(f)" will turn the aptitude output
> to an array with splitting at the end of lines (\n).
> This can be seen with
>
>   for i in ${(f)"$(aptitude show units)"}; print -r "[$i]"
>
> Without the "(f)", one just gets one element.
>
> The ${name:#pattern} syntax on an array does filtering of
> elements matching the pattern. By default, matching array
> elements are removed. Here, we want the opposite: to keep
> the matching array elements. This is done with the "(M)"
> flag. Here, the pattern to use is "Version:*", which matches
> lines that start with "Version:", the * character matching
> any sequence of characters, like in filename generation
> (a.k.a. globbing). So,
>
>   print -r ${(M)${(f)"$(aptitude show units)"}:#Version:*}
>
> gives on my machine:
>
> Version: 2.21-1
>
> Then, we want to remove the "Version: " prefix. This is done
> with the ${name#pattern} syntax. One could use the "Version:
> " pattern, but "* " is shorter and safe since there should
> be a single space. Hence
>
>   print -r ${${(M)${(f)"$(aptitude show units)"}:#Version:*}#* }
>
> Note: instead of nested substitutions, one can use
> intermediate variables, which can make the code easier
> to understand.

Thank you, very useful :)

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231219

FromAndrei POPESCU <andreimpopescu@gmail.com>
Date2021-01-27 17:10 +0100
Message-ID<BBVyh-6I0-1@gated-at.bofh.it>
In reply to#231212

[Multipart message — attachments visible in raw view] — view raw

On Mi, 27 ian 21, 12:38:07, Vincent Lefevre wrote:
> 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:*}#* }

Instead of parsing output of aptitude one can also ask aptitude to 
provide only the needed information.


    aptitude search -F %V "?exact-name($pack)"


Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

[toc] | [prev] | [next] | [standalone]


#231209

From<tomas@tuxteam.de>
Date2021-01-27 11:30 +0100
Message-ID<BBQfg-3qe-13@gated-at.bofh.it>
In reply to#231205

[Multipart message — attachments visible in raw view] — view raw

On Wed, Jan 27, 2021 at 10:49:49AM +0100, Emanuel Berg wrote:
> tomas wrote:
> 
> > https://sources.debian.org/src/units/2.18-1/definitions.units  
> 
> It is still in some interface but good enough for a reference.
> 
> Good enough for government work!

:-)

> So it is: https://sources.debian.org/src/ + package name +
> package version...

so far, so good (but see below for gotchas) ...

> ... + file name

... now this is more complicated. Note that you are looking at a
source package. Sometimes, the file gets just "copied over" to
somewhere else, as in your current case. Source and destination
paths... well. Look into the package's Makefiles and into the
debian subdir. Long story :-)

Sometimes, though, it's a .c file, which gets trampled on by a
stampede of compilers and linkers. Bits of its soul end up
scattered in various places of /usr/bin and/or /usr/lib.

Even the part with the package name is an oversimplification.
Many times, one source package gives birth to several binary
packages (e.g. a set of libraries usable by other packages
plus a set of basic binary utilities which go with those
libraries).

But if you keep those caveats in mind, the above is a good
start.

Cheers
 - t

[toc] | [prev] | [next] | [standalone]


#231215

FromStefan Monnier <monnier@iro.umontreal.ca>
Date2021-01-27 16:00 +0100
Message-ID<BBUsy-5Oe-1@gated-at.bofh.it>
In reply to#231205
Emanuel Berg [2021-01-27 10:49:49] wrote:

> tomas wrote:
>
>> https://sources.debian.org/src/units/2.18-1/definitions.units  
>
> It is still in some interface but good enough for a reference.

https://sources.debian.org/data/main/u/units/2.18-1/definitions.units

gives you the "raw" file.


        Stefan

[toc] | [prev] | [next] | [standalone]


#231216

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 16:20 +0100
Message-ID<BBULU-6aN-9@gated-at.bofh.it>
In reply to#231215
Stefan Monnier wrote:

>> It is still in some interface but good enough for a reference.
>
> https://sources.debian.org/data/main/u/units/2.18-1/definitions.units
>
> gives you the "raw" file.

Great! :)

> Stefan

= king

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [next] | [standalone]


#231217

FromEmanuel Berg <moasenwood@zoho.eu>
Date2021-01-27 16:30 +0100
Message-ID<BBUVA-6ej-3@gated-at.bofh.it>
In reply to#231215
Stefan Monnier wrote:

>> It is still in some interface but good enough for
>> a reference.
>
> https://sources.debian.org/data/main/u/units/2.18-1/definitions.units
>
> gives you the "raw" file.

#! /bin/zsh

file-url () {
    local pack=$1
    local ver=$(dpkg-query -f '${Version}\n' -W $pack)
    local file=$2
    local url=https://sources.debian.org/data/main/u/$pack/$ver/$file
    echo $url
}

$ file-url units definitions.units
https://sources.debian.org/data/main/u/units/2.21-1/definitions.units

https://dataswamp.org/~incal/conf/.zsh/apt
lines 168-174

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web