summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-07-26 13:07:11 +0000
committerFrancois Pons <fpons@mandriva.com>2002-07-26 13:07:11 +0000
commit0c6123d4586b0d7ddc997b5eefc3f37d22c06e65 (patch)
tree83242517fb6a00be16b49d0f004bdaf694679b6f /urpm.pm
parent6f00b07f7a98c21f2841ca891e5d4af87b142f19 (diff)
downloadurpmi-0c6123d4586b0d7ddc997b5eefc3f37d22c06e65.tar
urpmi-0c6123d4586b0d7ddc997b5eefc3f37d22c06e65.tar.gz
urpmi-0c6123d4586b0d7ddc997b5eefc3f37d22c06e65.tar.bz2
urpmi-0c6123d4586b0d7ddc997b5eefc3f37d22c06e65.tar.xz
urpmi-0c6123d4586b0d7ddc997b5eefc3f37d22c06e65.zip
3.9-5mdk
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm24
1 files changed, 22 insertions, 2 deletions
diff --git a/urpm.pm b/urpm.pm
index 9180712b..6928a35b 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -542,7 +542,7 @@ sub configure {
}
foreach (grep { !$_->{ignore} && (!$options{update} || $_->{update}) } @{$urpm->{media} || []}) {
delete @{$_}{qw(start end)};
- if ($options{callback_pkg}) {
+ if ($options{callback}) {
if (-s "$urpm->{statedir}/$_->{hdlist}" > 32) {
$urpm->{log}(_("examining hdlist file [%s]", "$urpm->{statedir}/$_->{hdlist}"));
eval { ($_->{start}, $_->{end}) = $urpm->parse_hdlist("$urpm->{statedir}/$_->{hdlist}", 0) };
@@ -1271,6 +1271,24 @@ sub clean {
}
}
+#- check if supermount is used.
+sub is_using_supermount {
+ my ($urpm, $device_mntpoint) = @_;
+ local (*F, $_);
+
+ #- read /etc/fstab and check for existing mount point.
+ open F, "/etc/fstab";
+ while (<F>) {
+ my ($device, $mntpoint, $fstype, $options) = /^\s*(\S+)\s+(\/\S+)\s+(\S+)\s+(\S+)/ or next;
+ $mntpoint =~ s,/+,/,g; $mntpoint =~ s,/$,,;
+ if ($fstype eq 'supermount') {
+ $device_mntpoint eq $mntpoint and return 1;
+ $options =~ /^(?:.*[\s,])?dev=([^\s,]+)/ && $device_mntpoint eq $1 and return 1;
+ }
+ }
+ return 0;
+}
+
#- find used mount point from a pathname, use a optional mode to allow
#- filtering according the next operation (mount or umount).
sub find_mntpoints {
@@ -1745,7 +1763,9 @@ sub download_source_packages {
}
#- mount the removable device, only one or the important one.
- $examine_removable_medium->($removables{$device}[0], $device);
+ #- if supermount is used on the device, it is preferable to copy
+ #- the file instead (because it is so slooooow).
+ $examine_removable_medium->($removables{$device}[0], $device, $urpm->is_using_supermount($device) && 'copy');
}
#- get back all ftp and http accessible rpms file into the local cache