Improved robustness of package list location searching.
authorthomase
Tue, 25 Aug 2009 17:55:56 +0100
changeset 39 759027e1c6b3
parent 38 a1155a089aba
child 40 674034f6180c
Improved robustness of package list location searching.
clone_packages/clone_all_packages.pl
--- a/clone_packages/clone_all_packages.pl	Tue Aug 25 17:31:00 2009 +0100
+++ b/clone_packages/clone_all_packages.pl	Tue Aug 25 17:55:56 2009 +0100
@@ -81,10 +81,14 @@
 my $exec = 0;
 my $filter = "";
 
-my $sf_pkg_list_file = "sf_mcl_packages.txt";
-my $sftools_pkg_list_file = "sftools_mcl_packages.txt";
-my $other_pkg_list_file = "other_packages.txt";
+# Extract the path location of the program and locate package list files
+my $program_path = $0;
+$program_path =~ s#(^.*\\)[^\\]+$#$1#;
+my $sf_pkg_list_file = $program_path."sf_mcl_packages.txt";
+my $sftools_pkg_list_file = $program_path."sftools_mcl_packages.txt";
+my $other_pkg_list_file = $program_path."other_packages.txt";
 
+# Analyse the rest of command-line parameters
 if (!GetOptions(
     "u|username=s" => \$username,
     "p|password=s" => \$password,