pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/sysupgrade sysupgrade: protect against failur...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/063279582c2a
branches:  trunk
changeset: 376996:063279582c2a
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Apr 15 08:07:25 2022 +0000

description:
sysupgrade: protect against failures when /usr/sbin is not in PATH

diffstat:

 sysutils/sysupgrade/Makefile                    |   4 ++--
 sysutils/sysupgrade/distinfo                    |   4 ++--
 sysutils/sysupgrade/patches/patch-sysupgrade.sh |  21 ++++++++++++++++++---
 3 files changed, 22 insertions(+), 7 deletions(-)

diffs (79 lines):

diff -r 9900c67599b2 -r 063279582c2a sysutils/sysupgrade/Makefile
--- a/sysutils/sysupgrade/Makefile      Fri Apr 15 07:57:27 2022 +0000
+++ b/sysutils/sysupgrade/Makefile      Fri Apr 15 08:07:25 2022 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.18 2021/03/14 08:44:01 nia Exp $
+# $NetBSD: Makefile,v 1.19 2022/04/15 08:07:25 nia Exp $
 
 DISTNAME=      sysupgrade-1.5
-PKGREVISION=   8
+PKGREVISION=   9
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=jmmv/}
 MAINTAINER=    jmmv%NetBSD.org@localhost
diff -r 9900c67599b2 -r 063279582c2a sysutils/sysupgrade/distinfo
--- a/sysutils/sysupgrade/distinfo      Fri Apr 15 07:57:27 2022 +0000
+++ b/sysutils/sysupgrade/distinfo      Fri Apr 15 08:07:25 2022 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.11 2021/10/26 11:20:16 nia Exp $
+$NetBSD: distinfo,v 1.12 2022/04/15 08:07:25 nia Exp $
 
 BLAKE2s (sysupgrade-1.5.tar.gz) = 5fb73e83c7b9b1a891ce0cfb26422f07822061e2df42db6a4e3692468d028186
 SHA512 (sysupgrade-1.5.tar.gz) = 47f37ce6802b8ba74d6edd19a2c80d46394c992b58d3077e6d1316e4f5505afbe53a68d28b28779a10a78d7be05f2f5b9d2a55b5b2f845bcc59a78950a8306f8
 Size (sysupgrade-1.5.tar.gz) = 75833 bytes
 SHA1 (patch-default.conf) = 2457714998c86994192ef57c5dd22646f76828c4
 SHA1 (patch-sysupgrade.conf.5.in) = dfe5d90d0360212ea052f2e25a26820ad277480b
-SHA1 (patch-sysupgrade.sh) = d7a9371ead06d27e5dc00f9004994d3a91129875
+SHA1 (patch-sysupgrade.sh) = 47ec28af4527bb779f67ad92926be71c752ab091
diff -r 9900c67599b2 -r 063279582c2a sysutils/sysupgrade/patches/patch-sysupgrade.sh
--- a/sysutils/sysupgrade/patches/patch-sysupgrade.sh   Fri Apr 15 07:57:27 2022 +0000
+++ b/sysutils/sysupgrade/patches/patch-sysupgrade.sh   Fri Apr 15 08:07:25 2022 +0000
@@ -1,7 +1,9 @@
-$NetBSD: patch-sysupgrade.sh,v 1.6 2020/10/21 21:34:21 kamil Exp $
+$NetBSD: patch-sysupgrade.sh,v 1.7 2022/04/15 08:07:25 nia Exp $
 
 * Don't reject https in sysupgrade_fetch()
 * Add ARCHIVE_EXTENSION variable (Fix PR pkg/53697)
+* Use direct paths to etcupdate and postinstall
+  (protect against user misconfiguration).
 
 --- sysupgrade.sh.orig 2013-07-28 21:27:57.000000000 +0000
 +++ sysupgrade.sh
@@ -103,7 +105,7 @@
      [ ${#} -eq 0 ] || shtk_cli_usage_error "etcupdate does not take any" \
          "arguments"
  
-@@ -366,8 +382,8 @@ sysupgrade_etcupdate() {
+@@ -366,12 +382,12 @@ sysupgrade_etcupdate() {
  
      local sflags=
      for set_name in ${sets}; do
@@ -114,6 +116,11 @@
      done
  
      shtk_cli_info "Upgrading /etc interactively"
+-    etcupdate -a -l ${sflags}
++    /usr/sbin/etcupdate -a -l ${sflags}
+ }
+ 
+ 
 @@ -381,6 +397,7 @@ sysupgrade_etcupdate() {
  sysupgrade_postinstall() {
      local sets=
@@ -133,7 +140,15 @@
      done
  
      shtk_cli_info "Performing postinstall checks"
-@@ -409,10 +426,13 @@ sysupgrade_postinstall() {
+@@ -402,17 +419,20 @@ sysupgrade_postinstall() {
+         postinstall "-d${destdir}/" ${sflags} fix \
+             $(shtk_config_get POSTINSTALL_AUTOFIX)
+     fi
+-    postinstall "-d${destdir}/" ${sflags} "${@:-check}" \
++    /usr/sbin/postinstall "-d${destdir}/" ${sflags} "${@:-check}" \
+         || shtk_cli_error "Some postinstall(8) checks have failed"
+ }
+ 
  
  # Cleans up the cache directory.
  sysupgrade_clean() {



Home | Main Index | Thread Index | Old Index