From ecbe7300237b74abfbaa7c429b0e0b78468a89c6 Mon Sep 17 00:00:00 2001 From: Ville Skyttä Date: Jul 18 2017 08:44:52 +0000 Subject: spectool: Remove internal protocol retrievability check (#1472006) --- diff --git a/NEWS b/NEWS index 6b19756..3374d9b 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ rpmdevtools x.xx (201x-xx-xx) Ville Skyttä: - Python 3.6 invalid escape sequence deprecation fixes + - Remove internal protocol retrievability check in spectool (#1472006) rpmdevtools 8.10 (2017-01-14) diff --git a/spectool.in b/spectool.in index dc29afe..6f7499c 100644 --- a/spectool.in +++ b/spectool.in @@ -26,7 +26,7 @@ use File::Spec; use FileHandle; use Getopt::Long; -my $VERSION = '1.0.10rpmdev2'; +my $VERSION = '1.0.10rpmdev3'; my $CURLRC = '__SYSCONFDIR__/rpmdevtools/curlrc'; Getopt::Long::Configure ('no_ignore_case'); @@ -43,9 +43,6 @@ foreach (@rpm_sections) { $rpm_sections{$_} = 1; } -my @protocols = qw/ftp http https/; -my $protocols_re = '(?:' . join ('|', @protocols) . ')'; - my @defines; my %sources; my %patches; @@ -194,8 +191,8 @@ sub list_sources_patches { } sub retrievable { - my $url = $_[0]; - return eval "\$url =~ m,^$protocols_re://,i;"; + # https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml + return $_[0] =~ m,^[\w.+-]+://.+,; } sub retrieve {