diff options
author | Adrien Nader <adrien@notk.org> | 2016-09-16 05:40:07 +0200 |
---|---|---|
committer | Adrien Nader <adrien@notk.org> | 2016-09-16 05:40:07 +0200 |
commit | f0b2b66d4708624c333e4ac23046cf43ec4d4b70 (patch) | |
tree | 580685cf1992c17332720cfc7ea16b9fbe4fa828 /slackware64-current/source/a/pkgtools | |
parent | e03220e97bbe23747c45389640fcb9aba74e170d (diff) |
Thu Sep 15 22:54:52 UTC 2016
a/bash-4.4.0-x86_64-1.txz: Upgraded.
a/btrfs-progs-v4.7.2-x86_64-1.txz: Upgraded.
a/e2fsprogs-1.43.3-x86_64-1.txz: Upgraded.
a/pkgtools-14.2-noarch-12.txz: Rebuilt.
removepkg: Fixed removing packages with >= 3 hyphens in the package name
when using just the package name rather than the full name including
version, arch, and build.
Thanks to coralfang for the bug report, Jim Hawkins and Stuart Winter for
the patch, and SeB for testing and feedback.
removepkg: Handle filenames that contain backslashes.
Thanks to aaazen for the bug report and patch.
ap/vim-8.0.0005-x86_64-1.txz: Upgraded.
n/curl-7.50.3-x86_64-1.txz: Upgraded.
Fixed heap overflows in four libcurl functions: curl_escape(),
curl_easy_escape(), curl_unescape() and curl_easy_unescape().
For more information, see:
https://curl.haxx.se/docs/adv_20160914.html
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-7167
(* Security fix *)
xap/vim-gvim-8.0.0005-x86_64-1.txz: Upgraded.
Diffstat (limited to 'slackware64-current/source/a/pkgtools')
-rwxr-xr-x | slackware64-current/source/a/pkgtools/pkgtools.SlackBuild | 2 | ||||
-rw-r--r-- | slackware64-current/source/a/pkgtools/scripts/removepkg | 101 |
2 files changed, 54 insertions, 49 deletions
diff --git a/slackware64-current/source/a/pkgtools/pkgtools.SlackBuild b/slackware64-current/source/a/pkgtools/pkgtools.SlackBuild index 8a5648114..b186cefc4 100755 --- a/slackware64-current/source/a/pkgtools/pkgtools.SlackBuild +++ b/slackware64-current/source/a/pkgtools/pkgtools.SlackBuild @@ -29,7 +29,7 @@ PKG=$TMP/package-pkgtools # *** UPDATE THESE WITH EACH BUILD: VERSION=14.2 ARCH=${ARCH:-noarch} -BUILD=11 +BUILD=12 if [ ! -d $TMP ]; then mkdir -p $TMP # location to build the source diff --git a/slackware64-current/source/a/pkgtools/scripts/removepkg b/slackware64-current/source/a/pkgtools/scripts/removepkg index 2813fc3c5..f6b3bc4ea 100644 --- a/slackware64-current/source/a/pkgtools/scripts/removepkg +++ b/slackware64-current/source/a/pkgtools/scripts/removepkg @@ -1,6 +1,43 @@ #!/bin/sh # Slackware remove package script # +# Copyright 1994, 1995, 1998 Patrick Volkerding, Moorhead, Minnesota USA +# Copyright 2001, Slackware Linux, Inc., Concord, CA USA +# Copyright 2009, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# Thu Sep 15 17:46:28 UTC 2016 <volkerdi> +# If removepkg is called with a short package name (no -$VERSION-$ARCH-$BUILD), +# remove the most recently installed matching package, not the oldest one. +# +# Thu Sep 15 08:09:01 BST 2016 <mozes> +# - Handle finding >1 match for a package. Thanks to SeB on LQ for the feedback. +# +# Wed Sep 14 20:44:00 BST 2016 <mozes> +# - Modify package_name function to cater for package file names that contain +# >=4 hyphens. +# Thanks to coralfang on LQ for the report and to Jim Hawkins for the patch. +# - Modified to handle packages that contain file names with backslashes +# Thanks to aaazen on LQ for the report and the patch. +# # Thu Sep 24 03:31:58 UTC 2015 <alphageek> # extract_links() sed adjusted to handle symlinks with spaces. # @@ -76,28 +113,8 @@ # Original Version from Slackware 3.0 # -# Copyright 1994, 1995, 1998 Patrick Volkerding, Moorhead, Minnesota USA -# Copyright 2001, Slackware Linux, Inc., Concord, CA USA -# Copyright 2009, 2015 Patrick J. Volkerding, Sebeka, MN, USA -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# +# Needed to find package names within the 'remove_packages' function: +shopt -s extglob # Return a package name that has been stripped of the dirname portion # and any of the valid extensions (only): @@ -190,7 +207,9 @@ keep_links() { } delete_files() { - while read FILE ; do + local unset LC_ALL # Locally (within this delete_files function) allow handling of backslashes + while read -r AFILE ; do # do not expand backslashes on read + FILE=$(printf "$AFILE") # unescape octal characters if [ ! -d "$ROOT/$FILE" ]; then if [ -r "$ROOT/$FILE" ]; then if [ "$ROOT/$FILE" -nt "$ADM_DIR/packages/$PKGNAME" ]; then @@ -259,21 +278,10 @@ delete_cats() { done } -package_name() { - STRING=$(pkgbase $1 | sed 's?-[^-]*-[^-]*-[^-]*$??') - # If we don't do this, commands run later will take the '-' to be an option - # and will destroy the package database. Packages should not contain spaces - # in them. Normally this type of problem results from a command line typo. - if [ "$(echo $STRING | cut -b 1)" = "-" ]; then - STRING="malformed-package-name-detected" - fi - echo $STRING -} - # Conversion to 'comm' utility by Mark Wisdom. # is pretty nifty! :^) remove_packages() { - for PKGLIST in $* + for PKGLIST in $* do PKGNAME=$(pkgbase $PKGLIST) echo @@ -285,19 +293,17 @@ remove_packages() { # be removed. If you want to remove them all, you'll need to run # removepkg again until it removes all the same-named packages. if [ ! -e $ADM_DIR/packages/$PKGNAME ]; then - SHORT="$(package_name $PKGNAME)" - for long_package in $ADM_DIR/packages/${PKGNAME}* ; do - if [ "$SHORT" = "$(package_name $long_package)" ]; then - PKGNAME="$(basename $long_package)" - fi - done - fi - - if [ ! -e $ADM_DIR/packages/$PKGNAME ]; then - long_package=$(ls -1 $ADM_DIR/packages/${PKGNAME}* | grep -m 1 "^${PKGNAME}-[^-]*-[^-]*-[^-]*$") - if [ -e "$long_package" ]; then - PKGNAME=$(basename $long_package) + # Short name not found - finally try looking for full name - e.g. foo-1.0-arm-1 + pushd $ADM_DIR/packages > /dev/null + # Don't set PKGNAME if there are no matches: + if [ ! "$( ls -1 $PKGNAME-+([^-])-+([^-])-+([^-]) 2>/dev/null | wc -l )" = "0" ]; then + # If there is more than one package with the same name, set PKGNAME to the + # most recently installed version. This does not affect the behavior of + # upgradepkg, which always removes all other existing versions of the + # same package. + PKGNAME=$( ls -1t $PKGNAME-+([^-])-+([^-])-+([^-]) 2> /dev/null | head -n1 ) fi + popd > /dev/null fi if [ -r $ADM_DIR/packages/$PKGNAME ]; then @@ -392,4 +398,3 @@ else fi remove_packages $* - |