summaryrefslogtreecommitdiffstats
path: root/compat32-tools
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2015-07-20 11:23:18 +0000
committer Eric Hameleers <alien@slackware.com>2015-07-20 11:23:18 +0000
commit12a4eb8e576390a5188b12422cd058f6e0abb99f (patch)
tree2fd3d397320833c22c08132121e6ea52e07c7534 /compat32-tools
parentea3b7ace4fefaa07ca04310b9e9da0ca6d73613b (diff)
downloadmultilib-12a4eb8e576390a5188b12422cd058f6e0abb99f.tar.gz
multilib-12a4eb8e576390a5188b12422cd058f6e0abb99f.tar.xz
Gracefully handle the fact that a/cups was moved to ap/cups after 14.1.
Diffstat (limited to 'compat32-tools')
-rwxr-xr-xcompat32-tools/massconvert32.sh91
1 files changed, 61 insertions, 30 deletions
diff --git a/compat32-tools/massconvert32.sh b/compat32-tools/massconvert32.sh
index 8933936..7a06348 100755
--- a/compat32-tools/massconvert32.sh
+++ b/compat32-tools/massconvert32.sh
@@ -152,19 +152,13 @@ function conv_pkg () {
local SERIES="$2"
local PATCHLIST="$3"
- # Does the package we want have a patch available?
- echo "$PATCHLIST" | tr - _ | grep -wq $(echo $BP |tr - _)
- if [ $? -eq 0 ]; then
- [ $VERBOSE -eq 1 ] && echo "--- Using Slackware's patch package for $BP"
- PKGPATH="../patches/packages/$BP"
- [ -n "$SLACK32URL" ] && SLACK32URLFIX="$(dirname $SLACK32URL)/patches"
- else
- PKGPATH="$SERIES/$BP"
- [ -n "$SLACK32URL" ] && SLACK32URLFIX="$SLACK32URL"
- fi
+ PKGPATH="$SERIES/$BP"
+ REPOFOUND=""
+ # First find out if the requested package exists in the repository:
+ # Two repo location options: URL or local directory.
if [ -n "$SLACK32URL" ]; then
- FULLURL=$(get_url_pkg $PKGPATH $SLACK32URLFIX)
+ FULLURL=$(get_url_pkg $PKGPATH $SLACK32URL)
if [ -n "$FULLURL" ]; then
FULLPKG=$SLACK32ROOT/$SERIES/$(basename $FULLURL)
REPOVERSION=$(basename $FULLURL |rev |cut -d- -f3 |rev)
@@ -186,32 +180,69 @@ function conv_pkg () {
fi
fi
- if [ -z "$FULLPKG" ]; then
- [ $VERBOSE -eq 1 ] && echo "*** FAIL: package '$BP' was not found in repository!"
- continue
- else
+ if [ -n "$FULLPKG" ]; then
# The requested original was found in the repository.
- # Do we have a local converted package already?
- HAVE_COMPAT32="$(get_pkgfullpath $TARGET64ROOT/${SERIES}-compat32/$BP-compat32)"
- if [ -n "$HAVE_COMPAT32" ]; then
- COMPAT32VERSION="$(echo "$HAVE_COMPAT32" |rev|cut -d- -f3|rev)"
- COMPAT32BLD="$(echo "$HAVE_COMPAT32" |rev|cut -d- -f1|cut -d. -f2-|rev)"
- if [ "$COMPAT32VERSION" = "$REPOVERSION" -a "${COMPAT32BLD%compat32}" = "$REPOBLD" ]
- then
- [ $VERBOSE -eq 1 ] && echo "--- ${BP}-compat32 version '$COMPAT32VERSION' already available"
+ REPOFOUND="yes"
+ # Does the package we want have a patch available?
+ echo "$PATCHLIST" | tr - _ | grep -wq $(echo $BP |tr - _)
+ if [ $? -eq 0 ]; then
+ [ $VERBOSE -eq 1 ] && echo "--- Using Slackware's patch package for $BP"
+ PKGPATH="../patches/packages/$BP"
+ if [ -n "$SLACK32URL" ]; then
+ FULLURL=$(get_url_pkg $PKGPATH "$(dirname $SLACK32URL)/patches")
+ if [ -n "$FULLURL" ]; then
+ FULLPKG=$SLACK32ROOT/$SERIES/$(basename $FULLURL)
+ REPOVERSION=$(basename $FULLURL |rev |cut -d- -f3 |rev)
+ REPOBLD="$(basename $FULLURL |rev |cut -d- -f1 |cut -d. -f2- |rev)"
+ else
+ FULLPKG=""
+ REPOVERSION=""
+ REPOBLD=""
+ fi
else
- if [ $DRYRUN -eq 0 ]; then
- echo ">>> Deleting old version '$COMPAT32VERSION' of '${BP}-compat32'"
+ FULLPKG=$(get_pkgfullpath $SLACK32ROOT/$PKGPATH)
+ if [ -n "$FULLPKG" ]; then
+ REPOVERSION="$(basename $FULLPKG |rev |cut -d- -f3 |rev)"
+ REPOBLD="$(basename $FULLPKG |rev |cut -d- -f1 |cut -d. -f2- |rev)"
else
- echo "${BP}: existing package needs update"
+ REPOVERSION=""
+ REPOBLD=""
fi
- FILE_TO_REMOVE=$HAVE_COMPAT32
- HAVE_COMPAT32=""
fi
+ fi
+ fi
+
+ if [ -z "$FULLPKG" ]; then
+ if [ -n "$REPOFOUND" ]; then
+ [ $VERBOSE -eq 1 ] && echo "*** FAIL: patch-package for '$BP' was not found in repository (original package present, this means a repository mismatch)!"
else
- if [ $DRYRUN -eq 1 ]; then
- echo "${BP}: new package will be converted"
+ [ $VERBOSE -eq 1 ] && echo "*** FAIL: package '$BP' was not found in repository!"
+ fi
+ continue
+ fi
+
+ # Package (or patch) available - let's start!
+
+ # Do we have a local converted package already?
+ HAVE_COMPAT32="$(get_pkgfullpath $TARGET64ROOT/${SERIES}-compat32/$BP-compat32)"
+ if [ -n "$HAVE_COMPAT32" ]; then
+ COMPAT32VERSION="$(echo "$HAVE_COMPAT32" |rev|cut -d- -f3|rev)"
+ COMPAT32BLD="$(echo "$HAVE_COMPAT32" |rev|cut -d- -f1|cut -d. -f2-|rev)"
+ if [ "$COMPAT32VERSION" = "$REPOVERSION" -a "${COMPAT32BLD%compat32}" = "$REPOBLD" ]
+ then
+ [ $VERBOSE -eq 1 ] && echo "--- ${BP}-compat32 version '$COMPAT32VERSION' already available"
+ else
+ if [ $DRYRUN -eq 0 ]; then
+ echo ">>> Deleting old version '$COMPAT32VERSION' of '${BP}-compat32'"
+ else
+ echo "${BP}: existing package needs update"
fi
+ FILE_TO_REMOVE=$HAVE_COMPAT32
+ HAVE_COMPAT32=""
+ fi
+ else
+ if [ $DRYRUN -eq 1 ]; then
+ echo "${BP}: new package will be converted"
fi
fi