diff options
Diffstat (limited to 'compat32-tools')
-rwxr-xr-x | compat32-tools/massconvert32.sh | 102 |
1 files changed, 44 insertions, 58 deletions
diff --git a/compat32-tools/massconvert32.sh b/compat32-tools/massconvert32.sh index cf3796a..bd56470 100755 --- a/compat32-tools/massconvert32.sh +++ b/compat32-tools/massconvert32.sh @@ -130,6 +130,34 @@ function get_pkgfullpath () { done } +# A function to cconvert a package, +# downloading it first if needed, and taking patches into account: +function conv_pkg () { + local BP="$1" + 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 + echo "--- Using Slackware's patch package for $BP" + PKGPATH="../patches/packages/$BP" + SLACK32URLFIX="$(dirname $SLACK32URL)/patches" + else + PKGPATH="$SERIES/$BP" + SLACK32URLFIX="$SLACK32URL" + fi + + [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/$PKGPATH $SLACK32URLFIX + FULLPKG=$(get_pkgfullpath $SLACK32ROOT/$PKGPATH) + if [ -z "$FULLPKG" ]; then + echo "*** FAIL: package '$BP' was not found!" + continue + fi + [ "$VERBOSE" = "1" ] && echo "--- $BP" + sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/${SERIES}-compat32 +} + # Safety checks in case a URL was provided: if [ -n "$SLACK32URL" ]; then if [ -n "$SLACK32ROOT" ]; then @@ -137,7 +165,7 @@ if [ -n "$SLACK32URL" ]; then exit 1 else # Define a 'temporary' root directory where we will download packages: - SLACK32ROOT="${TMP}/alienBOB" + SLACK32ROOT="${TMP}/alienBOB/slackware" if ! which lftp 1>/dev/null 2>&1 ; then echo "No lftp binary detected! Need lftp for package downloading!" exit 1 @@ -195,6 +223,13 @@ if [ -n "$TARGET64ROOT" -a ! -d "$TARGET64ROOT" ]; then fi fi +# Get a list of available patches +if [ -n "$SLACK32URL" ]; then + PATCH_LIST=$(echo $(lftp -c "open $(dirname $SLACK32URL)/patches/packages ; cls *.t?z" | rev | cut -f4- -d- |rev)) +else + PATCH_LIST=$(echo $(cd $(dirname $SLACK32ROOT)/patches/packages ; ls -1 *.t?z | rev | cut -f4- -d- |rev)) +fi + # This is the script's internal list of what I consider as the essential # 32bit multilib package set for your Slackware64: @@ -348,92 +383,43 @@ for TDIR in a-compat32 ap-compat32 d-compat32 l-compat32 n-compat32 x-compat32 x fi done -# Convert the 32bit packages from A AP D L N and X series: +# Convert the 32bit packages from A AP D L N and X series, checking for patches: echo "***" echo "*** Starting the conversion process:" echo "*** 'A' series:" for INPKG in $A_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/a/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/a/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/a-compat32 + conv_pkg $INPKG a "$PATCH_LIST" done echo "*** 'AP' series:" for INPKG in $AP_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/ap/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/ap/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/ap-compat32 + conv_pkg $INPKG ap "$PATCH_LIST" done echo "*** 'D' series:" for INPKG in $D_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/d/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/d/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/d-compat32 + conv_pkg $INPKG d "$PATCH_LIST" done echo "*** 'L' series:" for INPKG in $L_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/l/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/l/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/l-compat32 + conv_pkg $INPKG l "$PATCH_LIST" done echo "*** 'N' series:" for INPKG in $N_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/n/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/n/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/n-compat32 + conv_pkg $INPKG n "$PATCH_LIST" done echo "*** 'X' series:" for INPKG in $X_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/x/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/x/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/x-compat32 + conv_pkg $INPKG x "$PATCH_LIST" done echo "*** 'XAP' series:" for INPKG in $XAP_COMPAT32 ; do - [ -n "$SLACK32URL" ] && download_pkg $SLACK32ROOT/xap/$INPKG $SLACK32URL - FULLPKG=$(get_pkgfullpath $SLACK32ROOT/xap/$INPKG) - if [ -z "$FULLPKG" ]; then - echo "*** FAIL: package '$INPKG' was not found!" - continue - fi - [ "$VERBOSE" = "1" ] && echo "--- $INPKG" - sh $CONV32 -i $FULLPKG -d $TARGET64ROOT/xap-compat32 + conv_pkg $INPKG xap "$PATCH_LIST" done |