| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | #! @PERL5@ | | 1 | #! @PERL5@ |
2 | # $NetBSD: url2pkg.pl,v 1.69 2019/09/12 05:56:59 rillig Exp $ | | 2 | # $NetBSD: url2pkg.pl,v 1.70 2019/09/12 18:23:00 rillig 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. |
| @@ -124,30 +124,30 @@ sub lines_add_vars($$) { | | | @@ -124,30 +124,30 @@ sub lines_add_vars($$) { |
124 | next if $value eq ""; | | 124 | next if $value eq ""; |
125 | my $tabs = "\t" x (($width - length("$name$op") + 7) / 8); | | 125 | my $tabs = "\t" x (($width - length("$name$op") + 7) / 8); |
126 | push(@$lines, "$name$op$tabs$value"); | | 126 | push(@$lines, "$name$op$tabs$value"); |
127 | } | | 127 | } |
128 | push(@$lines, ""); | | 128 | push(@$lines, ""); |
129 | } | | 129 | } |
130 | | | 130 | |
131 | # changes the value of an existing variable in the lines. | | 131 | # changes the value of an existing variable in the lines. |
132 | sub lines_set($$$) { | | 132 | sub lines_set($$$) { |
133 | my ($lines, $varname, $new_value) = @_; | | 133 | my ($lines, $varname, $new_value) = @_; |
134 | | | 134 | |
135 | my $i = 0; | | 135 | my $i = 0; |
136 | foreach my $line (@$lines) { | | 136 | foreach my $line (@$lines) { |
137 | if ($line =~ qr"^\Q$varname\E(\+?=)([ \t]+)([^#\\]*?)(\s*)(#.*|)$") { | | 137 | if ($line =~ qr"^#?\Q$varname\E(\+?=)([ \t]+)([^#\\]*?)(\s*)(#.*|)$") { |
138 | my ($op, $indent, $old_value, $space_after_value, $comment) = ($1, $2, $3, $4, $5); | | 138 | my ($op, $indent, $old_value, $space_after_value, $comment) = ($1, $2, $3, $4, $5); |
139 | | | 139 | |
140 | $lines->[$i] = "$varname$op$indent$new_value$space_after_value$comment"; | | 140 | $lines->[$i] = "$varname$op$indent$new_value"; |
141 | return true; | | 141 | return true; |
142 | } | | 142 | } |
143 | $i++; | | 143 | $i++; |
144 | } | | 144 | } |
145 | | | 145 | |
146 | return false; | | 146 | return false; |
147 | } | | 147 | } |
148 | | | 148 | |
149 | # appends to the value of an existing variable in the lines. | | 149 | # appends to the value of an existing variable in the lines. |
150 | sub lines_append($$$) { | | 150 | sub lines_append($$$) { |
151 | my ($lines, $varname, $value) = @_; | | 151 | my ($lines, $varname, $value) = @_; |
152 | | | 152 | |
153 | return if $value eq ""; | | 153 | return if $value eq ""; |
| @@ -198,27 +198,27 @@ sub lines_remove_if($$$) { | | | @@ -198,27 +198,27 @@ sub lines_remove_if($$$) { |
198 | splice(@$lines, $i, 1); | | 198 | splice(@$lines, $i, 1); |
199 | return true; | | 199 | return true; |
200 | } | | 200 | } |
201 | } | | 201 | } |
202 | $i++; | | 202 | $i++; |
203 | } | | 203 | } |
204 | | | 204 | |
205 | return false; | | 205 | return false; |
206 | } | | 206 | } |
207 | | | 207 | |
208 | sub lines_index($$) { | | 208 | sub lines_index($$) { |
209 | my ($lines, $re) = @_; | | 209 | my ($lines, $re) = @_; |
210 | | | 210 | |
211 | foreach my $i (0..$#$lines) { | | 211 | foreach my $i (0 .. $#$lines) { |
212 | return $i if $lines->[$i] =~ $re; | | 212 | return $i if $lines->[$i] =~ $re; |
213 | } | | 213 | } |
214 | return -1; | | 214 | return -1; |
215 | } | | 215 | } |
216 | | | 216 | |
217 | sub make(@) { | | 217 | sub make(@) { |
218 | my @args = @_; | | 218 | my @args = @_; |
219 | | | 219 | |
220 | (system { $make } ($make, @args)) == 0 or die; | | 220 | (system { $make } ($make, @args)) == 0 or die; |
221 | } | | 221 | } |
222 | | | 222 | |
223 | # The following adjust_* subroutines are called after the distfiles have | | 223 | # The following adjust_* subroutines are called after the distfiles have |
224 | # been downloaded and extracted. They inspect the extracted files | | 224 | # been downloaded and extracted. They inspect the extracted files |
| @@ -265,31 +265,34 @@ our @bl3_lines; | | | @@ -265,31 +265,34 @@ our @bl3_lines; |
265 | # a list of pathnames relative to the package path. | | 265 | # a list of pathnames relative to the package path. |
266 | # All these files will be included at the bottom of the Makefile. | | 266 | # All these files will be included at the bottom of the Makefile. |
267 | our @includes; | | 267 | our @includes; |
268 | | | 268 | |
269 | # a list of variable assignments that will make up the fourth | | 269 | # a list of variable assignments that will make up the fourth |
270 | # paragraph of the package Makefile, where the build configuration | | 270 | # paragraph of the package Makefile, where the build configuration |
271 | # takes place. | | 271 | # takes place. |
272 | our @build_vars; | | 272 | our @build_vars; |
273 | | | 273 | |
274 | # similar to the @build_vars, but separated by an empty line in | | 274 | # similar to the @build_vars, but separated by an empty line in |
275 | # the Makefile, thereby forming the fifth paragraph. | | 275 | # the Makefile, thereby forming the fifth paragraph. |
276 | our @extra_vars; | | 276 | our @extra_vars; |
277 | | | 277 | |
| | | 278 | # variables from the initial Makefile whose values are replaced |
| | | 279 | our %update_vars; |
| | | 280 | |
278 | # these are inserted below the second paragraph in the Makefile. | | 281 | # these are inserted below the second paragraph in the Makefile. |
279 | our @todos; | | 282 | our @todos; |
280 | | | 283 | |
281 | # the package name is $pkgname_prefix${DISTNAME$pkgname_transform}. | | 284 | # the package name is $pkgname_prefix${DISTNAME$pkgname_transform}. |
282 | our $pkgname_prefix = ""; # example: ${PYPKGPREFIX}- | | 285 | our $pkgname_prefix = ""; # example: ${PYPKGPREFIX}- |
283 | our $pkgname_transform = ""; # example: :S,-v,-, | | 286 | our $pkgname_transform = ""; # example: :S,-v,-, |
284 | | | 287 | |
285 | our $regenerate_distinfo = false; | | 288 | our $regenerate_distinfo = false; |
286 | | | 289 | |
287 | # Example: | | 290 | # Example: |
288 | # add_dependency("DEPENDS", "package", ">=1", "../../category/package"); | | 291 | # add_dependency("DEPENDS", "package", ">=1", "../../category/package"); |
289 | # | | 292 | # |
290 | sub add_dependency($$$$) { | | 293 | sub add_dependency($$$$) { |
291 | my ($type, $pkgbase, $constraint, $dep_dir) = @_; | | 294 | my ($type, $pkgbase, $constraint, $dep_dir) = @_; |
292 | | | 295 | |
293 | if ($dep_dir ne "" && -f "$dep_dir/buildlink3.mk") { | | 296 | if ($dep_dir ne "" && -f "$dep_dir/buildlink3.mk") { |
294 | # TODO: add type to bl3_lines (BUILDLINK_DEPENDS) | | 297 | # TODO: add type to bl3_lines (BUILDLINK_DEPENDS) |
295 | # TODO: add constraint to bl3_lines (BUILDLINK_API_DEPENDS) | | 298 | # TODO: add constraint to bl3_lines (BUILDLINK_API_DEPENDS) |
| @@ -316,29 +319,35 @@ sub read_dependencies($$$) { | | | @@ -316,29 +319,35 @@ sub read_dependencies($$$) { |
316 | my ($cmd, $env, $pkgnameprefix) = @_; | | 319 | my ($cmd, $env, $pkgnameprefix) = @_; |
317 | my @dep_lines; | | 320 | my @dep_lines; |
318 | | | 321 | |
319 | my %prev_ENV = %ENV; | | 322 | my %prev_ENV = %ENV; |
320 | foreach my $name (keys %$env) { | | 323 | foreach my $name (keys %$env) { |
321 | $ENV{$name} = $env->{$name}; | | 324 | $ENV{$name} = $env->{$name}; |
322 | } | | 325 | } |
323 | open(DEPS, "$cmd |") or die; | | 326 | open(DEPS, "$cmd |") or die; |
324 | %ENV = %prev_ENV; | | 327 | %ENV = %prev_ENV; |
325 | | | 328 | |
326 | while (defined (my $line = <DEPS>)) { | | 329 | while (defined (my $line = <DEPS>)) { |
327 | chomp($line); | | 330 | chomp($line); |
328 | | | 331 | |
329 | next unless $line =~ qr"^(\w+)\t([^\s:>]+)(>[^\s:]+|)(?::(\.\./\.\./\S+))?$"; | | 332 | if ($line =~ qr"^(\w+)\t([^\s:>]+)(>[^\s:]+|)(?::(\.\./\.\./\S+))?$") { |
330 | push(@dep_lines, [$1, $2, $3 || ">=0", $4 || ""]); | | 333 | push(@dep_lines, [ $1, $2, $3 || ">=0", $4 || "" ]); |
| | | 334 | } elsif ($line =~ qr"^var\t(\S+)\t(.+)$") { |
| | | 335 | $main::update_vars{$1} = $2; |
| | | 336 | } else { |
| | | 337 | printf STDERR "url2pkg: unknown dependency line: %s\n", $line; |
| | | 338 | } |
331 | } | | 339 | } |
| | | 340 | |
332 | close(DEPS) or die; | | 341 | close(DEPS) or die; |
333 | | | 342 | |
334 | foreach my $dep_line (@dep_lines) { | | 343 | foreach my $dep_line (@dep_lines) { |
335 | my ($type, $pkgbase, $constraint, $dir) = @$dep_line; | | 344 | my ($type, $pkgbase, $constraint, $dir) = @$dep_line; |
336 | | | 345 | |
337 | if ($dir eq "" && $pkgnameprefix ne "") { | | 346 | if ($dir eq "" && $pkgnameprefix ne "") { |
338 | $dir = find_package("$pkgnameprefix$pkgbase"); | | 347 | $dir = find_package("$pkgnameprefix$pkgbase"); |
339 | if ($dir ne "") { | | 348 | if ($dir ne "") { |
340 | $pkgbase = "$pkgnameprefix$pkgbase"; | | 349 | $pkgbase = "$pkgnameprefix$pkgbase"; |
341 | } | | 350 | } |
342 | } | | 351 | } |
343 | if ($dir eq "") { | | 352 | if ($dir eq "") { |
344 | $dir = find_package($pkgbase); | | 353 | $dir = find_package($pkgbase); |
| @@ -391,29 +400,27 @@ sub adjust_gconf2_schemas() { | | | @@ -391,29 +400,27 @@ sub adjust_gconf2_schemas() { |
391 | sub adjust_libtool() { | | 400 | sub adjust_libtool() { |
392 | if (-f "$abs_wrksrc/ltconfig" || -f "$abs_wrksrc/ltmain.sh") { | | 401 | if (-f "$abs_wrksrc/ltconfig" || -f "$abs_wrksrc/ltmain.sh") { |
393 | push(@build_vars, var("USE_LIBTOOL", "=", "yes")); | | 402 | push(@build_vars, var("USE_LIBTOOL", "=", "yes")); |
394 | } | | 403 | } |
395 | if (-d "$abs_wrksrc/libltdl") { | | 404 | if (-d "$abs_wrksrc/libltdl") { |
396 | push(@includes, "../../devel/libltdl/convenience.mk"); | | 405 | push(@includes, "../../devel/libltdl/convenience.mk"); |
397 | } | | 406 | } |
398 | } | | 407 | } |
399 | | | 408 | |
400 | # Example packages: | | 409 | # Example packages: |
401 | # devel/p5-Algorithm-CheckDigits | | 410 | # devel/p5-Algorithm-CheckDigits |
402 | sub adjust_perl_module_Build_PL() { | | 411 | sub adjust_perl_module_Build_PL() { |
403 | | | 412 | |
404 | # TODO: Implement this similarly to the Makefile.PL mock below. | | 413 | read_dependencies("cd '$abs_wrksrc' && perl -I$libdir -I. Build.PL", {}, ""); |
405 | | | | |
406 | push(@todos, "Look for the dependencies in Build.PL."); | | | |
407 | | | 414 | |
408 | push(@build_vars, var("PERL5_MODULE_TYPE", "=", "Module::Build")); | | 415 | push(@build_vars, var("PERL5_MODULE_TYPE", "=", "Module::Build")); |
409 | } | | 416 | } |
410 | | | 417 | |
411 | # Example packages: | | 418 | # Example packages: |
412 | # devel/p5-Algorithm-Diff (no dependencies) | | 419 | # devel/p5-Algorithm-Diff (no dependencies) |
413 | # devel/p5-Carp-Assert-More (dependencies without version numbers) | | 420 | # devel/p5-Carp-Assert-More (dependencies without version numbers) |
414 | # www/p5-HTML-Quoted (dependency with version number) | | 421 | # www/p5-HTML-Quoted (dependency with version number) |
415 | sub adjust_perl_module_Makefile_PL() { | | 422 | sub adjust_perl_module_Makefile_PL() { |
416 | | | 423 | |
417 | # To avoid fix_up_makefile error for p5-HTML-Quoted, generate Makefile first. | | 424 | # To avoid fix_up_makefile error for p5-HTML-Quoted, generate Makefile first. |
418 | system("cd '$abs_wrksrc' && perl -I. Makefile.PL < /dev/null") == 0 or do {}; | | 425 | system("cd '$abs_wrksrc' && perl -I. Makefile.PL < /dev/null") == 0 or do {}; |
419 | | | 426 | |
| @@ -438,27 +445,27 @@ sub adjust_perl_module() { | | | @@ -438,27 +445,27 @@ sub adjust_perl_module() { |
438 | unlink("PLIST") or do {}; | | 445 | unlink("PLIST") or do {}; |
439 | } | | 446 | } |
440 | | | 447 | |
441 | # Example packages: | | 448 | # Example packages: |
442 | # | | 449 | # |
443 | # devel/py-ZopeComponent (dependencies, test dependencies) | | 450 | # devel/py-ZopeComponent (dependencies, test dependencies) |
444 | sub adjust_python_module() { | | 451 | sub adjust_python_module() { |
445 | | | 452 | |
446 | return unless -f "$abs_wrksrc/setup.py"; | | 453 | return unless -f "$abs_wrksrc/setup.py"; |
447 | | | 454 | |
448 | my $cmd = "cd '$abs_wrksrc' && $pythonbin setup.py build"; | | 455 | my $cmd = "cd '$abs_wrksrc' && $pythonbin setup.py build"; |
449 | my $env = { | | 456 | my $env = { |
450 | "PYTHONDONTWRITEBYTECODE" => "x", | | 457 | "PYTHONDONTWRITEBYTECODE" => "x", |
451 | "PYTHONPATH" => $libdir | | 458 | "PYTHONPATH" => $libdir |
452 | }; | | 459 | }; |
453 | read_dependencies($cmd, $env, "py-"); | | 460 | read_dependencies($cmd, $env, "py-"); |
454 | | | 461 | |
455 | $pkgname_prefix = "\${PYPKGPREFIX}-"; | | 462 | $pkgname_prefix = "\${PYPKGPREFIX}-"; |
456 | push(@categories, "python"); | | 463 | push(@categories, "python"); |
457 | push(@includes, "../../lang/python/egg.mk"); | | 464 | push(@includes, "../../lang/python/egg.mk"); |
458 | } | | 465 | } |
459 | | | 466 | |
460 | sub adjust_cargo() { | | 467 | sub adjust_cargo() { |
461 | open(CONF, "<", "$abs_wrksrc/Cargo.lock") or return; | | 468 | open(CONF, "<", "$abs_wrksrc/Cargo.lock") or return; |
462 | | | 469 | |
463 | while (defined(my $line = <CONF>)) { | | 470 | while (defined(my $line = <CONF>)) { |
464 | # "checksum cargo-package-name cargo-package-version | | 471 | # "checksum cargo-package-name cargo-package-version |
| @@ -699,28 +706,27 @@ sub adjust_lines_python_module($$) { | | | @@ -699,28 +706,27 @@ sub adjust_lines_python_module($$) { |
699 | my @lines = @$lines; | | 706 | my @lines = @$lines; |
700 | if (lines_remove(\@lines, "GITHUB_PROJECT") | | 707 | if (lines_remove(\@lines, "GITHUB_PROJECT") |
701 | && lines_set(\@lines, "DISTNAME", "$pkgbase-$pkgversion_norev") | | 708 | && lines_set(\@lines, "DISTNAME", "$pkgbase-$pkgversion_norev") |
702 | && lines_set(\@lines, "PKGNAME", "\${PYPKGPREFIX}-\${DISTNAME}") | | 709 | && lines_set(\@lines, "PKGNAME", "\${PYPKGPREFIX}-\${DISTNAME}") |
703 | && lines_set(\@lines, "MASTER_SITES", "\${MASTER_SITE_PYPI:=$pkgbase1/$pkgbase/}") | | 710 | && lines_set(\@lines, "MASTER_SITES", "\${MASTER_SITE_PYPI:=$pkgbase1/$pkgbase/}") |
704 | && lines_remove(\@lines, "DIST_SUBDIR") | | 711 | && lines_remove(\@lines, "DIST_SUBDIR") |
705 | && (lines_remove_if(\@lines, "EXTRACT_SUFX", ".zip") || true)) { | | 712 | && (lines_remove_if(\@lines, "EXTRACT_SUFX", ".zip") || true)) { |
706 | | | 713 | |
707 | @$lines = @lines; | | 714 | @$lines = @lines; |
708 | $regenerate_distinfo = true | | 715 | $regenerate_distinfo = true |
709 | } | | 716 | } |
710 | } | | 717 | } |
711 | | | 718 | |
712 | sub adjust_package_from_extracted_distfiles($) | | 719 | sub adjust_package_from_extracted_distfiles($) { |
713 | { | | | |
714 | my ($url) = @_; | | 720 | my ($url) = @_; |
715 | | | 721 | |
716 | chomp($abs_wrkdir = `$make show-var VARNAME=WRKDIR`); | | 722 | chomp($abs_wrkdir = `$make show-var VARNAME=WRKDIR`); |
717 | | | 723 | |
718 | # | | 724 | # |
719 | # Determine the value of WRKSRC. | | 725 | # Determine the value of WRKSRC. |
720 | # | | 726 | # |
721 | | | 727 | |
722 | my @files = (); | | 728 | my @files = (); |
723 | opendir(WRKDIR, $abs_wrkdir) or die; | | 729 | opendir(WRKDIR, $abs_wrkdir) or die; |
724 | while (defined(my $f = readdir(WRKDIR))) { | | 730 | while (defined(my $f = readdir(WRKDIR))) { |
725 | next if $f =~ qr"^\." | | 731 | next if $f =~ qr"^\." |
726 | || $f eq "pax_global_header" | | 732 | || $f eq "pax_global_header" |
| @@ -748,28 +754,26 @@ sub adjust_package_from_extracted_distfi | | | @@ -748,28 +754,26 @@ sub adjust_package_from_extracted_distfi |
748 | adjust_cmake(); | | 754 | adjust_cmake(); |
749 | adjust_meson(); | | 755 | adjust_meson(); |
750 | adjust_gconf2_schemas(); | | 756 | adjust_gconf2_schemas(); |
751 | adjust_libtool(); | | 757 | adjust_libtool(); |
752 | adjust_perl_module(); | | 758 | adjust_perl_module(); |
753 | adjust_python_module(); | | 759 | adjust_python_module(); |
754 | adjust_cargo(); | | 760 | adjust_cargo(); |
755 | adjust_pkg_config(); | | 761 | adjust_pkg_config(); |
756 | adjust_po(); | | 762 | adjust_po(); |
757 | adjust_use_languages(); | | 763 | adjust_use_languages(); |
758 | | | 764 | |
759 | print("url2pkg> Adjusting the Makefile\n"); | | 765 | print("url2pkg> Adjusting the Makefile\n"); |
760 | | | 766 | |
761 | my $seen_marker = false; | | | |
762 | | | | |
763 | my @prev_lines = read_lines("Makefile"); | | 767 | my @prev_lines = read_lines("Makefile"); |
764 | my $marker_index = lines_index(\@prev_lines, qr"^# url2pkg-marker"); | | 768 | my $marker_index = lines_index(\@prev_lines, qr"^# url2pkg-marker"); |
765 | if ($marker_index == -1) { | | 769 | if ($marker_index == -1) { |
766 | die("$0: ERROR: didn't find the url2pkg marker in the Makefile.\n"); | | 770 | die("$0: ERROR: didn't find the url2pkg marker in the Makefile.\n"); |
767 | } | | 771 | } |
768 | | | 772 | |
769 | my @lines = @prev_lines[0 .. $marker_index - 1]; | | 773 | my @lines = @prev_lines[0 .. $marker_index - 1]; |
770 | | | 774 | |
771 | if (lines_index(\@lines, qr"^PKGNAME=") == -1) { | | 775 | if (lines_index(\@lines, qr"^PKGNAME=") == -1) { |
772 | my $distname_index = lines_index(\@lines, qr"^DISTNAME=(\t+)"); | | 776 | my $distname_index = lines_index(\@lines, qr"^DISTNAME=(\t+)"); |
773 | if ($distname_index != -1) { | | 777 | if ($distname_index != -1) { |
774 | my $pkgname_line = "PKGNAME=\t$pkgname_prefix\${DISTNAME$pkgname_transform}"; | | 778 | my $pkgname_line = "PKGNAME=\t$pkgname_prefix\${DISTNAME$pkgname_transform}"; |
775 | splice(@lines, $distname_index + 1, 0, $pkgname_line); | | 779 | splice(@lines, $distname_index + 1, 0, $pkgname_line); |
| @@ -791,26 +795,30 @@ sub adjust_package_from_extracted_distfi | | | @@ -791,26 +795,30 @@ sub adjust_package_from_extracted_distfi |
791 | | | 795 | |
792 | lines_add_vars(\@lines, \@build_vars); | | 796 | lines_add_vars(\@lines, \@build_vars); |
793 | lines_add_vars(\@lines, \@extra_vars); | | 797 | lines_add_vars(\@lines, \@extra_vars); |
794 | | | 798 | |
795 | push(@lines, @bl3_lines); | | 799 | push(@lines, @bl3_lines); |
796 | push(@lines, map { $_ = ".include \"$_\"" } @includes); | | 800 | push(@lines, map { $_ = ".include \"$_\"" } @includes); |
797 | | | 801 | |
798 | push(@lines, @prev_lines[$marker_index + 1 .. $#prev_lines]); | | 802 | push(@lines, @prev_lines[$marker_index + 1 .. $#prev_lines]); |
799 | | | 803 | |
800 | lines_append(\@lines, "CATEGORIES", join(" ", @categories)); | | 804 | lines_append(\@lines, "CATEGORIES", join(" ", @categories)); |
801 | | | 805 | |
802 | adjust_lines_python_module(\@lines, $url); | | 806 | adjust_lines_python_module(\@lines, $url); |
803 | | | 807 | |
| | | 808 | foreach my $varname (keys %update_vars) { |
| | | 809 | lines_set(\@lines, $varname, $update_vars{$varname}); |
| | | 810 | } |
| | | 811 | |
804 | write_lines("Makefile", @lines); | | 812 | write_lines("Makefile", @lines); |
805 | | | 813 | |
806 | if ($regenerate_distinfo) { | | 814 | if ($regenerate_distinfo) { |
807 | make("distinfo"); | | 815 | make("distinfo"); |
808 | } | | 816 | } |
809 | } | | 817 | } |
810 | | | 818 | |
811 | sub main() { | | 819 | sub main() { |
812 | my $url; | | 820 | my $url; |
813 | | | 821 | |
814 | if (!-f "../../mk/bsd.pkg.mk") { | | 822 | if (!-f "../../mk/bsd.pkg.mk") { |
815 | die("ERROR: $0 must be run from a package directory (.../pkgsrc/category/package).\n"); | | 823 | die("ERROR: $0 must be run from a package directory (.../pkgsrc/category/package).\n"); |
816 | } | | 824 | } |