rmarquis / pacaur

[unmaintained] An AUR helper that minimizes user interaction
https://bbs.archlinux.org/viewtopic.php?pid=1755144#p1755144
ISC License
796 stars 113 forks source link

pacaur automatically installs deps from masked pacman repo even bypassing IgnorePkg #571

Open vith opened 8 years ago

vith commented 8 years ago

For example, aur/caddy-full-bin depends on systemd>=229 but I am using tredaelli-systemd/systemd 227-1 because I'm stuck on an old kernel on openvz. I have the [tredaelli-systemd] repo first in my /etc/pacman.conf. sudo pacman -Syu will not automatically upgrade me from tredaelli-systemd/systemd-227-1 to core/systemd-231-3. But if I do pacaur -S caddy-full-bin, it will upgrade without any opportunity to decline:

==> Making package: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:03:46 UTC 2016)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (1) systemd-231-3

Total Installed Size:   16.77 MiB
Net Upgrade Size:      -10.25 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                  [#############################################] 100%
(1/1) checking package integrity                                                [#############################################] 100%
(1/1) loading package files                                                     [#############################################] 100%
(1/1) checking for file conflicts                                               [#############################################] 100%
(1/1) checking available disk space                                             [#############################################] 100%
:: Processing package changes...
(1/1) upgrading systemd                                                         [#############################################] 100%
:: systemd-bootchart is no longer included with systemd
:: Running post-transaction hooks...
(1/1) Updating udev Hardware Database...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found caddy.tar.gz
  -> Found caddy-systemd-service.patch

Even if I add systemd to IgnorePkg, pacaur will bypass the extra prompt immediately:

==> Making package: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:11:08 UTC 2016)
==> Checking runtime dependencies...
==> Installing missing dependencies...
:: systemd is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] 
resolving dependencies...
looking for conflicting packages...

Packages (1) systemd-231-3

Total Installed Size:   16.77 MiB
Net Upgrade Size:      -10.25 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                  [#############################################] 100%
(1/1) checking package integrity                                                [#############################################] 100%
(1/1) loading package files                                                     [#############################################] 100%
(1/1) checking for file conflicts                                               [#############################################] 100%
(1/1) checking available disk space                                             [#############################################] 100%
:: Processing package changes...
(1/1) upgrading systemd                                                         [#############################################] 100%
:: systemd-bootchart is no longer included with systemd
:: Running post-transaction hooks...
(1/1) Updating udev Hardware Database...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found caddy.tar.gz
  -> Found caddy-systemd-service.patch

Using makepkg directly does try to upgrade to systemd-231-3 as well, which sucks, but I at least get the chance to decline it:

% makepkg -si              
==> Making package: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:16:06 UTC 2016)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (1) systemd-231-3

Total Installed Size:   16.77 MiB
Net Upgrade Size:      -10.25 MiB

:: Proceed with installation? [Y/n] 

Or with IgnorePkg:

% makepkg -si              
==> Making package: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:17:09 UTC 2016)
==> Checking runtime dependencies...
==> Installing missing dependencies...
:: systemd is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] 

I understand if you don't care to try to enforce the /etc/pacman.conf repository order masking which not even makepkg obeys, but I think pacaur should at least not bypass IgnorePkg for you automatically.

My /etc/xdg/pacaur is default/all comments and I'm using pacaur 4.6.10.

rmarquis commented 8 years ago

What's displayed on the main prompt when running pacaur -S caddy-full-bin?

vith commented 8 years ago

I'll split it up at each point of interaction:

% pacaur -S caddy-full-bin
:: Package(s) caddy-full-bin not found in repositories, trying AUR...
:: resolving dependencies...
:: looking for inter-conflicts...
:: caddy-full-bin-0.9.3-8 is up to date -- reinstalling

AUR Packages  (1) caddy-full-bin-0.9.3-8  

:: Proceed with installation? [Y/n] 

to which I press enter, followed by:


:: Retrieving package(s)...
:: caddy-full-bin build files are up-to-date -- skipping
[sudo] password for vith: 

followed by:

:: Checking caddy-full-bin integrity...
==> Making package: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:48:03 UTC 2016)
==> Retrieving sources...
  -> Found caddy.tar.gz
  -> Found caddy-systemd-service.patch
==> Validating source_x86_64 files with md5sums...
    caddy.tar.gz ... Skipped
    caddy-systemd-service.patch ... Passed
:: Building caddy-full-bin package(s)...
==> Making package: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:48:04 UTC 2016)
==> Checking runtime dependencies...
==> Installing missing dependencies...
:: systemd is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] 
resolving dependencies...
looking for conflicting packages...

Packages (1) systemd-231-3

Total Installed Size:   16.77 MiB
Net Upgrade Size:      -10.25 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                  [#############################################] 100%
(1/1) checking package integrity                                                [#############################################] 100%
(1/1) loading package files                                                     [#############################################] 100%
(1/1) checking for file conflicts                                               [#############################################] 100%
(1/1) checking available disk space                                             [#############################################] 100%
:: Processing package changes...
(1/1) upgrading systemd                                                         [#############################################] 100%
:: systemd-bootchart is no longer included with systemd
:: Running post-transaction hooks...
(1/1) Updating udev Hardware Database...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found caddy.tar.gz
  -> Found caddy-systemd-service.patch
==> Validating source_x86_64 files with md5sums...
    caddy.tar.gz ... Skipped
    caddy-systemd-service.patch ... Passed
==> Extracting sources...
  -> Extracting caddy.tar.gz with bsdtar
[sudo] password for vith: ==> Starting prepare()...
  -> Patching systemd service file
patching file /home/vith/.cache/pacaur/caddy-full-bin/src/init/linux-systemd/caddy.service
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issue...
==> Creating package "caddy-full-bin"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Adding install file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: caddy-full-bin 0.9.3-8 (Wed Oct  5 19:48:14 UTC 2016)
==> Cleaning up...
:: Installing caddy-full-bin package(s)...

at this point it just stalls, most likely because some systemd-related thing has already crashed due to being incompatible with the openvz kernel.

vith commented 8 years ago

Or maybe it's stalling waiting for a password input again, I just noticed the second [sudo] password for vith: in the middle of the last segment.

But yeah anything after systemd gets upgraded I'd just consider undefined behavior at this point.

rmarquis commented 8 years ago

I see. There is no version check done on binary dependencies, since pacaur assumes the system is not in a partial upgrade state (which your system effectively is). Since the older systemd is found as installed, no further check are processed either. This only concerns the main prompt display, binary installation is otherwise entirely handled by makepkg.

Installing aur/caddy-full-bin correctly shouldn't prevent the new systemd to be installed, but ideally the ignore prompt would be displayed on the main prompt, along with the new systemd dependency.

I am not sure if the work involved is worth it though. After all, this is a very specific situation that shouldn't last long. I'll have a look, but no promise.