Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 2003 06:09:52 -0600 (CST)
From:      Loren James Rittle <rittle@latour.rsch.comm.mot.com>
To:        ports@freebsd.org
Subject:   PATCH: `portupgrade -sf sudo' is currently a guaranteed failure
Message-ID:  <200303111209.h2BC9qM3037798@latour.rsch.comm.mot.com>

next in thread | raw e-mail | index | archive | help
`portupgrade -sf sudo' (or e.g. `portupgrade -sa' whenever sudo is
upgraded in the ports collection) fails due to removal of old sudo in
pkg_deinstall step.  This step occurs right before sudo is required to
complete either the install of the new version or the restoration of the
backup if/when the install of the new version fails due to a lack of sudo.

--->  Deinstalling 'sudo-1.6.6_1'
[Updating the pkgdb <format:bdb1_btree> in /var/db/pkg ... - 163 packages found (-1 +0) (...) done]
--->  Installing the new version via the port
--->  [Executing a command as root: sudo /usr/bin/script -qa /tmp/portupgrade38103.0 make -DFORCE_PKG_REGISTER reinstall]
** Command failed [exit code 127]: sudo /usr/bin/script -qa /tmp/portupgrade38103.0 make -DFORCE_PKG_REGISTER reinstall
--->  Restoring the old version
--->  [Executing a command as root: sudo /usr/sbin/pkg_add -f /var/tmp/sudo-1.6.6_1.tgz]
** Command failed [exit code 127]: sudo /usr/sbin/pkg_add -f /var/tmp/sudo-1.6.6_1.tgz
--->  Skipping 'security/sudo'
--->  [Executing a command as root: sudo /usr/local/sbin/pkgdb -aFQ]

As a portupgrade user, I'd be happy with the easy solution of just
skipping the upgrade of sudo in the presence of -s (marking the reason
as circular dependencies or similar).  I understand that there is a
more general issue with -S [command-related-to-ports-being-upgraded];
however it doesn't seem worth solving in general.  Given my limited
understanding of ruby and portupgrade internals, here was the best
patch I could develop for this issue:

*** /usr/local/sbin/portupgrade	Fri Mar  7 22:37:01 2003
--- portupgrade	Tue Mar 11 05:53:48 2003
***************
*** 708,713 ****
--- 708,719 ----
  
    origin = $origin || pkg.origin
  
+   if origin == 'security/sudo' && $sudo
+     progress_message "Skipping '#{origin}' (#{pkgname}) because -s provided"
+     $results << PkgResult.new(origin, PkgResult::SKIPPED, pkgname)
+     return
+   end
+ 
    if origin
      $make_args = options[:make_args] = get_make_args(origin, pkgname)
  

Regards,
Loren

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303111209.h2BC9qM3037798>