summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFabien Tassin <fta@sofaraway.org>2008-06-06 15:05:42 +0200
committerFabien Tassin <fta@sofaraway.org>2008-06-06 15:05:42 +0200
commita6ad8b5bb1899b8526457f1eb9c54f0f4d1b94e4 (patch)
tree0ed51ae342f5ea1193cb27bb16135143c9f97e6a /src
parent433c87d371433b71f49d6f4c5c95b667e193e81e (diff)
* [mozclient] Fix --conf-dir not looking for .conf files are the right place
- update src/mozclient.pl
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mozclient.pl40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/mozclient.pl b/src/mozclient.pl
index 7671a8b..c367cdf 100755
--- a/src/mozclient.pl
+++ b/src/mozclient.pl
@@ -23,8 +23,27 @@ use strict;
use Getopt::Long qw(:config no_auto_abbrev no_ignore_case
require_order bundling);
-my $mozclient_dir = "/usr/share/mozilla-devscripts";
-my $pkg_conf_dir = "$mozclient_dir/mozclient";
+BEGIN {
+ my $conf_dir = "/usr/share/mozilla-devscripts/mozclient";
+ # We look for modules in ${conf_dir}/lib
+ # We can prefer another path by using '--conf-dir path' or '-c path'
+ unshift @INC, "$conf_dir/lib";
+
+ my @args = @ARGV;
+ while (1) {
+ my $arg = shift @args;
+ last unless defined $arg;
+ next unless $arg eq '-c' || $arg eq '--conf-dir';
+ my $path = shift @args;
+ die "Usage error: $arg needs an argument\n" unless defined $path;
+ unshift @INC, "$path/lib";
+ last;
+ }
+}
+
+$INC[0] =~ m,(.*)/lib$,;
+my $mozclient_dir = $1;
+my $pkg_conf_dir = "$mozclient_dir";
my $patches_dir = "$pkg_conf_dir/patches";
my $work_dir = "mozclient-tmp";
@@ -45,23 +64,6 @@ my $defaults = {
'MOZCLIENT_PATCHES' => "$patches_dir",
};
-BEGIN {
- # We look for modules in /usr/share/mozilla-devscripts/mozclient/lib
- # We can prefer another path by using '--conf-dir path' or '-c path'
- unshift @INC, "/usr/share/mozilla-devscripts/mozclient/lib";
-
- my @args = @ARGV;
- while (1) {
- my $arg = shift @args;
- last unless defined $arg;
- next unless $arg eq '-c' || $arg eq '--conf-dir';
- my $path = shift @args;
- die "Usage error: $arg needs an argument\n" unless defined $path;
- unshift @INC, $path;
- last;
- }
-}
-
sub help {
print <<EOF;
mozclient [-b branch] [-t tag] [-d YYYYMMDDtHHmm] project-name