You are not logged in.

#1 2021-02-04 12:32:18

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,206
Website

Tool to check dependencies when namcap isn't appropriate [SOLVED]

I'd like to check a list of packages against the base-devel group including dependencies.  Is there a tool I can use to do it to avoid manual inspection?

Note - this is intended to be a metapackage so nothing will be build/installed beyond the deps (prerequisites for building openwrt cross-compiler).

depends=(
  asciidoc bash binutils bzip2 flex gawk gcc gettext git help2man intltool libelf
  libxslt make ncurses openssl patch perl-extutils-makemaker python2 time unzip
  util-linux wget zlib zlib
)

Last edited by graysky (2021-02-05 10:18:59)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#2 2021-02-05 01:26:51

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,924

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

I don't understand the meaning of your sentence. What does it mean to "check a list of packages against the base-devel group including dependencies"?


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

Offline

#3 2021-02-05 01:48:06

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

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

Assuming you mean you just want to filter out members of base-devel from that list, this would do it:

printf "%s\n" ${depends[@]} | sort | comm -23 - <(pacman -Sgq base-devel | sort)

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

Offline

#4 2021-02-05 01:53:50

loqs
Member
Registered: 2014-03-06
Posts: 12,987

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

I think base devel including dependencies of currently resolves to

acl
archlinux-keyring
attr
audit
autoconf
automake
bash
binutils
bison
bzip2
ca-certificates
ca-certificates-mozilla
ca-certificates-utils
coreutils
curl
db
diffutils
e2fsprogs
elfutils
expat
fakeroot
file
filesystem
findutils
flex
gawk
gc
gcc
gcc-libs
gdbm
gettext
glib2
glibc
gmp
gnupg
gnutls
gpgme
grep
groff
guile
gzip
iana-etc
icu
keyutils
krb5
less
libarchive
libassuan
libcap
libcap-ng
libcroco
libelf
libffi
libgcrypt
libgpg-error
libidn2
libksba
libldap
libmicrohttpd
libmpc
libnghttp2
libp11-kit
libpsl
libsasl
libseccomp
libsecret
libssh2
libtasn1
libtirpc
libtool
libunistring
libxcrypt
libxml2
linux-api-headers
lz4
m4
make
mpfr
ncurses
nettle
npth
openssl
p11-kit
pacman
pacman-mirrorlist
pam
pambase
patch
pcre
perl
pinentry
pkgconf
readline
sed
shadow
sqlite
sudo
systemd-libs
tar
texinfo
tzdata
util-linux
util-linux-libs
which
xz
zlib
zstd

The question is what is the easiest way to generate this list.  I used pacstrap base-devel then grepped from the generated pacman.log but there has to be a much simpler way.

Offline

#5 2021-02-05 02:13:11

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

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

There should be no need to get the dependencies of base-devel members.  If a package depends on something that is not in base-devel, but happens to currently be a dependency of a member of base-devel, the new package must still list it as a dependency.

But if you really want to list all of base-devel and all dependencies of all members of base devel (recursively) then this will do it:

pacman -Sgq base-devel | while read pkg; do pactree -lsu $pkg; done  | sort -u

But don't use that list for removing dependencies from PKGBUILDs.

Last edited by Trilby (2021-02-05 02:18:44)


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

Offline

#6 2021-02-05 10:06:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,206
Website

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

eschwartz wrote:

I don't understand the meaning of your sentence. What does it mean to "check a list of packages against the base-devel group including dependencies"?

Since all members of base-devel are an assumed dependency of packages in the AUR, I want to check a list of packages against that set to only require ones that are not implicitly on the list and those that would be pulled in by a dependency of another one.

I usually use namcap, but I want to provide a metapackage of dependencies.  In this case, https://aur.archlinux.org/packages/openwrt-devel/

I think these are all that are needed:

depends=(
  bash bzip2 git libelf libxslt ncurses openssl python2 time unzip
  util-linux wget zlib
)
Trilby wrote:

Assuming you mean you just want to filter out members of base-devel from that list, this would do it:

printf "%s\n" ${depends[@]} | sort | comm -23 - <(pacman -Sgq base-devel | sort)

The list I manually generated above matches the output of this so I think it is the right answer based on other discussions above as well.

Thanks all.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

#7 2021-02-07 05:25:23

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,924

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

Where do dependencies come into this?


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

Offline

#8 2021-02-07 06:07:30

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

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

graysky wrote:

Since all members of base-devel are an assumed dependency of packages in the AUR, I want to check a list of packages against that set to only require ones that are not implicitly on the list and those that would be pulled in by a dependency of another one.

Please go back and read my previous post.  You are right that you can / should check your packages dependencies against base-devel and not list members of base-devel as dependencies of your package.  But you must still list dependencies of your package that are not members of base-devel - regardless of whether they may currently and only on default configurations be pulled in by base-devel.  In other words, you cannot assume that dependencies of members of base-devel will be installed.  List those if they are needed.

If your package depends on A and B, and A is in base-devel, and the current implementation of A depends on B, but B is not in base-devel, then your package must list B as a dependency: do not filter it out.

Last edited by Trilby (2021-02-07 06:08:41)


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

Offline

#9 2021-02-07 06:23:50

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,924

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

Anyway, members of base-devel are only an assumed makedepends=() of packages. They are not an assumed depends=().

Score one for imprecise language. I have no idea whether graysky is actually confused here, or merely typoing this / being hasty. There is some confusion, to be sure, since a metapackage full of build dependencies was *also* mentioned.


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

Offline

#10 2021-02-07 06:41:14

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

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

DOH.  I had overlooked the make-depends/depends distinction too.  So there are two big problems here.

The good news is the original question on how to filter that list becomes much much easier.  Answer: don't.


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

Offline

#11 2021-02-07 11:09:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,206
Website

Re: Tool to check dependencies when namcap isn't appropriate [SOLVED]

eschwartz wrote:

Anyway, members of base-devel are only an assumed makedepends=() of packages. They are not an assumed depends=().

Score one for imprecise language. I have no idea whether graysky is actually confused here, or merely typoing this / being hasty. There is some confusion, to be sure, since a metapackage full of build dependencies was *also* mentioned.


Yeah, I too missed that distinction re: makedepends and implicate base-devel ::face palm:: The goal is to have it pull in everything a user would need to build openwrt on Arch.  So all dependencies including those in base-devel should be listed after-all.

Last edited by graysky (2021-02-07 11:15:45)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Online

Board footer

Powered by FluxBB