summaryrefslogtreecommitdiffstats
path: root/makemod
diff options
context:
space:
mode:
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
commit3a94ab11a137b56e8b42e4d99caff2bccd2daad3 (patch)
tree4c7944fa8ccb2e34409a967489ad1966e269e572 /makemod
parent6c5f2ee34128112eebc19306362a65f785fa95b6 (diff)
downloadliveslak-3a94ab11a137b56e8b42e4d99caff2bccd2daad3.tar.gz
liveslak-3a94ab11a137b56e8b42e4d99caff2bccd2daad3.tar.xz
makemod: fix the logic.
Diffstat (limited to 'makemod')
-rwxr-xr-xmakemod21
1 files changed, 10 insertions, 11 deletions
diff --git a/makemod b/makemod
index 27ba575..ae030c9 100755
--- a/makemod
+++ b/makemod
@@ -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