X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fvserver-build.template;fp=scripts%2Fvserver-build.template;h=be73e10a55df2f7a95257a0cda723071fcf5e425;hb=4415d2a7377be61789eb5a6e35222962cbe7a146;hp=bd495caa4b7baadb4dcd401a7e1d0a9ebfaaa697;hpb=b0a62d195efca12c5cb9e7c0b3bea3be2cd57fc9;p=util-vserver.git diff --git a/scripts/vserver-build.template b/scripts/vserver-build.template index bd495ca..be73e10 100644 --- a/scripts/vserver-build.template +++ b/scripts/vserver-build.template @@ -1,4 +1,4 @@ -# $Id: vserver-build.template 2532 2007-04-21 14:05:32Z dhozac $ --*- sh -*-- +# $Id: vserver-build.template 2558 2007-07-10 20:34:48Z dhozac $ --*- sh -*-- # Copyright (C) 2006 Enrico Scholz # @@ -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" && {