diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-31 14:44:41 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-31 14:44:41 +0000 |
commit | 60002eef0eb1e4002135b6bf16c67d692c8dd746 (patch) | |
tree | 7048c08b4cc4dc00ab2225fe258b574bc5a53c97 /autoirpm.update | |
parent | 64f720ff50491bf8eff620a154d5318ab34912d9 (diff) | |
download | urpmi-60002eef0eb1e4002135b6bf16c67d692c8dd746.tar urpmi-60002eef0eb1e4002135b6bf16c67d692c8dd746.tar.gz urpmi-60002eef0eb1e4002135b6bf16c67d692c8dd746.tar.bz2 urpmi-60002eef0eb1e4002135b6bf16c67d692c8dd746.tar.xz urpmi-60002eef0eb1e4002135b6bf16c67d692c8dd746.zip |
no_comment
Diffstat (limited to 'autoirpm.update')
-rw-r--r-- | autoirpm.update | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/autoirpm.update b/autoirpm.update index 7be979ea..765aea6f 100644 --- a/autoirpm.update +++ b/autoirpm.update @@ -7,7 +7,7 @@ $BASE2 = "$DIR2/autoirpm"; $AUTO_INSTALL_BIN_LIST = "$BASE.binaries"; $INSTALL_SCRIPT_REP = "$BASE.scripts"; -system("gzip -dc $DIR/hdlist.*.gz | autoirpm.update-all $BASE2.allow $BASE2.deny - > $AUTO_INSTALL_BIN_LIST"); +system("bzip2 -dc $DIR/hdlist*.cz2 2>/dev/null | autoirpm.update-all $BASE2.allow $BASE2.deny - > $AUTO_INSTALL_BIN_LIST"); $? == 0 or die "autoirpm.upgrade-all failed\n"; open F, $AUTO_INSTALL_BIN_LIST or die; @@ -21,7 +21,7 @@ sub create_links_and_install_scripts($) { foreach (@progs) { lstat "/$_" and return } # verify that it's not installed foreach (@progs) { - make_dirname("/$_"); + mkdir_(dirname("/$_")); symlink $script, "/$_"; # or die "$rpm: /$_"; } @@ -31,8 +31,16 @@ sub create_links_and_install_scripts($) { chmod 0755, "$script"; } -sub make_dirname($) { - my $file = $_[0]; - my $dir = `dirname $file`; - `mkdir -p $dir 2>/dev/null`; +sub dirname { local $_ = shift; s|[^/]*/*\s*$||; s|(.)/*$|$1|; $_ || '.' } + +sub mkdir_ { + -d $_[0] and return; + + my $root = dirname $_[0]; + if (-e $root) { + -d $root or die "mkdir: error creating directory $_[0]: $root is a file and i won't delete it\n"; + } else { + mkdir_($root); + } + mkdir $_[0], 0755 or die "mkdir: error creating directory $_: $!\n"; } |