pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg/files pkgtools/url2pkg: fix indentation



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3aa8940c720b
branches:  trunk
changeset: 338011:3aa8940c720b
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Aug 17 13:21:42 2019 +0000

description:
pkgtools/url2pkg: fix indentation

diffstat:

 pkgtools/url2pkg/files/url2pkg.pl |  70 ++++++++++++++++++--------------------
 1 files changed, 33 insertions(+), 37 deletions(-)

diffs (93 lines):

diff -r 1a3783985189 -r 3aa8940c720b pkgtools/url2pkg/files/url2pkg.pl
--- a/pkgtools/url2pkg/files/url2pkg.pl Sat Aug 17 13:12:00 2019 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.pl Sat Aug 17 13:21:42 2019 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: url2pkg.pl,v 1.41 2019/08/17 13:12:00 rillig Exp $
+# $NetBSD: url2pkg.pl,v 1.42 2019/08/17 13:21:42 rillig Exp $
 #
 
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -300,50 +300,46 @@
        }
        close(SITES) or die;
 
-       if (true) {
-               if ($url =~ qr"^http://(?:pr)?downloads\.sourceforge\.net/([^/]*)/([^/?]+)(?:\?(?:download|use_mirror=.*))?$") {
-                       my $pkgbase = $1;
-                       $distfile = $2;
+       if ($url =~ qr"^http://(?:pr)?downloads\.sourceforge\.net/([^/]*)/([^/?]+)(?:\?(?:download|use_mirror=.*))?$") {
+               my $pkgbase = $1;
+               $distfile = $2;
 
-                       $master_sites = "\${MASTER_SITE_SOURCEFORGE:=${pkgbase}/}";
-                       $homepage = "http://${pkgbase}.sourceforge.net/";;
-                       $found = true;
-               }
+               $master_sites = "\${MASTER_SITE_SOURCEFORGE:=${pkgbase}/}";
+               $homepage = "http://${pkgbase}.sourceforge.net/";;
+               $found = true;
        }
 
-       if (true) {
-               if ($url =~ qr"^https?://github\.com/") {
-                       if ($url =~ qr"^https?://github\.com/(.*)/(.*)/archive/(.*)(\.tar\.gz|\.zip)$") {
-                               $master_sites = "\${MASTER_SITE_GITHUB:=$1/}";
-                               $homepage = "https://github.com/$1/$2/";;
+       if ($url =~ qr"^https?://github\.com/") {
+               if ($url =~ qr"^https?://github\.com/(.*)/(.*)/archive/(.*)(\.tar\.gz|\.zip)$") {
+                       $master_sites = "\${MASTER_SITE_GITHUB:=$1/}";
+                       $homepage = "https://github.com/$1/$2/";;
+                       $gh_project = $2;
+                       $gh_tag = $3;
+                       if (index($gh_tag, $gh_project) == -1 ) {
+                               $pkgname = '${GITHUB_PROJECT}-${DISTNAME}';
+                               $dist_subdir = '${GITHUB_PROJECT}';
+                       }
+                       $distfile = "$3$4";
+                       $found = true;
+               } elsif ($url =~ qr"^https?://github\.com/(.*)/(.*)/releases/download/(.*)/(.*)(\.tar\.gz|\.zip)$") {
+                       $master_sites = "\${MASTER_SITE_GITHUB:=$1/}";
+                       $homepage = "https://github.com/$1/$2/";;
+                       if (index($4, $2) == -1) {
                                $gh_project = $2;
-                               $gh_tag = $3;
-                               if (index($gh_tag, $gh_project) == -1 ) {
-                                       $pkgname = '${GITHUB_PROJECT}-${DISTNAME}';
-                                       $dist_subdir = '${GITHUB_PROJECT}';
-                               }
-                               $distfile = "$3$4";
-                               $found = true;
-                       } elsif ($url =~ qr"^https?://github\.com/(.*)/(.*)/releases/download/(.*)/(.*)(\.tar\.gz|\.zip)$") {
-                               $master_sites = "\${MASTER_SITE_GITHUB:=$1/}";
-                               $homepage = "https://github.com/$1/$2/";;
-                               if (index($4, $2) == -1) {
-                                       $gh_project = $2;
-                                       $dist_subdir = '${GITHUB_PROJECT}';
-                               }
-                               if ($3 eq $4) {
-                                       $gh_release = '${DISTNAME}';
-                               } else {
-                                       $gh_release = $3;
-                               }
-                               $distfile = "$4$5";
-                               $found = true;
+                               $dist_subdir = '${GITHUB_PROJECT}';
+                       }
+                       if ($3 eq $4) {
+                               $gh_release = '${DISTNAME}';
                        } else {
-                               print("$0: ERROR: Invalid GitHub URL: ${url}, handling as normal URL\n");
+                               $gh_release = $3;
                        }
+                       $distfile = "$4$5";
+                       $found = true;
                } else {
-                       $gh_project = ""; $gh_release = ""; $dist_subdir = "";
+                       print("$0: ERROR: Invalid GitHub URL: ${url}, handling as normal URL\n");
                }
+       } else {
+               $gh_project = ""; $gh_release = ""; $dist_subdir = "";
        }
 
        if (!$found) {



Home | Main Index | Thread Index | Old Index