Changeset 95480


Ignore:
Timestamp:
Jul 13, 2012, 9:43:43 PM (8 years ago)
Author:
jmr@…
Message:

cope with missing image dirs in images_to_archives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/images_to_archives.tcl

    r81464 r95480  
    9393        } else {
    9494            set targetdir [file join ${macports::registry.path} software ${iname}]
    95             file mkdir $targetdir
     95        }
     96        if {$location == "" || ![file isdirectory $location]} {
    9697            set contents [$iref imagefiles]
    9798        }
     99        file mkdir $targetdir
    98100        set newlocation [file join $targetdir $archivename]
    99101
    100102        if {$found} {
    101103            file rename $oldarchivefullpath $newlocation
    102         } elseif {$installtype == "image"} {
     104        } elseif {$installtype == "image" && [file isdirectory $location]} {
    103105            # create archive from image dir
    104             system "cd $location && $tarcmd -cjf $newlocation * > ${targetdir}/error.log 2>&1"
     106            system -W $location "$tarcmd -cjf $newlocation * > ${targetdir}/error.log 2>&1"
    105107            file delete -force ${targetdir}/error.log
    106108        } else {
    107             # direct mode, create archive from installed files
     109            # direct mode (or missing image dir), create archive from installed files
    108110            # we tell tar to read filenames from a file so as not to run afoul of command line length limits
    109111            set fd [open ${targetdir}/tarlist w]
Note: See TracChangeset for help on using the changeset viewer.