| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #! @PERL@ | | 1 | #! @PERL@ |
2 | # $NetBSD: url2pkg.pl,v 1.28 2015/04/07 00:10:33 rodent Exp $ | | 2 | # $NetBSD: url2pkg.pl,v 1.29 2015/06/17 11:59:58 wiz Exp $ |
3 | # | | 3 | # |
4 | | | 4 | |
5 | # Copyright (c) 2010 The NetBSD Foundation, Inc. | | 5 | # Copyright (c) 2010 The NetBSD Foundation, Inc. |
6 | # All rights reserved. | | 6 | # All rights reserved. |
7 | # | | 7 | # |
8 | # This code is derived from software contributed to The NetBSD Foundation | | 8 | # This code is derived from software contributed to The NetBSD Foundation |
9 | # by Roland Illig. | | 9 | # by Roland Illig. |
10 | # | | 10 | # |
11 | # Redistribution and use in source and binary forms, with or without | | 11 | # Redistribution and use in source and binary forms, with or without |
12 | # modification, are permitted provided that the following conditions | | 12 | # modification, are permitted provided that the following conditions |
13 | # are met: | | 13 | # are met: |
14 | # 1. Redistributions of source code must retain the above copyright | | 14 | # 1. Redistributions of source code must retain the above copyright |
15 | # notice, this list of conditions and the following disclaimer. | | 15 | # notice, this list of conditions and the following disclaimer. |
| @@ -323,26 +323,28 @@ sub generate_initial_package($) { | | | @@ -323,26 +323,28 @@ sub generate_initial_package($) { |
323 | $gh_project = $2; | | 323 | $gh_project = $2; |
324 | $dist_subdir = '${GITHUB_PROJECT}'; | | 324 | $dist_subdir = '${GITHUB_PROJECT}'; |
325 | } | | 325 | } |
326 | if ($3 eq $4) { | | 326 | if ($3 eq $4) { |
327 | $gh_release = '${DISTNAME}'; | | 327 | $gh_release = '${DISTNAME}'; |
328 | } else { | | 328 | } else { |
329 | $gh_release = $3; | | 329 | $gh_release = $3; |
330 | } | | 330 | } |
331 | $distfile = "$4$5"; | | 331 | $distfile = "$4$5"; |
332 | $found = true; | | 332 | $found = true; |
333 | } else { | | 333 | } else { |
334 | die("$0: ERROR: Invalid GitHub URL: ${url}\n"); | | 334 | die("$0: ERROR: Invalid GitHub URL: ${url}\n"); |
335 | } | | 335 | } |
| | | 336 | } else { |
| | | 337 | $gh_project = ""; $gh_release = ""; $dist_subdir = ""; |
336 | } | | 338 | } |
337 | } | | 339 | } |
338 | | | 340 | |
339 | if (!$found) { | | 341 | if (!$found) { |
340 | if ($url =~ qr"^(.*/)(.*)$") { | | 342 | if ($url =~ qr"^(.*/)(.*)$") { |
341 | ($master_sites, $distfile) = ($1, $2); | | 343 | ($master_sites, $distfile) = ($1, $2); |
342 | $homepage = $master_sites; | | 344 | $homepage = $master_sites; |
343 | } else { | | 345 | } else { |
344 | die("$0: ERROR: Invalid URL: ${url}\n"); | | 346 | die("$0: ERROR: Invalid URL: ${url}\n"); |
345 | } | | 347 | } |
346 | } | | 348 | } |
347 | | | 349 | |
348 | if ($distfile =~ qr"^(.*)(\.tgz|\.tar\.Z|\.tar\.gz|\.tar\.bz2|\.tar\.xz|\.tar\.7z)$") { | | 350 | if ($distfile =~ qr"^(.*)(\.tgz|\.tar\.Z|\.tar\.gz|\.tar\.bz2|\.tar\.xz|\.tar\.7z)$") { |