From b3ffbdc0334c24d5d90ca3227a765fbd1e09bbc3 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 8 Jan 2010 13:59:52 +0100 Subject: [syncqt] Make it possible to override the base directory This removes the need to set the QTDIR environment variable and makes it possible to call syncqt conveniently when creating webkit packages. Reviewed-by: Thiago --- bin/syncqt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/syncqt b/bin/syncqt index 6c1a438..be0a019 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -15,6 +15,13 @@ use Cwd; use Config; use strict; +for (my $i = 0; $i < $#ARGV; $i++) { + if ($ARGV[$i] eq "-base-dir" && $i < $#ARGV - 1) { + $ENV{"QTDIR"} = $ARGV[$i + 1]; + last; + } +} + die "syncqt: QTDIR not defined" if ! $ENV{"QTDIR"}; # sanity check # global variables @@ -579,6 +586,10 @@ while ( @ARGV ) { } elsif("$arg" eq "-show") { $var = "showonly"; $val = "yes"; + } elsif("$arg" eq "-base-dir") { + # skip, it's been dealt with at the top of the file + shift @ARGV; + next; } elsif("$arg" eq '*') { # workaround for windows 9x where "%*" expands to "*" $var = 1; -- cgit v0.12