diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-02-27 15:05:44 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-02-27 15:05:44 +0000 |
commit | f30558325f227a1ef761cf658f186d2465c86565 (patch) | |
tree | b9fc2cd4a3f2ace46066ff6dccfb54365aa230d1 /solenv/bin/mkdir.pl | |
parent | 02d34de281504f97b21feb5f27e321af8dd590b6 (diff) |
#i10000# Add dummy option -p as it is statet in the header.
Diffstat (limited to 'solenv/bin/mkdir.pl')
-rwxr-xr-x | solenv/bin/mkdir.pl | 60 |
1 files changed, 32 insertions, 28 deletions
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; } |