mkinstalldirs revision 5c526acb82c882e41b655c31f5fa4425c87b671c
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater#! /bin/sh
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# mkinstalldirs --- make directory hierarchy
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Author: Noah Friedman <friedman@prep.ai.mit.edu>
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Created: 1993-05-16
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# Public domain
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# $Id: mkinstalldirs,v 1.1 2003/06/04 00:25:33 marka Exp $
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updatererrstatus=0
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterfor file
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterdo
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater shift
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater pathcomp=
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater for d
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater do
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater pathcomp="$pathcomp$d"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater case "$pathcomp" in
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater -* ) pathcomp=./$pathcomp ;;
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater esac
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater if test ! -d "$pathcomp"; then
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater echo "mkdir $pathcomp"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater mkdir "$pathcomp" || lasterr=$?
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater if test ! -d "$pathcomp"; then
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater errstatus=$lasterr
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater fi
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater fi
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater pathcomp="$pathcomp/"
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater done
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterdone
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterexit $errstatus
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater# mkinstalldirs ends here
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater