Changeset 1518 for trunk/base


Ignore:
Timestamp:
Dec 25, 2002, 8:01:17 AM (17 years ago)
Author:
kevin
Message:

Handle Portfiles without contents lists.
Don't include version in package name (yet). I was getting errors about .bom
file not found in some cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portpackage.tcl

    r1516 r1518  
    109109    set ix [lsearch $entry contents]
    110110    if {$ix >= 0} {
    111         set plist [mkstemp ${workpath}/.${portname}.plist.XXXXXXXXX]
    112         set pfile [lindex $plist 0]
    113         # XXX hack that allows contents list to be grouped by braces
    114         # XXX split contents list up if it contains one argument
    115         # XXX this breaks contents lists that contain one filename, with spaces.
    116         if {[llength $contents] == 1} {
    117             set clist [eval return $contents]
    118         } else {
    119             set clist $contents
    120         }
    121 
    122         foreach f $clist {
    123             set fname [lindex $f 0]
    124             puts $pfile $fname
    125         }
    126         close $pfile
    127 
    128         if {![file isdirectory $destpath]} {
    129             if {[catch {file mkdir $destpath} result]} {
    130                 ui_error "Unable to create destination root path: $result"
    131                 return -code error "Unable to create destination root path: $result"
    132             }
    133         }
    134 
    135         if [catch {system "(cd ${prefix} && gnutar -T [lindex $plist 1] -cPpf -) | (cd ${destpath} && tar xvf -)"} return] {
    136             ui_error "Package creation failed - gnutar returned error status: $return"
    137             file delete [lindex $plist 1]
    138             return -code error "Package creation failed - gnutar returned error status: $return"
    139         }
    140         file delete [lindex $plist 1]
    141 
     111                set plist [mkstemp ${workpath}/.${portname}.plist.XXXXXXXXX]
     112                set pfile [lindex $plist 0]
     113                # XXX hack that allows contents list to be grouped by braces
     114                # XXX split contents list up if it contains one argument
     115                # XXX this breaks contents lists that contain one filename, with spaces.
     116                if {[llength $contents] == 1} {
     117                        set clist [eval return $contents]
     118                } else {
     119                        set clist $contents
     120                }
     121       
     122                foreach f $clist {
     123                        set fname [lindex $f 0]
     124                        puts $pfile $fname
     125                }
     126                close $pfile
     127       
     128                if {![file isdirectory $destpath]} {
     129                        if {[catch {file mkdir $destpath} result]} {
     130                        ui_error "Unable to create destination root path: $result"
     131                        return -code error "Unable to create destination root path: $result"
     132                        }
     133                }
     134       
     135                if [catch {system "(cd ${prefix} && gnutar -T [lindex $plist 1] -cPpf -) | (cd ${destpath} && tar xvf -)"} return] {
     136                        ui_error "Package creation failed - gnutar returned error status: $return"
     137                        file delete [lindex $plist 1]
     138                        return -code error "Package creation failed - gnutar returned error status: $return"
     139                }
     140                file delete [lindex $plist 1]
     141        }
    142142        if {![file isdirectory $resourcepath]} {
    143143            if {[catch {file mkdir $resourcepath} result]} {
     
    148148
    149149# XXX: we need to support .lproj in resources.
    150         set pkgpath ${workpath}/${portname}-${portversion}.pkg
     150        set pkgpath ${workpath}/${portname}.pkg
    151151        system "mkdir -p -m 0755 ${pkgpath}/Contents/Resources"
    152152        write_PkgInfo ${pkgpath}/Contents/PkgInfo
     
    164164#       system "package ${destpath} ${infofile} ${portresourcepath}/package/background.tiff -d ${package.destpath}"
    165165
    166     }
    167166    return 0
    168167}
Note: See TracChangeset for help on using the changeset viewer.