summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-14 08:24:19 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-14 08:24:19 +0000
commitb1c1355515da02f4b0620080dd6f82f43ca35a75 (patch)
tree886b1549421a9424081084296604aaa24bcc938b
parent2dc6dc0a9e5fe95fa9139f734a0350e2f36508a6 (diff)
downloadurpmi-b1c1355515da02f4b0620080dd6f82f43ca35a75.tar
urpmi-b1c1355515da02f4b0620080dd6f82f43ca35a75.tar.gz
urpmi-b1c1355515da02f4b0620080dd6f82f43ca35a75.tar.bz2
urpmi-b1c1355515da02f4b0620080dd6f82f43ca35a75.tar.xz
urpmi-b1c1355515da02f4b0620080dd6f82f43ca35a75.zip
- urpmi:
o never suggest --install-src for spec file (#38876) o do not allow "urpmi --install-src foo.spec"
-rw-r--r--NEWS4
-rwxr-xr-xurpmi12
2 files changed, 15 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 2cb33b24..6ecac5c1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+- urpmi:
+ o never suggest --install-src for spec file (#38876)
+ o do not allow "urpmi --install-src foo.spec"
+
Version 5.12 - 11 March 2008, by Thierry Vignaud
- gurpmi:
diff --git a/urpmi b/urpmi
index 5be0e9ef..9768304c 100755
--- a/urpmi
+++ b/urpmi
@@ -192,11 +192,14 @@ along with --bug.\n");
usage();
}
+my @spec_files;
# Process the rest of the arguments
foreach (@ARGV) {
if (/\.(?:rpm|spec)$/) {
- if (/\.(?:src\.rpm|spec)$/) {
+ if (/\.src\.rpm$/) {
push @src_files, $_;
+ } elsif (/\.spec$/) {
+ push @spec_files, $_;
} else {
push @files, untaint($_);
}
@@ -213,10 +216,17 @@ if ($options{buildrequires}) {
#- use install_src to promote all names as src package.
if ($install_src) {
@files and $urpm->{fatal}(1, N("You can't install binary rpm files when using --install-src"));
+ @spec_files and $urpm->{fatal}(1, N("You can't install spec files"));
push @src_names, @names;
@names = ();
#- allow to use --install-src as a non-root user
$options{nolock} = 1;
+} elsif (@spec_files) {
+ if (!$options{buildrequires}) {
+ $urpm->{error}(N("defaulting to --buildrequires"));
+ $options{buildrequires} = 1;
+ }
+ push @src_files, @spec_files;
} elsif (@src_files && !$options{buildrequires}) {
$urpm->{error}(N("please use --buildrequires or --install-src, defaulting to --buildrequires"));
$options{buildrequires} = 1;