diff -b -u -w -r1.42 portpackage.tcl
old
|
new
|
|
56 | 56 | proc package_pkg {portname portversion portrevision} { |
57 | 57 | global portdbpath destpath workpath prefix portresourcepath description package.destpath long_description homepage |
58 | 58 | |
| 59 | # make sure package contains receipt file |
| 60 | if [string length [registry_exists $portname $portversion]] { |
| 61 | set rfile [registry_exists $portname $portversion] |
| 62 | if [string length $rfile] { |
| 63 | file mkdir "${destpath}/[file dirname ${rfile}]" |
| 64 | file copy -force $rfile "${destpath}/${rfile}" |
| 65 | } |
| 66 | } |
| 67 | |
59 | 68 | set resourcepath ${workpath}/pkg_resources |
60 | 69 | # XXX: we need to support .lproj in resources. |
61 | 70 | set pkgpath ${package.destpath}/${portname}-${portversion}.pkg |
… |
… |
|
77 | 86 | system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz" |
78 | 87 | |
79 | 88 | write_sizes_file ${pkgpath}/Contents/Resources/Archive.sizes ${portname} ${portversion} ${pkgpath} ${destpath} |
| 89 | |
| 90 | # make sure to remove receipt from destpath when finished |
| 91 | if [file exists "${destpath}/${rfile}"] { |
| 92 | # remove receipt file |
| 93 | file delete "${destpath}/${rfile}" |
| 94 | # prune leftover empty directories |
| 95 | catch {system "find \"${destpath}\" -depth -type d -print | xargs rmdir 2>/dev/null"} |
| 96 | } |
80 | 97 | |
81 | 98 | return 0 |
82 | 99 | } |