- changed the way how temporary files/directories will be created:
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sun, 22 Jan 2006 12:36:07 +0000 (12:36 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sun, 22 Jan 2006 12:36:07 +0000 (12:36 +0000)
  * mktemp will now be called with the '-t' parameter and sometimes with
    '-p'
  * absolutes paths (e.g. '/tmp') were removed from the templates
  * with this changes, it is now possible to override the location of
    the temporary files by setting $TMPDIR. This should add a way to
    solve problems like debootstrap on non-executable tmp-directories
    (http://savannah.nongnu.org/bugs/?func=detailitem&item_id=15447)

  These changes require that 'mktemp' understands the following switches:

  * '-t'  ... Generate a path rooted in a temporary directory.
  * '-d'  ... Make a directory instead of a file.
  * '-p' ...  Use the specified directory as a prefix when generating
              the temporary filename.

  Because 'mktemp' from Debian Woody's 'debianutils_1.16.2woody1'
  supports these features every recent Linux distribution should do it
  also.

- allow to override path of the debootstrap binary with the $DEBOOTSTRAP
  environment variable

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2264 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/scripts/vserver-build.debootstrap

index af0cc93..56575d1 100644 (file)
@@ -48,9 +48,11 @@ function initFilesystem
 
 function findDebootstrap
 {
+    test ! -x "$DEBOOTSTRAP" || return 0
+
     pushd . &>/dev/null
     DEBOOTSTRAP=$(which debootstrap 2>/dev/null) || {
-        dir=$($_MKTEMPDIR /var/tmp/debootstrap.XXXXXX)
+        dir=$($_MKTEMPDIR -p /var/tmp debootstrap.XXXXXX)
         workdir=$dir
         dst=$dir/debootstrap.deb