summaryrefslogtreecommitdiff
path: root/dh_installdirs
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:34:24 +0000
committerjoey <joey>1999-08-17 04:34:24 +0000
commit1e6dea44772a0c1f57e7cd50ff12e35a1cff0b96 (patch)
tree212e56dc8ea32cf27cd2a33ac901a92a701f063f /dh_installdirs
parentface7b5d7df5fb2b8f434bc7135f27b38329a5c5 (diff)
r11: Initial revision
Diffstat (limited to 'dh_installdirs')
-rwxr-xr-xdh_installdirs39
1 files changed, 39 insertions, 0 deletions
diff --git a/dh_installdirs b/dh_installdirs
new file mode 100755
index 00000000..bab883d7
--- /dev/null
+++ b/dh_installdirs
@@ -0,0 +1,39 @@
+#!/bin/sh -e
+#
+# Reads debian/dirs, creates the directories listed there there
+
+PATH=debian:$PATH:/usr/lib/debhelper
+. dh_lib
+
+for PACKAGE in $DH_DOPACKAGES; do
+ TMP=`tmpdir $PACKAGE`
+ EXT=`pkgext $PACKAGE`
+
+ if [ ! -d $TMP/usr/doc/$PACKAGE ]; then
+ doit "install -d $TMP/usr/doc/$PACKAGE"
+ fi
+
+ dirs=""
+
+ if [ -e debian/${EXT}dirs ]; then
+ dirs=`tr "\n" " " < debian/${EXT}dirs`
+ fi
+
+ if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then
+ dirs="$* $dirs"
+ fi
+
+ if [ "$dirs" ]; then
+ # Check to see if any of the dirs are absolute.
+ for dir in "$dirs" ; do
+ if expr "$dir" : "/" >/dev/null ; then
+ error "Absolute directory name \"$dir\" specified."
+ fi
+ done
+ # Create dirs.
+ verbose_echo "cd $TMP && install -d $dirs && cd ../.."
+ cd $TMP
+ install -d $dirs
+ cd ../..
+ fi
+done