summaryrefslogtreecommitdiffabout
path: root/lib/SlackBuild/Request/Loader/url.pm
Side-by-side diff
Diffstat (limited to 'lib/SlackBuild/Request/Loader/url.pm') (more/less context) (ignore whitespace changes)
-rw-r--r--lib/SlackBuild/Request/Loader/url.pm22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/SlackBuild/Request/Loader/url.pm b/lib/SlackBuild/Request/Loader/url.pm
new file mode 100644
index 0000000..f8ff68f
--- a/dev/null
+++ b/lib/SlackBuild/Request/Loader/url.pm
@@ -0,0 +1,22 @@
+package SlackBuild::Request::Loader::url;
+use strict;
+use warnings;
+use URI;
+
+our $PRIORITY = 30;
+
+sub Load {
+ my ($class, $reqname) = @_;
+ if ($reqname =~ m{^\w+://}) {
+ my $uri = new URI($reqname);
+ if ($uri->scheme =~ m{^(?:http|ftp)s?}
+ && $uri->path =~ m{.*/(.+?)\.tar(?:\.(?:[xgl]z|bz2))?}x) {
+ return { package => $1, slackbuild_uri => $reqname };
+ }
+ if ($uri->scheme eq 'sbo') {
+ return { package => $uri->package, slackbuild_uri => $reqname }
+ }
+ }
+}
+
+1;

Return to:

Send suggestions and report system problems to the System administrator.