From f30558325f227a1ef761cf658f186d2465c86565 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Fri, 27 Feb 2004 15:05:44 +0000 Subject: #i10000# Add dummy option -p as it is statet in the header. --- solenv/bin/mkdir.pl | 60 ++++++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'solenv/bin/mkdir.pl') diff --git a/solenv/bin/mkdir.pl b/solenv/bin/mkdir.pl index 451272e369c6..d2a374adfc67 100755 --- a/solenv/bin/mkdir.pl +++ b/solenv/bin/mkdir.pl @@ -21,41 +21,45 @@ while ( $#ARGV >= 0 ) { shift @ARGV ; shift @ARGV ; } + elsif ( $ARGV[0] eq "-p" ) { + shift @ARGV ; + # -p does not do anything, it's supported just for compatibility + } else { -$ARGV[0] =~ s?\\|:?/?g ; -@SUBDIRS = split "/", $ARGV[0] ; + $ARGV[0] =~ s?\\|:?/?g ; + @SUBDIRS = split "/", $ARGV[0] ; -# absolute path UNIX -if ( $SUBDIRS[0] eq "" ) { - chdir '/' ; - shift @SUBDIRS ; -} -# absolute path WINDOWS -if ( $#SUBDIRS > 1 ) { - if ( $SUBDIRS[1] eq "" ) { - if ( $SUBDIRS[0] =~ /\w/ ) { - chdir "$SUBDIRS[0]:\\" ; - shift @SUBDIRS ; + # absolute path UNIX + if ( $SUBDIRS[0] eq "" ) { + chdir '/' ; shift @SUBDIRS ; - } ; - } ; -} - - -while (@SUBDIRS) { - if ( -e $SUBDIRS[0] ) { - if ( ! -d $SUBDIRS[0] ) { - die "file exists\n" } } - else { - mkdir $SUBDIRS[0], $MODE or die "Can't create directory $SUBDIRS[0]" + # absolute path WINDOWS + if ( $#SUBDIRS > 1 ) { + if ( $SUBDIRS[1] eq "" ) { + if ( $SUBDIRS[0] =~ /\w/ ) { + chdir "$SUBDIRS[0]:\\" ; + shift @SUBDIRS ; + shift @SUBDIRS ; + } ; + } ; } - chdir $SUBDIRS[0] or die "Can't cd to $SUBDIRS[0]" ; - shift @SUBDIRS ; - } ; - shift @ARGV ; + while (@SUBDIRS) { + if ( -e $SUBDIRS[0] ) { + if ( ! -d $SUBDIRS[0] ) { + die "file exists\n" + } + } + else { + mkdir $SUBDIRS[0], $MODE or die "Can't create directory $SUBDIRS[0]" + } + chdir $SUBDIRS[0] or die "Can't cd to $SUBDIRS[0]" ; + shift @SUBDIRS ; + } ; + + shift @ARGV ; } ; chdir $currdir; } -- cgit