summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-01-04 00:02:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-01-04 00:02:06 +0000
commitf041fbb500d8d8e272e72a87feccb8d8843f1204 (patch)
treecdbf97b370fbdcfe58f300cc79e55b84100289f7 /urpmi.addmedia
parent02378b711e6754e6946fd9cf1e1706aaeb20e749 (diff)
downloadurpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar
urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar.gz
urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar.bz2
urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.tar.xz
urpmi-f041fbb500d8d8e272e72a87feccb8d8843f1204.zip
no_comment
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia13
1 files changed, 8 insertions, 5 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index b1bc5f5c..72ef3cd8 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -96,13 +96,16 @@ umask $mask;
if (my ($prefix, $dir) = $url =~ m,^(removable_.*?|file):/(.*),) {
my $hdlist = '';
my $flush = sub {};
- if (-e (my $f = "$dir/Mandrake/base/hdlist")) {
- system("gzip -f $f > $HDLIST.gz");
+ if (-e (my $f = "$dir/Mandrake/base/hdlist.gz")) {
+ system("cp -f $f $HDLIST.gz");
+ } elsif (-e (my $f = "$dir/Mandrake/base/hdlist")) {
+ system("gzip -cf $f > $HDLIST.gz");
} else {
$flush = sub { system("rpm2header $hdlist | gzip >> $HDLIST.gz") if $hdlist };
}
print "scanning $dir...";
- open F, "find $dir -follow -name '*.rpm'|";
+ my $realdir = readlink($dir) || $dir;
+ open F, "find '$realdir' -name '*.rpm'|";
foreach (<F>) {
chomp;
if (length "$hdlist $_" > 1500) {
@@ -119,12 +122,12 @@ if (my ($prefix, $dir) = $url =~ m,^(removable_.*?|file):/(.*),) {
} else {
system("wget -O $HDLIST $url/$ftp_hdlist");
$? == 0 or die "wget of $url/$ftp_hdlist failed (maybe wget is missing?)";
- open F, "hdlist2files $HDLIST|";
+ open F, "hdlist2names $HDLIST|";
foreach (<F>) {
chomp;
print LIST "$url/$_\n";
}
- close F or die "hdlist2files failed";
+ close F or die "hdlist2names failed";
}
close LIST;