#50 spectool: ignore query string in URL. BZ 1337544
Merged 3 years ago by ngompa. Opened 3 years ago by mdomonko.
mdomonko/rpmdevtools bz1337544  into  master

file modified
+1 -1
@@ -198,7 +198,7 @@ 

  sub retrieve {

  	my ($where, $url) = @_;

  	if (retrievable ($url)) {

- 		my $path = File::Spec->catfile($where, $url =~ m|([^/]+)$|);

+ 		my $path = File::Spec->catfile($where, $url =~ m|([^\/]+?)(?:\?.*)?$|);

  		print "Getting $url to $path\n";

  		if (-e $path) {

  			if ($force) {

When constructing the target filename from the given Source or Patch URL
(sub retrieve), do not include the query string (if present).


Regex explanation:

  • 1st group: ([^\/]+?)
    • Lazily matches one or more characters that are not a forward slash
  • 2nd group: (?:\?.*)?$
    • Matches a query string (if any) starting with a question mark,
      followed by zero or more characters until the end of string,
      without creating a capturing group (the leading ?:)

rebased onto 26a8abc

3 years ago

Pull-Request has been merged by ngompa

3 years ago