summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;