summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index fce2bf5e..2d2ee2e1 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -741,6 +741,21 @@ sub sync {
};
}
+sub get_content {
+ my ($urpm, $url) = @_;
+
+ my $file = "$urpm->{cachedir}/partial/" . basename($url);
+
+ unlink $file; # prevent "partial file" errors
+ urpm::download::sync($urpm, undef, [ $url ]) or return;
+
+ my @l = cat_($file);
+ unlink $file;
+
+ wantarray ? @l : join('', @l);
+}
+
+
#- syncing algorithms.
sub _sync_webfetch_raw {
my ($urpm, $files, $options) = @_;