| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #!/usr/bin/env perl | | 1 | #!/usr/bin/env perl |
2 | # | | 2 | # |
3 | # $NetBSD: port2pkg.pl,v 1.21 2013/11/19 10:46:06 tron Exp $ | | 3 | # $NetBSD: port2pkg.pl,v 1.22 2014/02/17 10:32:02 wiz Exp $ |
4 | # | | 4 | # |
5 | | | 5 | |
6 | use Getopt::Std; | | 6 | use Getopt::Std; |
7 | | | 7 | |
8 | $^W=1; | | 8 | $^W=1; |
9 | use strict; | | 9 | use strict; |
10 | use vars qw($opt_m); | | 10 | use vars qw($opt_m); |
11 | my($maintainer) = "pkgsrc-users\@NetBSD.org"; | | 11 | my($maintainer) = "pkgsrc-users\@NetBSD.org"; |
12 | my($makefile, $master_site_subdir, $extract_cmd); | | 12 | my($makefile, $master_site_subdir, $extract_cmd); |
13 | my($portsdir, $pkgdir); | | 13 | my($portsdir, $pkgdir); |
14 | my($namespace, $portname, $portversion, $distname, | | 14 | my($namespace, $portname, $portversion, $distname, |
15 | $pkgname, $pkgnameprefix, $pkgnamesuffix); | | 15 | $pkgname, $pkgnameprefix, $pkgnamesuffix); |
16 | my(@man, @cat); | | 16 | my(@man, @cat); |
| @@ -147,31 +147,27 @@ sub read_Makefile { | | | @@ -147,31 +147,27 @@ sub read_Makefile { |
147 | | | 147 | |
148 | sub conv_Makefile { | | 148 | sub conv_Makefile { |
149 | open(PORTS, "$portsdir/Makefile") | | 149 | open(PORTS, "$portsdir/Makefile") |
150 | || die "$portsdir/Makefile: $!\n"; | | 150 | || die "$portsdir/Makefile: $!\n"; |
151 | open(PKG, ">$pkgdir/Makefile") | | 151 | open(PKG, ">$pkgdir/Makefile") |
152 | || die "$pkgdir/Makefile: $!\n"; | | 152 | || die "$pkgdir/Makefile: $!\n"; |
153 | | | 153 | |
154 | print PKG "# \$Net" . "BSD\$\n"; | | 154 | print PKG "# \$Net" . "BSD\$\n"; |
155 | | | 155 | |
156 | # header | | 156 | # header |
157 | while (<PORTS>) { | | 157 | while (<PORTS>) { |
158 | last if (! /^\#/); | | 158 | last if (! /^\#/); |
159 | | | 159 | |
160 | if (/\$FreeBSD(: .*) \$/ || /\$Id(: .*) \$/) { | | 160 | print; |
161 | print PKG "\# FreeBSD Id$1\n"; | | | |
162 | } else { | | | |
163 | print; | | | |
164 | } | | | |
165 | } | | 161 | } |
166 | print PKG; | | 162 | print PKG; |
167 | | | 163 | |
168 | # body | | 164 | # body |
169 | my ($nextline, $remove, $master_sites, $noportdocs); | | 165 | my ($nextline, $remove, $master_sites, $noportdocs); |
170 | while (<PORTS>) { | | 166 | while (<PORTS>) { |
171 | if (/\\$/) { | | 167 | if (/\\$/) { |
172 | $nextline++; | | 168 | $nextline++; |
173 | next if ($remove); | | 169 | next if ($remove); |
174 | } else { | | 170 | } else { |
175 | $nextline = 0; | | 171 | $nextline = 0; |
176 | if ($remove) { | | 172 | if ($remove) { |
177 | $remove = 0; | | 173 | $remove = 0; |