pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/url2pkg Updated url2pkg to 2.3.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/48599cd8eb33
branches:  trunk
changeset: 523735:48599cd8eb33
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Jan 12 21:35:52 2007 +0000

description:
Updated url2pkg to 2.3.

Changes since 2.2:
- Detect more sourceforge download URLs.
- wrksrc_files and wrksrc_dirs are looked for in WRKSRC, not in WRKDIR.
- When the URL is being read in and an EOF occurs, the program exits.

diffstat:

 pkgtools/url2pkg/Makefile         |   4 ++--
 pkgtools/url2pkg/files/url2pkg.pl |  16 +++++++++++-----
 2 files changed, 13 insertions(+), 7 deletions(-)

diffs (58 lines):

diff -r 4ba47d418839 -r 48599cd8eb33 pkgtools/url2pkg/Makefile
--- a/pkgtools/url2pkg/Makefile Fri Jan 12 21:32:58 2007 +0000
+++ b/pkgtools/url2pkg/Makefile Fri Jan 12 21:35:52 2007 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.46 2006/12/06 01:00:41 rillig Exp $
+# $NetBSD: Makefile,v 1.47 2007/01/12 21:35:52 rillig Exp $
 #
 
-DISTNAME=      url2pkg-2.2
+DISTNAME=      url2pkg-2.3
 CATEGORIES=    pkgtools
 MASTER_SITES=  # none
 DISTFILES=     # none
diff -r 4ba47d418839 -r 48599cd8eb33 pkgtools/url2pkg/files/url2pkg.pl
--- a/pkgtools/url2pkg/files/url2pkg.pl Fri Jan 12 21:32:58 2007 +0000
+++ b/pkgtools/url2pkg/files/url2pkg.pl Fri Jan 12 21:35:52 2007 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: url2pkg.pl,v 1.3 2006/12/06 01:00:41 rillig Exp $
+# $NetBSD: url2pkg.pl,v 1.4 2007/01/12 21:35:52 rillig Exp $
 #
 
 use strict;
@@ -238,7 +238,7 @@
        }
 
        if (!$found) {
-               if ($url =~ qr"^http://prdownloads\.sourceforge\.net/([^/]*)/([^/]+)\?download$") {
+               if ($url =~ qr"^http://(?:pr)?downloads\.sourceforge\.net/([^/]*)/([^/]+)\?(?:download|use_mirror=.*)$") {
                        my $pkgbase = $1;
                        $distfile = $2;
 
@@ -337,8 +337,8 @@
                $abs_wrksrc = $abs_wrkdir;
        }
 
-       chomp(@wrksrc_files = `cd "${abs_wrkdir}" && find * -type f`);
-       chomp(@wrksrc_dirs = `cd "${abs_wrkdir}" && find * -type d`);
+       chomp(@wrksrc_files = `cd "${abs_wrksrc}" && find * -type f`);
+       chomp(@wrksrc_dirs = `cd "${abs_wrksrc}" && find * -type d`);
 
        magic_configure();
        magic_gconf2_schemas();
@@ -417,7 +417,13 @@
        if (scalar(@extract_cookie) == 0) {
                if (scalar(@ARGV) == 0) {
                        print("URL: ");
-                       $url = <STDIN>;
+                       # Pressing Ctrl-D is considered equivalent to
+                       # aborting the process.
+                       if (!defined($url = <STDIN>)) {
+                               print("\n");
+                               print("No URL given -- aborting.\n");
+                               exit(0);
+                       }
                } else {
                        $url = shift(@ARGV);
                }



Home | Main Index | Thread Index | Old Index