pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_rolling-replace pkgtools/pkg_rolling-repl...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b85a27b92b16
branches:  trunk
changeset: 444517:b85a27b92b16
user:      rhialto <rhialto%pkgsrc.org@localhost>
date:      Sat Jan 09 19:12:46 2021 +0000

description:
pkgtools/pkg_rolling-replace: Update to 0.24.9

When using the -u option to find mismatched packages, mark each affected
package with 'mismatch=YES'. Otherwise, consider such packages as
targets to rebuild.
ok gdt@.

diffstat:

 pkgtools/pkg_rolling-replace/Makefile                     |   4 +-
 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8  |  30 ++++++----
 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh |  39 +++++++++-----
 3 files changed, 44 insertions(+), 29 deletions(-)

diffs (174 lines):

diff -r 69b727aef978 -r b85a27b92b16 pkgtools/pkg_rolling-replace/Makefile
--- a/pkgtools/pkg_rolling-replace/Makefile     Sat Jan 09 19:10:05 2021 +0000
+++ b/pkgtools/pkg_rolling-replace/Makefile     Sat Jan 09 19:12:46 2021 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.45 2019/08/27 19:30:36 gdt Exp $
+# $NetBSD: Makefile,v 1.46 2021/01/09 19:12:46 rhialto Exp $
 
-PKGNAME=       pkg_rolling-replace-0.24.8
+PKGNAME=       pkg_rolling-replace-0.24.9
 CATEGORIES=    pkgtools
 
 MAINTAINER=    gdt%NetBSD.org@localhost
diff -r 69b727aef978 -r b85a27b92b16 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8  Sat Jan 09 19:10:05 2021 +0000
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.8  Sat Jan 09 19:12:46 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_rolling-replace.8,v 1.20 2015/02/12 08:22:16 abs Exp $
+.\" $NetBSD: pkg_rolling-replace.8,v 1.21 2021/01/09 19:12:46 rhialto Exp $
 .Dd February 1, 2010
 .Dt PKG_ROLLING-REPLACE 8
 .Os
@@ -16,9 +16,10 @@
 .Nm
 runs
 .Dq make replace
