diff options
author | Eric Hameleers <alien@slackware.com> | 2016-06-23 21:15:21 +0200 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2016-06-23 21:15:21 +0200 |
commit | 3a94ab11a137b56e8b42e4d99caff2bccd2daad3 (patch) | |
tree | 4c7944fa8ccb2e34409a967489ad1966e269e572 | |
parent | 6c5f2ee34128112eebc19306362a65f785fa95b6 (diff) | |
download | liveslak-3a94ab11a137b56e8b42e4d99caff2bccd2daad3.tar.gz liveslak-3a94ab11a137b56e8b42e4d99caff2bccd2daad3.tar.xz |
makemod: fix the logic.
Diffstat (limited to '')
-rwxr-xr-x | makemod | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -60,21 +60,20 @@ elif [ -f "$2" -a "$INTERACTIVE" = "YES" ]; then fi fi -# .sxz extension uses xz compression: -COMPR="xz" +MODEXT=$(echo "$2" |rev |cut -d'.' -f1 |rev) +case $MODEXT in + sxz) COMPR="xz" ;; + sgz) COMPR="gzip" ;; + xzm) COMPR="xz" ;; + *) echo "-- Unsupported module extension '$MODEXT'" ; exit 1 ;; +esac if [ -d "$1" ]; then - echo "Creating .sxz from directory." + echo "Creating .${MODEXT} module from directory using '$COMPR' compression." + TMPDIR=$(mktemp -t -d makesxz.XXXXXX) PKGDIR="$1" else - MODEXT=$(echo "$2" |rev |cut -d'.' -f1 |rev) - case $MODEXT in - sxz) COMPR="xz" ;; - sgz) COMPR="gzip" ;; - xzm) COMPR="xz" ;; - *) echo "-- Unsupported module extension '$MODEXT'" ; exit 1 ;; - esac - echo "Creating .${MODEXT} from package." + echo "Creating .${MODEXT} module from package using '$COMPR' compression." TMPDIR=$(mktemp -t -d makesxz.XXXXXX) PKGDIR="$TMPDIR" if [ ! -d $PKGDIR ]; then |