Recurse depends from archive snapshot

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Recurse depends from archive snapshot

Dave Schile
Hello List:

I'm looking to start on a project that has a subroutine/function that will return a list of all transitive dependencies of a given deb package listed in a given archive snapshot from https://snapshot.debian.org/ I would really like to leverage dpkg or libdpkg.  I don't have much experience with this sort of development so I'm here asking for any insight or tips on how to get started.  Perhaps you know of a project that already does this.

Thanks for any help.
Reply | Threaded
Open this post in threaded view
|

Re: Recurse depends from archive snapshot

Johannes Schauer-3
Hi,

Quoting Dave Schile (2019-10-09 00:56:07)
> I'm looking to start on a project that has a subroutine/function that will
> return a list of all transitive dependencies of a given deb package listed in
> a given archive snapshot from https://snapshot.debian.org/ I would really
> like to leverage dpkg or libdpkg.  I don't have much experience with this
> sort of development so I'm here asking for any insight or tips on how to get
> started.  Perhaps you know of a project that already does this.

     dose-ceve --deb-native-arch amd64 -c patchutils -T deb \
             deb:///var/lib/apt/lists/*_dists_sid_main_binary-amd64_Packages \
             | grep-dctrl -n -s Package '' | sort -u

I would strongly advice you do not re-implement this kind of functionality
yourself if you value your time. It is quite complicated and thus prone to
errors. For example consider complex concepts like versioned provides,
multiarch, architecture wildcard matching and version constraints.

cheers, josch

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Recurse depends from archive snapshot

Dave Schile
Thank you, Josch,

I'm not trying to re-implement apt.  I'd actually like to use the apt and dpkg libs.  I'd like to use it in an 'offline' manner.  Meaning, outside of debian container or environment.  I'm attempting to build debian containers without the need to run the docker daemon.  managing deb package dependencies has been a difficult part of this.  Thanks for your `dose-ceve` idea.  The graphing capability is really cool.  If anyone has ideas or insights about graphing package dependencies without a specific cache, I'd really appreciate it!


On Wed, Oct 9, 2019 at 2:44 AM Johannes Schauer <[hidden email]> wrote:
Hi,

Quoting Dave Schile (2019-10-09 00:56:07)
> I'm looking to start on a project that has a subroutine/function that will
> return a list of all transitive dependencies of a given deb package listed in
> a given archive snapshot from https://snapshot.debian.org/ I would really
> like to leverage dpkg or libdpkg.  I don't have much experience with this
> sort of development so I'm here asking for any insight or tips on how to get
> started.  Perhaps you know of a project that already does this.

     dose-ceve --deb-native-arch amd64 -c patchutils -T deb \
             deb:///var/lib/apt/lists/*_dists_sid_main_binary-amd64_Packages \
             | grep-dctrl -n -s Package '' | sort -u

I would strongly advice you do not re-implement this kind of functionality
yourself if you value your time. It is quite complicated and thus prone to
errors. For example consider complex concepts like versioned provides,
multiarch, architecture wildcard matching and version constraints.

cheers, josch
Reply | Threaded
Open this post in threaded view
|

Re: Recurse depends from archive snapshot

Johannes Schauer-3
Hi David,

Quoting Dave Schile (2019-10-10 20:00:26)
> I'm not trying to re-implement apt.  I'd actually like to use the apt and
> dpkg libs.  I'd like to use it in an 'offline' manner.  Meaning, outside of
> debian container or environment.  I'm attempting to build debian containers
> without the need to run the docker daemon.  managing deb package dependencies
> has been a difficult part of this.

I suspect that indeed all the tools you need already exist and we just need to
figure what exactly it is you want to do.

If you want to build containers or chroots without network connection you have
to first create an offline mirror somewhere in your network. Is this what you
want to do?

Tool like debootstrap already allow you to build your own chroots. By figuring
out which packages debootstrap installs you can easily fill your own offline
cache with the right packages.

You can also use apt to create a custom mirror for you. This script is doing
exactly that in the function update_cache():

https://gitlab.mister-muffin.de/josch/mmdebstrap/blob/master/make_mirror.sh#L130

> Thanks for your `dose-ceve` idea.  The graphing capability is really cool.
> If anyone has ideas or insights about graphing package dependencies without a
> specific cache, I'd really appreciate it!

That's exactly what dose-ceve does. It can graph package dependencies without a
specific cache. Just pass it any Packages file.

Thanks!

cheers, josch

signature.asc (849 bytes) Download Attachment