Pārlūkot izejas kodu

Add cmd line option to build pkgs flagged as always update

Make it the default case to not build those packages, helpful
if for example portslist is installed which takes a long time
to build.
Markus Hennecke 5 gadi atpakaļ
vecāks
revīzija
086f736223
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 11 0
      autoupdate.pl

+ 11 - 0
autoupdate.pl

@@ -43,6 +43,10 @@ my $show_help = 0;
 # If set to more than one it will try to build ports in parallel
 my $num_jobs = 1;
 
+# If set to 1 update will take those ports into account flagged for always
+# update
+my $always_update = 0;
+
 # If set to 1 the make clean part of the ports build will use sudo
 my $sudo_make_clean = 0;
 my $sudo = $ENV{SUDO};
@@ -349,6 +353,10 @@ sub read_update_package_list {
 			print STDERR 'Ignoring ' . $pkg . "\n";
 			next;
 		}
+		if ($_ =~ m/#\ always-update -> 0,/x && !$always_update) {
+			print STDERR "Ignoring $pkg (always update)\n";
+			next;
+		}
 		push @package_list, ($pkg);
 	}
 	close($in);
@@ -767,6 +775,8 @@ sub usage {
 	    . " -j|--jobs\t\tTry to build packages in parallel\n"
 	    . " \t\t\tIf the filename is '-' the input will be\n"
 	    . " \t\t\tread from stdin\n"
+	    . " -a|--alwaysupdate\tBuild all packages, even those\n"
+	    . "\t\t\tflagged as always update\n"
 	    . " -h|--help\t\tShow this help\n";
 	exit ($show_help ? 0 : 1);
 }
@@ -779,6 +789,7 @@ $SIG{CHLD} = 'DEFAULT';
 my $result = GetOptions("v|verbose=i" => \$verbose,
 			"f|outdated=s" => \$out_of_date,
 			"j|jobs=i" => \$num_jobs,
+			"a|alwaysupdate" => \$always_update,
 			"h|help" => \$show_help);
 
 usage() if ($show_help != 0 || ! $result || $num_jobs < 1);