You are not logged in.

#1 2017-06-11 16:51:19

FlowIt
Member
Registered: 2014-10-25
Posts: 239

[Solved] dependency resolution when using makepkg

The title is not really fitting, if somebody has a better suggestion I am happy to update it.

I was wondering if there already exists a tool that provides a topological sorting on a certain set of packages/PKGBUILDs. I sometimes have this problem when multiple packages that I build with makepkg recieve updates. Simple example: I want to build gnutls and gnupg. gnutls is a dependency of gnupg so I should build it first. The algorithms for such a problem are well known and more or less easy to implement, I am just asking if somebody already did the work.

Last edited by FlowIt (2017-06-13 20:17:12)

Offline

#2 2017-06-11 17:09:40

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] dependency resolution when using makepkg

For packages in the official repos...

man pactree

For packages in the AUR you can use aurchain (part of the aurutils package).

Last edited by Slithery (2017-06-11 17:09:55)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-06-11 17:46:59

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] dependency resolution when using makepkg

Would be great if pactree had an option to offer linear, easily parsable output. The tree is nice to get an informative view on the dependencies, but is ill suited to be used in a script.

Offline

#4 2017-06-11 17:56:15

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [Solved] dependency resolution when using makepkg

FlowIt wrote:

Would be great if pactree had an option to offer linear, easily parsable output. The tree is nice to get an informative view on the dependencies, but is ill suited to be used in a script.

man pactree wrote:
       -l, --linear
           Prints package names at the start of each line, one per line.

Last edited by 2ManyDogs (2017-06-11 18:04:59)

Offline

#5 2017-06-11 17:59:14

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [Solved] dependency resolution when using makepkg

FlowIt wrote:

Would be great if pactree had an option to offer linear, easily parsable output. The tree is nice to get an informative view on the dependencies, but is ill suited to be used in a script.

There's "pactree -l" and "pactree -u".

Offline

#6 2017-06-11 18:10:25

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] dependency resolution when using makepkg

Ok, this is a bit embarassing. Missed it twice while reading the man page. But the linear option does not provide a topological sorting.

Offline

#7 2017-06-11 18:12:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [Solved] dependency resolution when using makepkg

That's why slithery suggested reading `man pactree`: it has options. (edit: too slow)

-u does seem to give the topological order, admittedly in reverse.  But tac will fix that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2017-06-11 18:20:55

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] dependency resolution when using makepkg

-u does seem to give the topological order, admittedly in reverse.  But tac will fix that.

No, the gnupg example will show it does not.

$ pactree -l -u gnupg
gnupg
libassuan
libgpg-error
glibc
linux-api-headers
tzdata
filesystem
bash
readline
ncurses
gcc-libs
libgcrypt
npth
gnutls
libtasn1
zlib
nettle
gmp
p11-kit
libffi
libunistring
sqlite
pinentry
libcap
attr
libksba

For example, sqlite depends on readline, too, but is printed after readline.

Offline

#9 2017-06-11 19:48:38

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved] dependency resolution when using makepkg

aurutils - helper tools for the aur is a modular AUR helper with reusable bits. You can use `aurqueue` to solve dependencies via their .SRCINFO files, powered by tsort. See the aurutils(7) documentation, it is not at all limited to AUR packages. smile

Last edited by eschwartz (2017-06-11 19:49:22)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#10 2017-06-13 20:16:58

FlowIt
Member
Registered: 2014-10-25
Posts: 239

Re: [Solved] dependency resolution when using makepkg

aurqueue is exactly what I was looking for, thanks. Solved!

Offline

Board footer

Powered by FluxBB