scripts: fix dl_cleanup.py argument handling
[openwrt/staging/stintel.git] / scripts / slugimage.pl
index deac6ac6dd33f66e2d9bb3520363136a15cd8c33..366b239e960fb3978f7f795a397e685c27d7fc79 100755 (executable)
@@ -40,7 +40,7 @@ use strict;
 use warnings;
 
 use Getopt::Long qw(:config no_ignore_case);
-use POSIX qw(tmpnam);
+use File::Temp qw(tempfile);
 
 my($debug) = 0;
 my($quiet) = 0;
@@ -772,7 +772,7 @@ sub writeOutFirmware {
                                 $_->{'name'}, $filename);
            }
 
-           # If the next parition is before the end of the current image, then rewind.
+           # If the next partition is before the end of the current image, then rewind.
            elsif ($_->{'offset'} < $end_point) {
                $debug and printf("Rewound %s before <%s> in \"%s\"\n",
                                  (($end_point - $_->{'offset'}) >= $block_size ?
@@ -971,7 +971,7 @@ if (!GetOptions("d|debug"       => \$debug,
     print "  [-b|--redboot]   <file>           Input/Output RedBoot filename\n";
     print "  [-s|--sysconf]   <file>           Input/Output SysConf filename\n";
     print "  [-L|--loader]    <file>           Second stage boot loader filename\n";
-    print "  [-k|--kernel]    <file>           Input/Ouptut Kernel filename\n";
+    print "  [-k|--kernel]    <file>           Input/Output Kernel filename\n";
     print "  [-r|--ramdisk]   <file>           Input/Output Ramdisk filename(s)\n";
     print "  [-f|--fisdir]    <file>           Input/Output FIS directory filename\n";
     print "  [-m|--microcode] <file>           Input/Output Microcode filename\n";
@@ -993,7 +993,7 @@ if ($pack) {
     # don't touch RedBoot and SysConf anyway.  If no Trailer is specified,
     # put in one.
     if (not defined $redboot and not -e "RedBoot") {
-       $redboot = tmpnam();
+       $redboot = tempfile();
        open TMP, ">$redboot" or die "Cannot open file $redboot: $!";
        push @cleanup, $redboot;
        # The RedBoot partition is 256 * 1024 = 262144; the trailer we add
@@ -1006,7 +1006,7 @@ if ($pack) {
        close TMP;
     }
     if (not defined $sysconf and not -e "SysConf") {
-       $sysconf = tmpnam();
+       $sysconf = tempfile();
        open TMP, ">$sysconf" or die "Cannot open file $sysconf: $!";
        push @cleanup, $sysconf;
        # The SysConf partition is 128 * 1024 = 131072
@@ -1014,7 +1014,7 @@ if ($pack) {
        close TMP;
     }
     if (not defined $trailer and not -e "Trailer") {
-       $trailer = tmpnam();
+       $trailer = tempfile();
        open TMP, ">$trailer" or die "Cannot open file $trailer: $!";
        push @cleanup, $trailer;
        for my $i (@sercomm_flash_trailer) {