Received: by mail.netbsd.org (Postfix, from userid 605) id 573F084DA1; Tue, 13 Apr 2021 17:51:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 8E69A84D8E for ; Tue, 13 Apr 2021 17:51:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id u6ULQql6lLhy for ; Tue, 13 Apr 2021 17:51:22 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id E617F84CE8 for ; Tue, 13 Apr 2021 17:51:21 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id D8DEEFA95; Tue, 13 Apr 2021 17:51:21 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1618336281141120" MIME-Version: 1.0 Date: Tue, 13 Apr 2021 17:51:21 +0000 From: "Olaf Seibert" Subject: CVS commit: pkgsrc/pkgtools/pkg_rolling-replace To: pkgsrc-changes@NetBSD.org Reply-To: rhialto@netbsd.org X-Mailer: log_accum Message-Id: <20210413175121.D8DEEFA95@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1618336281141120 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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. --_----------=_1618336281141120 Content-Disposition: inline Content-Length: 3268 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii 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 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 $ # # 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 --_----------=_1618336281141120--