SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Pat, thank you for implementing --terse for pkgtools.
While reviewing your changes, I saw these patch suggestions:
Code:
From: xsane <@linuxquestions.org>
Date: Wed, 30 May 2018 22:58:43 -0400
Subject: [PATCH 1/5] upgradepkg: update usage()
* Add options list
* Update usage examples
* Leave the operational details to the man page.
Patched:
upgradepkg --help
Usage: upgradepkg [options] <newpackage> ...
upgradepkg [options] <oldpackage%newpackage> ...
Upgrade, install, or reinstall Slackware packages (.tgz, .tbz, .tlz, .txz).
To operate on an alternate directory, such as /mnt:
ROOT=/mnt upgradepkg package.tgz
Options:
--dry-run only display what would be done
--install-new install new packages also
--reinstall upgrade packages of the same version
--terse display a single line for each package operation
--terselength <length> maximum line length of terse output
--verbose display all the gory details of the upgrade
--help display this help
For more details see upgradepkg(8).
---
upgradepkg | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/upgradepkg b/upgradepkg
index 1acae7d..239bed1 100755
--- a/upgradepkg
+++ b/upgradepkg
@@ -62,27 +62,24 @@ pkgbase() {
usage() {
cat << EOF
-Usage: upgradepkg newpackage [newpackage2 ... ]
- upgradepkg oldpackage%newpackage [oldpackage2%newpackage2 ... ]
+Usage: upgradepkg [options] <newpackage> ...
+ upgradepkg [options] <oldpackage%newpackage> ...
-Upgradepkg upgrades a Slackware package (.tgz, .tbz, .tlz, .txz) from an
-older version to a newer one. It does this by INSTALLING the new package
-onto the system, and then REMOVING any files from the old package that
-aren't in the new package. If the old and new packages have the same
-name, a single argument is all that is required. If the packages have
-different names, supply the name of the old package followed by a percent
-symbol (%), then the name of the new package. Do not add any extra
-whitespace between pairs of old/new package names.
+Upgrade, install, or reinstall Slackware packages (.tgz, .tbz, .tlz, .txz).
-Before upgrading a package, save any configuration files (such as in /etc)
-that you wish to keep. Sometimes these will be preserved, but it depends
-on the package. If you want to force new versions of the config files
-to be installed, remove the old ones manually prior to running upgradepkg.
+To operate on an alternate directory, such as /mnt:
+ ROOT=/mnt upgradepkg package.tgz
-To upgrade in a directory other than / (such as /mnt):
-
- ROOT=/mnt upgradepkg package.tgz (or .tbz, .tlz, .txz)
+Options:
+ --dry-run only display what would be done
+ --install-new install new packages also
+ --reinstall upgrade packages of the same version
+ --terse display a single line for each package operation
+ --terselength <length> maximum line length of terse output
+ --verbose display all the gory details of the upgrade
+ --help display this help
+For more details see upgradepkg(8).
EOF
}
Code:
From: xsane <@linuxquestions.org>
Date: Wed, 30 May 2018 22:45:19 -0400
Subject: [PATCH 2/5] upgradepkg.8: package design is not a bug
If a package does not protect its configuration files that
is not an upgradepkg bug.
Move the information from the BUGS section to the DESCRIPTION
section where it is more visible, because it has been removed
from the usage() output.
---
upgradepkg.8 | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/upgradepkg.8 b/upgradepkg.8
index af52664..757d600 100644
--- a/upgradepkg.8
+++ b/upgradepkg.8
@@ -66,7 +66,12 @@ If the old and new packages have the same name, a single argument is all that
is required. If the packages have different names, supply the name of the
old package followed by a percent symbol (%), then the name of the new package.
Do not add any extra whitespace between pairs of old/new package names.
-
+.P
+Before upgrading a package, save any configuration files (such as in /etc)
+that you wish to keep. Sometimes these will be preserved, but it depends on
+the package structure. If you want to force new versions of the config files
+to be installed, remove the old ones manually prior to running upgradepkg.
+.P
If upgradepkg finds more than one installed package matching the old package's
name, it will remove them all.
.TP
@@ -101,11 +106,6 @@ Maximum line length of --terse mode output. Default is the number of terminal co
.TP
.B \--verbose
Show all the gory details of the upgrade.
-.SH BUGS
-Before upgrading a package, save any configuration files (such as in /etc)
-that you wish to keep. Sometimes these will be preserved, but it depends on
-the package structure. If you want to force new versions of the config files
-to be installed, remove the old ones manually prior to running upgradepkg.
.SH AUTHOR
Patrick J. Volkerding <volkerdi@slackware.com>
.SH "SEE ALSO"
Code:
From: xsane <@linuxquestions.org>
Date: Wed, 30 May 2018 23:11:02 -0400
Subject: [PATCH 3/5] upgradepkg: help was missed when adding -options
---
upgradepkg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/upgradepkg b/upgradepkg
index a9ca423..b267461 100755
--- a/upgradepkg
+++ b/upgradepkg
@@ -103,7 +103,7 @@ else
fi
# --help or no args?
-if [ "$1" = "" -o "$1" = "--help" -o "$1" = "-?" ]; then
+if [ "$1" = "" -o "$1" = "-help" -o "$1" = "--help" -o "$1" = "-?" ]; then
usage;
exit 1;
fi
Code:
From: xsane <@linuxquestions.org>
Date: Sun, 3 Jun 2018 20:38:33 -0400
Subject: [PATCH 4/5] upgradepkg: terse output one line for failures too
If the concept of terse is to output a single line for each
package that is operated upon, then failures need a single
output line as well.
My use case for --terse is to have a concise list to review
when operating over many packages, or series of packages. I
kinda want know about failures too.
For example current:
upgradepkg foo.txz%package.tgz
Error: there is no installed package named foo.
(looking for /var/log/packages/foo)
upgradepkg --terse foo.txz%package.tgz
<crickets>
Patched:
upgradepkg --terse foo.txz%package.tgz
Error: there is no installed package named foo.
---
upgradepkg | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/upgradepkg b/upgradepkg
index b267461..adfb6b8 100755
--- a/upgradepkg
+++ b/upgradepkg
@@ -205,7 +205,7 @@ for ARG; do
# Simple package integrity check:
if ! [ -f "$NEW" ]; then
ERRCODE=4
- ! [ $TERSE ] && echo "Cannot install $ARG: file not found"
+ echo "Cannot install $ARG: file not found"
continue;
fi
@@ -221,7 +221,7 @@ for ARG; do
# Make sure the extension is valid:
if [ "$NNAME" = "$NEW" ]; then
# We won't throw an ERRCODE for this, but the package is skipped:
- ! [ $TERSE ] && echo "Cannot install $OLD: invalid package extension"
+ echo "Cannot install $OLD: invalid package extension"
continue;
fi
@@ -247,7 +247,7 @@ for ARG; do
echo "$OLD would not be upgraded (no installed package named $SHORT)."
else
! [ $TERSE ] && echo
- ! [ $TERSE ] && echo "Error: there is no installed package named $OLD."
+ echo "Error: there is no installed package named $OLD."
! [ $TERSE ] && echo " (looking for $ROOT/var/log/packages/$OLD)"
! [ $TERSE ] && echo
fi
@@ -283,7 +283,7 @@ EOF
echo "$NEW incoming package not found (command line)."
else
! [ $TERSE ] && echo
- ! [ $TERSE ] && echo "Error: incoming package $INCOMINGDIR/$NNAME not found."
+ echo "Error: incoming package $INCOMINGDIR/$NNAME not found."
! [ $TERSE ] && echo
fi
ERRCODE=1
Code:
From: xsane <@linuxquestions.org>
Date: Sun, 3 Jun 2018 21:03:18 -0400
Subject: [PATCH 5/5] upgradepkg: print new package only when not found
Current:
upgradepkg foo.txz%bar.txz
Cannot install foo.txz%bar.txz: file not found
Patched:
upgradepkg foo.txz%bar.txz
Cannot install bar.txz: file not found
---
upgradepkg | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/upgradepkg b/upgradepkg
index adfb6b8..3c8b103 100755
--- a/upgradepkg
+++ b/upgradepkg
@@ -205,7 +205,7 @@ for ARG; do
# Simple package integrity check:
if ! [ -f "$NEW" ]; then
ERRCODE=4
- echo "Cannot install $ARG: file not found"
+ echo "Cannot install $NEW: file not found"
continue;
fi
When will slackpkg natively offer the ability to install from third party repos?
Wouldn't that break the KISS principle of Slackware and pollute the small but stable ecosystem of vanilla Slackware? Give users the ability to pull third party packages with slackpkg and expect waves of complaints after they break their systems because of that.
Not trying to play devil's advocate, just trying to understand the consequences of such a feature, because if slackpkg gets it, I'll just instinctively avoid using it for the above reasons. Sure one can invoke the argument that for example Alien's third party repo is authored by a respected skilled Slackware contributor and is unlikely to contain unstable stuff, but that's rather an exception that would confirm the rule.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.