pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/pkg_rolling-replace



Module Name:    pkgsrc
Committed By:   rhialto
Date:           Tue Apr 13 17:51:21 UTC 2021

Modified Files:
        pkgsrc/pkgtools/pkg_rolling-replace: Makefile
        pkgsrc/pkgtools/pkg_rolling-replace/files: pkg_rolling-replace.8
            pkg_rolling-replace.sh

Log Message:
pkg_rolling-replace: catch permission errors from pkg_admin

and print a friendlier warning message instead (only once).
Document that the mismatch state may not persist if permissions are
insufficient.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 pkgsrc/pkgtools/pkg_rolling-replace/Makefile
cvs rdiff -u -r1.21 -r1.22 \
    pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
cvs rdiff -u -r1.42 -r1.43 \
    pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkg_rolling-replace/Makefile
diff -u pkgsrc/pkgtools/pkg_rolling-replace/Makefile:1.47 pkgsrc/pkgtools/pkg_rolling-replace/Makefile:1.48
--- pkgsrc/pkgtools/pkg_rolling-replace/Makefile:1.47   Fri Jan 15 10:56:52 2021
+++ pkgsrc/pkgtools/pkg_rolling-replace/Makefile        Tue Apr 13 17:51:21 2021
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.47 2021/01/15 10:56:52 tnn Exp $
+# $NetBSD: Makefile,v 1.48 2021/04/13 17:51:21 rhialto Exp $
 
-PKGNAME=       pkg_rolling-replace-0.24.10
+PKGNAME=       pkg_rolling-replace-0.24.11
 CATEGORIES=    pkgtools
 
 MAINTAINER=    gdt%NetBSD.org@localhost

Index: pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
diff -u pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8:1.21 pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8:1.22
--- pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8:1.21        Sat Jan  9 19:12:46 2021
+++ pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8     Tue Apr 13 17:51:21 2021
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_rolling-replace.8,v 1.21 2021/01/09 19:12:46 rhialto Exp $
+.\" $NetBSD: pkg_rolling-replace.8,v 1.22 2021/04/13 17:51:21 rhialto Exp $
 .Dd February 1, 2010
 .Dt PKG_ROLLING-REPLACE 8
 .Os
@@ -133,6 +133,9 @@ Use
 to check for mismatched packages, mark them with 'mismatch=YES',
 and replace those too.
 Otherwise, consider packages marked 'mismatch=YES' to be mismatched.
+Marking with 'mismatch=YES' only occurs if the calling user can write
+to the package database. It is not an error if this fails; it just does not
+persist the status.
 .It Fl v
 Verbose output.
 .It Fl X Ar pkgs

Index: pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
diff -u pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh:1.42 pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh:1.43
--- pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh:1.42       Fri Jan 15 10:56:52 2021
+++ pkgsrc/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh    Tue Apr 13 17:51:21 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: pkg_rolling-replace.sh,v 1.42 2021/01/15 10:56:52 tnn Exp $
+# $NetBSD: pkg_rolling-replace.sh,v 1.43 2021/04/13 17:51:21 rhialto Exp $
 #<license>
 # Copyright (c) 2006 BBN Technologies Corp.  All rights reserved.
 #
@@ -152,6 +152,8 @@ OPC='rr>' # continuation
 # supported.  Newer versions may or may not work (patches welcome).
 check_packages_mismatched()
 {
+    warned_once=""
+
     ${PKG_CHK} -u -q $opt_B | egrep -v missing | while read line; do
         # duplicate output of pkg_chk to stderr (bypass $(...) or `...`)
         echo "${OPC} $line" 1>&2
@@ -160,7 +162,13 @@ check_packages_mismatched()
         for word in $line; do
             if [ "$(echo $word | egrep '^[^/]+-[0-9][^-/]*$')" ]; then
                if [ -z "$opt_F" ]; then
-                   ${PKG_ADMIN} set mismatch=YES "$word" 1>&2
+                   ${PKG_ADMIN} set mismatch=YES "$word" 2>&1 >/dev/null || {
+                       if [ -z "$warned_once" ]; then
+                           echo 1>&2 "$OPC WARNING: mismatch variable not set due to permissions;"
+                           echo 1>&2 "$OPC          mismatch status will not persist."
+                           warned_once=1
+                       fi
+                   }
                fi
                 echo $word | sed 's/-[0-9][^-]*$//'
                 break  #done with this line



Home | Main Index | Thread Index | Old Index