summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20121029/b874af54/attachment-0002.obj
blob: 5dc1fef0742dd8e3313b6f4cbb125146b610a29f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
commit 54a0e7a4e69284026224eb7602ffc134b2bed169
Author: tv <thierry.vignaud@gmail.com>
Date:   Mon Oct 29 15:55:57 2012 +0100

    add --download-dir option

diff --git a/NEWS b/NEWS
index cd3abbe..ce32b83 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+- urpmi.cfg:
+  o add download-dir option 
+- urpmi:
+  o add --download-dir option 
+
 Version 7.10 - 17 October 2012, by Thierry Vignaud
 
 - do not offer to remove DKMS modules for current kernel (mga#5092)
diff --git a/pod/5/urpmi.cfg.pod b/pod/5/urpmi.cfg.pod
index baf35fb..515d462 100644
--- a/pod/5/urpmi.cfg.pod
+++ b/pod/5/urpmi.cfg.pod
@@ -94,6 +94,13 @@ installing into the specified directory.  If you want to use the default
 location, assign an empty string to it (WARNING! "yes" or "1" are NOT the
 options you really want to use here!)
 
+=item B<download-dir> 
+
+Same as B<--download-dir> option for urpmi: specify to download remote packages
+before installing them into the specified directory.  If you want to use the default
+location, assign an empty string to it (WARNING! "yes" or "1" are NOT the
+options you really want to use here!)
+
 =item B<downloader>
 
 Specify which download program to use: B<wget> or B<curl>.
diff --git a/pod/8/urpmi.pod b/pod/8/urpmi.pod
index c9fd27a..4b2e39e 100644
--- a/pod/8/urpmi.pod
+++ b/pod/8/urpmi.pod
@@ -265,6 +265,13 @@ option is set, urpmi will first download all the needed packages and proceed
 to install them if it managed to download them all. You can optionally 
 specify a directory where the files should be downloaded (default is /var/cache/urpmi which could be too small to hold all the files).
 
+=item B<--download-dir> I<dest-dir>
+
+By default, urpmi will download packages in a system directory (default is
+/var/cache/urpmi). This can be problematic when someone just want to download
+packages as user witout installing them. When this option is set, urpmi
+download the needed packages in the specified directory.
+
 =item B<--downloader> I<program name>
 
 Use a specific program for downloading distant files via http or ftp. 
diff --git a/urpm/args.pm b/urpm/args.pm
index 4120155..01e99f4 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -128,6 +128,7 @@ my %options_spec = (
 
 	'metalink!' => sub { $urpm->{options}{metalink} = $_[1] },
 	'download-all:s' => sub { $urpm->{options}{'download-all'} = $_[1] },
+	'download-dir=s' => sub { $urpm->{options}{cachedir} = $_[1] },
 	# deprecated in favor of --downloader xxx
 	wget => sub { $urpm->{options}{downloader} = 'wget' },
 	curl => sub { $urpm->{options}{downloader} = 'curl' },
diff --git a/urpm/cfg.pm b/urpm/cfg.pm
index 75487c9..df00dc3 100644
--- a/urpm/cfg.pm
+++ b/urpm/cfg.pm
@@ -160,6 +160,7 @@ sub load_config_raw {
 	  |retry
 	  |default-media
 	  |download-all
+	  |download-dir
 	  |tune-rpm
 	  |(?:curl|rsync|wget|prozilla|aria2)-options
 	  )\s*:\s*['"]?(.*?)['"]?$/x) {
diff --git a/urpmi b/urpmi
index cf6f8c0..f515f94 100755
--- a/urpmi
+++ b/urpmi
@@ -108,6 +108,7 @@ sub usage () {
                    to install a chroot with --root option.
 ") . N("  --metalink     - generate and use a local metalink.
 ") . N("  --download-all - download all needed packages before trying to install them
+") . N("  --download-dir - download the needed packages in the specified directory
 ") . N("  --downloader   - program to use to retrieve distant files. 
                    known programs: %s
 ", join(', ', urpm::download::ftp_http_downloaders()))