-on packages that have been marked to have unsafe dependencies or have
-been marked to be rebuilt.
-Optionally it can replace any outdated packages (as reported by
+on packages that have been marked to have unsafe dependencies,
+to be mismatched, or marked to be rebuilt.
+Optionally it can discover, mark and replace any mismatched packages
+(as reported by
 .Xr pkg_chk 8 )
 as well.
 .Pp
@@ -68,13 +69,19 @@
 (Usually this results in packages being upgraded to newer versions,
 assuming the pkgsrc tree is more recent than the currently installed
 packages.)
+The packages discovered this way will be marked as mismatched, so that
+in a re-run of
+.Nm
+you don't need to repeat the
+.Fl u
+flag.
 .Ss Options
 .Bl -tag -width xxxxxxxx
 .It Fl B
 Pass
 .Dq -B
 to
-.Xl pkg_chk 8
+.Xr pkg_chk 8
 to also mark any packages with any change in build version data.
 .It Fl D Ar VARIABLE=VALUE
 Passes VARIABLE=VALUE to each make call.
@@ -122,8 +129,10 @@
 shared library problems.
 .It Fl u
 Use
-.Xl pkg_chk 8
-to check for outdated packages, and replace those too.
+.Xr pkg_chk 8
+to check for mismatched packages, mark them with 'mismatch=YES',
+and replace those too.
+Otherwise, consider packages marked 'mismatch=YES' to be mismatched.
 .It Fl v
 Verbose output.
 .It Fl X Ar pkgs
@@ -131,11 +140,8 @@
 from being rebuilt for any reason.
 .It Fl x Ar pkgs
 Exclude the comma-separated list of package base names
-from the check for outdated packages.
-This has no effect if the
-.Fl u
-flag is not given,
-and does not prevent packages from being rebuilt for any other reason
+from the check for mismatched packages.
+This does not prevent packages from being rebuilt for any other reason
 (such as being a dependency of another package that is also rebuilt,
 or having any of the
 .Xr pkg_admin 1
diff -r 69b727aef978 -r b85a27b92b16 pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh
--- a/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Sat Jan 09 19:10:05 2021 +0000
+++ b/pkgtools/pkg_rolling-replace/files/pkg_rolling-replace.sh Sat Jan 09 19:12:46 2021 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# $NetBSD: pkg_rolling-replace.sh,v 1.40 2019/08/27 19:30:36 gdt Exp $
+# $NetBSD: pkg_rolling-replace.sh,v 1.41 2021/01/09 19:12:46 rhialto Exp $
 #<license>
 # Copyright (c) 2006 BBN Technologies Corp.  All rights reserved.
 #
@@ -108,12 +108,12 @@
         -n         Don't actually do make replace
         -r         Just replace, don't create binary packages
         -s         Replace even if the ABIs are still compatible ("strict")
-        -u         Update outdated packages
+        -u         Update mismatched packages
         -v         Verbose
        -D VAR=VAL Passes given variables and values to make
         -L <path>  Log to path (<path>/pkgdir/pkg)
         -X <pkg>   exclude <pkg> from being rebuilt
-        -x <pkg>   exclude <pkg> from outdated check
+        -x <pkg>   exclude <pkg> from mismatch check
 
 pkg_rolling-replace does 'make replace' on one package at a time,
 tsorting the packages being replaced according to their
@@ -126,14 +126,14 @@
       'pkg_rolling-replace' (no arguments) to rebuild them against the
       new version.
 
-    - 'pkg_chk -u' will delete all your mismatched (outdated)
-      packages, then reinstall them one at a time, leaving you without
-      those packages in the meantime.  'pkg_rolling-replace -u' will
-      instead upgrade them in place, allowing you to keep using your
-      system in the meantime (maybe...if you're lucky...because
-      pkg_rolling-replace replaces the \"deepest\" dependency first,
-      things could still break if that happens to be a fundamental
-      library whose ABI has changed).
+    - 'pkg_chk -u' will delete all your mismatched packages (where the
+      package version does not match the pkgsrc version), then reinstall
+      them one at a time, leaving you without those packages in the
+      meantime.  'pkg_rolling-replace -u' will instead upgrade them in
+      place, allowing you to keep using your system in the meantime
+      (maybe...if you're lucky...because pkg_rolling-replace replaces
+      the \"deepest\" dependency first, things could still break if that
+      happens to be a fundamental library whose ABI has changed).
 "
     exit 1
 }
@@ -158,6 +158,9 @@
        # than category/pkg and remove the version.
         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
+               fi
                 echo $word | sed 's/-[0-9][^-]*$//'
                 break  #done with this line
             fi
@@ -374,14 +377,18 @@
 FAILED=""
 
 MISMATCH_TODO=
-if [ -n "$opt_u" -o -n "$opt_F" ]; then
+if [ -n "$opt_u" ]; then
     echo "${OPI} Checking for mismatched installed packages using pkg_chk"
     MISMATCH_TODO=$(check_packages_mismatched)
-    echo "${OPI} Excluding the following mismatched packages:"
-    echo "${OPC} EXCLUDE=[$EXCLUDE]"
-    MISMATCH_TODO=$(exclude $EXCLUDE --from $MISMATCH_TODO)
+else
+    echo "${OPI} Checking for mismatched installed packages (mismatch=YES)"
+    MISMATCH_TODO=$(check_packages_w_flag 'mismatch')
 fi
 
+echo "${OPI} Excluding the following mismatched packages:"
+echo "${OPC} EXCLUDE=[$EXCLUDE]"
+MISMATCH_TODO=$(exclude $EXCLUDE --from $MISMATCH_TODO)
+
 if [ -z "$opt_F" ]; then
     echo "${OPI} Checking for rebuild-requested installed packages (rebuild=YES)"
     REBUILD_TODO=$(check_packages_w_flag 'rebuild')
@@ -549,6 +556,8 @@
            abort "package $pkg still has unsafe_depends."
        [ -z "$(${PKG_INFO} -Q rebuild $pkg)" ] || \
            abort "package $pkg is still requested to be rebuilt."
+       [ -z "$(${PKG_INFO} -Q mismatch $pkg)" ] || \
+           abort "package $pkg is still a mismatched version."
     fi
     # If -r not given, make a binary package.
     if [ -z "$opt_r" -a -z "$fail" -a -z "$opt_F" ]; then



Home | Main Index | Thread Index | Old Index