summaryrefslogtreecommitdiff
path: root/Master/bin/powerpc-aix/getnonfreefonts
diff options
context:
space:
mode:
Diffstat (limited to 'Master/bin/powerpc-aix/getnonfreefonts')
-rwxr-xr-xMaster/bin/powerpc-aix/getnonfreefonts45
1 files changed, 20 insertions, 25 deletions
diff --git a/Master/bin/powerpc-aix/getnonfreefonts b/Master/bin/powerpc-aix/getnonfreefonts
index 969a251b52c..41f628becc0 100755
--- a/Master/bin/powerpc-aix/getnonfreefonts
+++ b/Master/bin/powerpc-aix/getnonfreefonts
@@ -50,7 +50,10 @@ EOF
;
}
-@ARGS=@ARGV;
+unless (@ARGV) {
+ usage;
+ exit 1;
+}
GetOptions
"all|a",
@@ -69,16 +72,6 @@ $sys=1 if $opt_sys;
@allpackages=@ARGV;
-print "$TL_version\n" and exit 0 if $opt_version;
-
-if ($opt_help or !@ARGS) {
- print "\nThis is getnonfreefonts";
- print '-sys' if ($sys);
- print ", version $TL_version.\n\n";
- usage;
-}
-
-
sub message {
my $message=shift;
if ($message=~/^\[/) {
@@ -113,6 +106,7 @@ sub expand_var {
}
+
# get TMP|TEMP|TMPDIR environment variable
if ($opt_debug) {
@@ -125,6 +119,8 @@ if ($opt_debug) {
}
}
+print "$TL_version\n" and exit 0 if $opt_version;
+
if (defined $ENV{'TMP'}) {
$SYSTMP="$ENV{'TMP'}";
@@ -148,13 +144,12 @@ $SYSTMP=~s/\\/\//g if ($SYSTMP=~/^\\\\/); # \\abc\def
debug_msg "Internal variable SYSTMP converted to '$SYSTMP'";
-sub check_tmpdir{
die "! ERROR: The temporary directory '$SYSTMP' doesn't exist.\n"
unless (-d "$SYSTMP");
die "! ERROR: The temporary directory '$SYSTMP' is not writable.\n"
unless (-w "$SYSTMP");
-}
+
# Determine INSTALLROOT.
@@ -187,28 +182,28 @@ $INSTALLROOT=~s/\\/\//g if ($INSTALLROOT=~/^\\\\/); # \\abc\def
debug_msg "Internal variable INSTALLROOT converted to '$INSTALLROOT'";
-sub check_installroot {
- die "! ERROR: The install directory '$INSTALLROOT' doesn't exist.\n"
- unless (-d "$INSTALLROOT");
-
- die "! ERROR: The install directory '$INSTALLROOT' is not writable.\n"
- unless (-w "$INSTALLROOT");
-}
+die "! ERROR: The install directory '$INSTALLROOT' doesn't exist.\n"
+ unless (-d "$INSTALLROOT");
+
+die "! ERROR: The install directory '$INSTALLROOT' is not writable.\n"
+ unless (-w "$INSTALLROOT");
-if ($opt_help or !@ARGS) {
+
+if ($opt_help) {
+ print "\nThis is getnonfreefonts";
+ print '-sys' if ($sys);
+ print ", version $TL_version.\n\n";
+
+ usage;
print <<"ENDUSAGE";
Directories:
temporary: '$SYSTMP/getfont-<PID>'
install: '$INSTALLROOT'
ENDUSAGE
-check_tmpdir;
-check_installroot;
exit 0;
}
-check_tmpdir;
-check_installroot;
my $tmpdir="$SYSTMP/getfont-$$";
debug_msg "Internal variable tmpdir set to '$tmpdir'";