Project

General

Profile

Bug #389

[chcleanup] fails if a dependency of the PKGBUILD has unsatisfied dependencies

mtjm - almost 9 years ago - . Updated almost 9 years ago.

Status:
fixed
Priority:
bug
Category:
-
Assignee:
% Done:

100%


Description

This occurred when running libremakepkg for mips64el nepomuk-core:

==> Cleaning chroot...
:: Synchronizing package databases...
 repo is up to date
 libre is up to date
 core is up to date
 extra is up to date
 community is up to date
error: failed to prepare transaction (unexpected error)

bash -x output for chcleanup has shown this:

+ printf '==> Cleaning chroot...\n'
==> Cleaning chroot...
+ pacman -Sy
:: Synchronizing package databases...
 repo is up to date
 libre is up to date
 core is up to date
 extra is up to date
 community is up to date
+++ basename /clean
++ mktemp --tmpdir -d clean.XXXXX
+ TEMPDIR=/tmp/clean.BhpuJ
+ cp -a /var/lib/pacman/sync /tmp/clean.BhpuJ/
+ cleanup_log=/tmp/clean.BhpuJ/libretools-cleanup.log
+ pacman -b /tmp/clean.BhpuJ -Sp --print-format %n base-devel kdelibs poppler-qt taglib ffmpeg ebook-tools cmake automoc4 doxygen
error: failed to prepare transaction (unexpected error)
+ packages=($(comm -23 <(pacman -Qq | sort -u)                      <(sort -u "${cleanup_log}")))
++ comm -23 /tmp/sh-np-1377010478 /tmp/sh-np-4130644913
+++ pacman -Qq
+++ sort -u
+++ sort -u /tmp/clean.BhpuJ/libretools-cleanup.log
+ RET=0
+ [[ 236 != 0 ]]
+ msg2 'Removing %d packages' 236
+ local 'mesg=Removing %d packages'
+ shift
+ printf '  -> Removing %d packages\n' 236
  -> Removing 236 packages
+ false
+ pacman --noconfirm -Rn acl alsa-lib archlinux-keyring aspell attica attr autoconf automake automoc4 avahi bash binutils bison bzip2 ca-certificates cairo cdparanoia cloog cmake coreutils cracklib curl damageproto db dbus dbus-glib desktop-file-utils diffutils dirmngr docbook-xml docbook-xsl e2fsprogs enchant exiv2 expat fakeroot file filesystem findutils fixesproto flac flex fontconfig freeglut freetype2 gawk gcc gcc-libs gd gdbm gettext giflib glib2 glibc glu gmp gnupg gnutls gpgme grantlee graphite grep groff gstreamer0.10 gstreamer0.10-base gstreamer0.10-base-plugins gzip harfbuzz hicolor-icon-theme hspell hunspell hwids iana-etc icu ilmbase inputproto isl jasper js185 json-c kbd kbproto kdelibs-libre keyutils kmod krb5 less libarchive libassuan libasyncns libatasmart libcap libcups libdaemon libdatrie libdbusmenu-qt libdrm libexif libffi libgcrypt libgpg-error libgphoto2 libgssglue libice libieee1284 libimobiledevice libiodbc libjpeg-turbo libksba libldap libltdl libmng libmpc libnl libogg libpciaccess libplist libpng libpulse libqzeitgeist libsasl libsm libsndfile libssh2 libtasn1 libthai libtheora libtiff libtirpc libtool libusbx libutempter libvisual libvorbis libx11 libxau libxcb libxcursor libxdamage libxdmcp libxext libxfixes libxft libxi libxml2 libxmu libxrandr libxrender libxslt libxss libxt libxtst libxv libxxf86vm linux-libre-api-headers lzo2 m4 make media-player-info mesa mesa-libgl mpfr ncurses net-snmp nettle nspr openexr-libre openssl orc p11-kit pacman pacman-mirrorlist-libre pam pambase pango parabola-keyring patch pciutils pcre perl phonon phonon-gstreamer pinentry pixman pkg-config pm-quirks pm-utils polkit polkit-qt procps-ng pth python python2 qca qt4 qtwebkit randrproto raptor rasqal readline recordproto redland renderproto run-parts sane scrnsaverproto sed shadow shared-desktop-ontologies shared-mime-info soprano sqlite strigi sudo sysfsutils systemd tar texinfo tzdata udisks2 upower usbmuxd util-linux v4l-utils videoproto virtuoso-base wayland which xcb-proto xdg-utils xextproto xf86vidmodeproto xorg-xset xproto xz zlib
checking dependencies...
warning: pacman is designated as a HoldPkg.
warning: glibc is designated as a HoldPkg.
:: HoldPkg was found in target list. Do you want to continue? [y/N] 
+ RET=1
+ rm -rf /tmp/clean.BhpuJ
+ exit 1

The problem is in "pacman -Sp --print-format %n poppler-qt": on x86_64 it finds poppler-qt4, on mips64el it fails since we haven't removed poppler-qt yet which needs an older version of poppler.

I think chcleanup should fail with a specific error message in this case, since the following build would fail if pacman cannot install the dependency. Trying to remove all packages could need one too, unless it's obvious that it won't occur for other reasons than unsatisfied dependencies.

History

#2

Updated by lukeshu almost 9 years ago

Here is a pruned/cleaned up copy of the trace, showing the interesting bits, and with comments.

+ printf '==> Cleaning chroot...\n'
==> Cleaning chroot...
+ pacman -Sy
:: Synchronizing package databases...
 repo is up to date
 libre is up to date
 core is up to date
 extra is up to date
 community is up to date
+ pacman -b /tmp/clean.BhpuJ -Sp --print-format %n base-devel "${CHROOTEXTRAPKG[@]}" 
error: failed to prepare transaction (unexpected error)
#### The first run terminated here, because it was run with `bash -eE`.
#### The trace should have used `bash -xeE`
+ packages=($(comm -23 <(pacman -Qq | sort -u)
#### At this point "${packages[@]}" contains 'pacman'
+ pacman --noconfirm -Rn "${packages[@]}" || RET=$?
checking dependencies...
warning: pacman is designated as a HoldPkg.
warning: glibc is designated as a HoldPkg.
:: HoldPkg was found in target list. Do you want to continue? [y/N] 
+ exit $RET

I think the problem is more that there is no error handling around the call to 'pacman -Sp' (getting the recursive list of dependencies). I'll add a message about not being able to come up with a complete list.

I'll add some messages so you know what's going on, and better error handling.

Also available in: Atom PDF