X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fvserver-build.template;h=77b73262033791d775ef7792b16ecf59234d0c2a;hb=58df27cf3be8958d7a053fcbdddf93cd23a14ca9;hp=dc5d1c0d75bdb341341106a8684625c350dccf04;hpb=de1e8b57109c4add4b4406d62fe67c3fe6ee8ffe;p=util-vserver.git diff --git a/scripts/vserver-build.template b/scripts/vserver-build.template index dc5d1c0..77b7326 100644 --- a/scripts/vserver-build.template +++ b/scripts/vserver-build.template @@ -48,6 +48,13 @@ done getDistribution '' 1 +for d in "$__CONFDIR/.distributions/$DISTRIBUTION" \ + "$__DISTRIBDIR/$DISTRIBUTION"; do + if test -r "$d/template"; then + TEMPLATE=( "$d/template" "${TEMPLATE[@]}" ) + fi +done + base.init test -z "$use_pkgmgmt" || pkgmgmt.initVariables @@ -62,30 +69,15 @@ test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_V pushd "$SETUP_CONFDIR/vdir" &> /dev/null for t in "${TEMPLATE[@]}"; do - mime=$($_FILE -Nbiz -m "$_LIB_MAGIC" "$t") - compression=$(echo "$mime" | $_GREP '(' | $_SED 's!.*(\(.*\))$!\1!') - - case "$compression" in - application/x-bzip2) DECOMPRESS="$_BZIP2 -d -c";; - application/x-gzip) DECOMPRESS="$_GZIP -d -c";; - "") DECOMPRESS=$_CAT;; - *) - echo "Unsupported compression method: $compression" - exit 1 - ;; - esac + findFile DESC "$__CONFDIR/.defaults/apps/h2ext/desc" "$__PKGLIBDEFAULTDIR/h2ext.desc" + pipe=$($_H2EXT -d "$DESC" -q "$t") - case "$mime" in - application/x-tar*) EXTRACT="$_TAR -x";; - application/x-cpio*) EXTRACT="$_CPIO -i";; - application/x-dump*) EXTRACT="$_RESTORE -rf -";; - *) - echo "Unsupported packaging method: $mime" - exit 1 - ;; - esac + if echo "$pipe" | grep -q "unknown format"; then + echo "vserver-build.template: $t: Unknown format" >&2 + exit 1 + fi - $DECOMPRESS "$t" | $EXTRACT + eval `echo $_CAT "\$t" '|' $pipe` done test -z "$no_dev_sanity" && {