create-package-feed.pl: Get input directory and output file from the command line
authorFabian Keil <fk@fabiankeil.de>
Sat, 16 Jul 2016 11:43:14 +0000 (11:43 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 16 Jul 2016 11:43:14 +0000 (11:43 +0000)
utils/create-package-feed.pl

index d4acad2..6e87588 100644 (file)
@@ -7,9 +7,11 @@ my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
 my @days   = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
 
 #< Config START >
 my @days   = qw(Sun Mon Tue Wed Thu Fri Sat Sun);
 
 #< Config START >
-my $scan_dir   = '/xxxxxxxxxxxxxxxxxxxxxx/sf-download/';
+my $scan_dir = shift(@ARGV)
+    or die "Local package directory not specified (first argument)\n";
+my $save_rss_file = shift(@ARGV)
+    or die "RSS output file path not specified (second argument)\n";
 my $base_dlurl = 'https://www.privoxy.org/sf-download-mirror/';
 my $base_dlurl = 'https://www.privoxy.org/sf-download-mirror/';
-my $save_rss_file ='/xxxxxxxxxxxxxxxxxxxxxx/release.xml'; # e.g., release.rss
 my $maxlimit = 1000;
 my $max_advertised_files = 100;
 
 my $maxlimit = 1000;
 my $max_advertised_files = 100;