Skip to content

Commit

Permalink
Merging 3 days of diffs last good backup:
Browse files Browse the repository at this point in the history
  - Use new dependency list package
  - Added accessors for portfile options
  - use cpio format pax(1) archives

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@2118 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Kevin Van Vechten committed Mar 1, 2003
1 parent 8b97cce commit 6f6cbd0
Show file tree
Hide file tree
Showing 15 changed files with 213 additions and 541 deletions.
24 changes: 10 additions & 14 deletions src/port1.0/portbuild.tcl
Expand Up @@ -33,10 +33,9 @@ package provide portbuild 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.build [target_new com.apple.build build_main] set com.apple.build [target_new com.apple.build build_main]
${com.apple.build} provides build target_provides ${com.apple.build} build
${com.apple.build} requires main fetch extract checksum patch configure target_requires ${com.apple.build} main fetch extract checksum patch configure
${com.apple.build} deplist depends_build depends_lib target_prerun ${com.apple.build} build_start
${com.apple.build} set prerun build_start


# define options # define options
options build.target.all build.target options build.target.all build.target
Expand All @@ -48,25 +47,22 @@ default build.pre_args {${build.target}}
option_deprecate build.target.all build.target option_deprecate build.target.all build.target
default build.target "all" default build.target "all"



set UI_PREFIX "---> " set UI_PREFIX "---> "


proc build_getmaketype {args} { proc build_getmaketype {args} {
global build.type build.cmd os.platform if {![exists build.type]} {

if ![info exists build.type] {
return make return make
} }
switch -exact -- ${build.type} { switch -exact -- [option build.type] {
bsd { bsd {
if {${os.platform} == "darwin"} { if {[option os.platform] == "darwin"} {
return bsdmake return bsdmake
} else { } else {
return make return make
} }
} }
gnu { gnu {
if {${os.platform} == "darwin"} { if {[option os.platform] == "darwin"} {
return gnumake return gnumake
} else { } else {
return gmake return gmake
Expand All @@ -76,16 +72,16 @@ proc build_getmaketype {args} {
return pbxbuild return pbxbuild
} }
default { default {
ui_warn "[format [msgcat::mc "Unknown build.type %s, using 'gnumake'"] ${build.type}]" ui_warn "[format [msgcat::mc "Unknown build.type %s, using 'gnumake'"] [option build.type]]"
return gnumake return gnumake
} }
} }
} }


proc build_start {args} { proc build_start {args} {
global UI_PREFIX portname build.target global UI_PREFIX


ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s with target %s"] ${portname} ${build.target}]" ui_msg "$UI_PREFIX [format [msgcat::mc "Building %s with target %s"] [option portname] [option build.target]]"
} }


proc build_main {args} { proc build_main {args} {
Expand Down
18 changes: 8 additions & 10 deletions src/port1.0/portchecksum.tcl
Expand Up @@ -33,9 +33,9 @@ package provide portchecksum 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.checksum [target_new com.apple.checksum checksum_main] set com.apple.checksum [target_new com.apple.checksum checksum_main]
${com.apple.checksum} provides checksum target_provides ${com.apple.checksum} checksum
${com.apple.checksum} requires main fetch target_requires ${com.apple.checksum} main fetch
${com.apple.checksum} set prerun checksum_start target_prerun ${com.apple.checksum} checksum_start


# define options # define options
options checksums options checksums
Expand Down Expand Up @@ -64,9 +64,7 @@ proc md5 {file} {
} }


proc dmd5 {file} { proc dmd5 {file} {
global checksums foreach {name type sum} [option checksums] {

foreach {name type sum} $checksums {
if {$name == $file} { if {$name == $file} {
return $sum return $sum
} }
Expand All @@ -81,14 +79,14 @@ proc checksum_start {args} {
} }


proc checksum_main {args} { proc checksum_main {args} {
global checksums distpath all_dist_files UI_PREFIX global distpath all_dist_files UI_PREFIX


# If no files have been downloaded there is nothing to checksum # If no files have been downloaded there is nothing to checksum
if ![info exists all_dist_files] { if ![info exists all_dist_files] {
return 0 return 0
} }


if ![info exists checksums] { if {![exists checksums]} {
ui_error "[msgcat::mc "No checksums statement in Portfile. File checksums are:"]" ui_error "[msgcat::mc "No checksums statement in Portfile. File checksums are:"]"
foreach distfile $all_dist_files { foreach distfile $all_dist_files {
ui_msg "$distfile md5 [md5 $distpath/$distfile]" ui_msg "$distfile md5 [md5 $distpath/$distfile]"
Expand All @@ -97,8 +95,8 @@ proc checksum_main {args} {
} }


# Optimization for the 2 argument case for checksums # Optimization for the 2 argument case for checksums
if {[llength $checksums] == 2 && [llength $all_dist_files] == 1} { if {[llength [option checksums]] == 2 && [llength $all_dist_files] == 1} {
set checksums [linsert $checksums 0 $all_dist_files] option checksums [linsert [option checksums] 0 $all_dist_files]
} }


foreach distfile $all_dist_files { foreach distfile $all_dist_files {
Expand Down
17 changes: 9 additions & 8 deletions src/port1.0/portclean.tcl
Expand Up @@ -35,19 +35,20 @@ package provide portclean 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.clean [target_new com.apple.clean clean_main] set com.apple.clean [target_new com.apple.clean clean_main]
${com.apple.clean} set runtype always target_runtype ${com.apple.clean} always
${com.apple.clean} provides clean target_provides ${com.apple.clean} clean
${com.apple.clean} requires main target_requires ${com.apple.clean} main
${com.apple.clean} set prerun clean_start target_prerun ${com.apple.clean} clean_start

set UI_PREFIX "--->"


proc clean_start {args} { proc clean_start {args} {
global UI_PREFIX portname global UI_PREFIX


ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] $portname]" ui_msg "$UI_PREFIX [format [msgcat::mc "Cleaning %s"] [option portname]]"
} }


proc clean_main {args} { proc clean_main {args} {
global workpath exec rm -rf [file join [option workpath]]
exec rm -rf [file join ${workpath}]
return 0 return 0
} }
11 changes: 5 additions & 6 deletions src/port1.0/portconfigure.tcl
Expand Up @@ -33,10 +33,9 @@ package provide portconfigure 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.configure [target_new com.apple.configure configure_main] set com.apple.configure [target_new com.apple.configure configure_main]
${com.apple.configure} provides configure target_provides ${com.apple.configure} configure
${com.apple.configure} requires main fetch extract checksum patch target_requires ${com.apple.configure} main fetch extract checksum patch
${com.apple.configure} deplist depends_build depends_lib target_prerun ${com.apple.configure} configure_start
${com.apple.configure} set prerun configure_start


# define options # define options
commands configure automake autoconf xmkmf libtool commands configure automake autoconf xmkmf libtool
Expand All @@ -53,9 +52,9 @@ default use_configure yes
set UI_PREFIX "---> " set UI_PREFIX "---> "


proc configure_start {args} { proc configure_start {args} {
global UI_PREFIX portname global UI_PREFIX


ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] $portname]" ui_msg "$UI_PREFIX [format [msgcat::mc "Configuring %s"] [option portname]]"
} }


proc configure_main {args} { proc configure_main {args} {
Expand Down
6 changes: 3 additions & 3 deletions src/port1.0/portcontents.tcl
Expand Up @@ -33,9 +33,9 @@ package provide portcontents 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.contents [target_new com.apple.contents contents_main] set com.apple.contents [target_new com.apple.contents contents_main]
${com.apple.contents} set runtype always target_runtype ${com.apple.contents} always
${com.apple.contents} provides toc target_provides ${com.apple.contents} toc
${com.apple.contents} requires main target_requires ${com.apple.contents} main


set UI_PREFIX "---> " set UI_PREFIX "---> "


Expand Down
35 changes: 11 additions & 24 deletions src/port1.0/portdepends.tcl
Expand Up @@ -36,43 +36,30 @@ package provide portdepends 1.0
package require portutil 1.0 package require portutil 1.0


# define options # define options
options depends_fetch depends_build depends_run depends_extract depends_lib options depends_build depends_run depends_lib
# Export options via PortInfo # Export options via PortInfo
options_export depends_lib depends_run options_export depends_build depends_lib depends_run


option_proc depends_fetch handle_depends_options option_proc depends_build validate_depends_options
option_proc depends_build handle_depends_options option_proc depends_run validate_depends_options
option_proc depends_run handle_depends_options option_proc depends_lib validate_depends_options
option_proc depends_extract handle_depends_options
option_proc depends_lib handle_depends_options


proc handle_depends_options {option action args} { proc validate_depends_options {option action args} {
global targets global targets
switch -regex $action { switch -regex $action {
set|append { set|append|delete {
foreach depspec $args { foreach depspec $args {
if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9_/\-\.$^\?\+\(\)\|\\]+):([-A-Za-z\./0-9_]+)} "$depspec" match deppath depregex portname] == 1} { if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9_/\-\.$^\?\+\(\)\|\\]+):([-A-Za-z\./0-9_]+)} "$depspec" match deppath depregex portname] == 1} {
switch $deppath { switch $deppath {
lib { set obj [libportfile_new $portname $depregex] } lib {}
bin { set obj [binportfile_new $portname $depregex] } bin {}
path { set obj [pathportfile_new $portname $depregex] } path {}
} default {return -code error [format [msgcat::mc "unknown depspec type: %s"] $deppath]}
if {[info exists obj]} {
$obj append provides $option portfile-$portname
lappend targets $obj
foreach obj [depspec_get_matches $targets deplist $option] {
$obj append requires portfile-$portname
}
} else {
return -code error [format [msgcat::mc "unknown depspec type: %s"] $deppath]
} }
} else { } else {
return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec] return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec]
} }
} }
} }
delete {
# xxx: need to delete requirement from each item in the deplist
}
} }
} }
33 changes: 16 additions & 17 deletions src/port1.0/portextract.tcl
Expand Up @@ -33,11 +33,10 @@ package provide portextract 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.extract [target_new com.apple.extract extract_main] set com.apple.extract [target_new com.apple.extract extract_main]
${com.apple.extract} set init extract_init target_init ${com.apple.extract} extract_init
${com.apple.extract} provides extract target_provides ${com.apple.extract} extract
${com.apple.extract} requires fetch checksum target_requires ${com.apple.extract} fetch checksum
${com.apple.extract} deplist depends_extract target_prerun ${com.apple.extract} extract_start
${com.apple.extract} set prerun extract_start


# define options # define options
options extract.only options extract.only
Expand All @@ -58,32 +57,32 @@ set UI_PREFIX "---> "
proc extract_init {args} { proc extract_init {args} {
global extract.only extract.dir extract.cmd extract.pre_args extract.post_args distfiles use_bzip2 use_zip workpath global extract.only extract.dir extract.cmd extract.pre_args extract.post_args distfiles use_bzip2 use_zip workpath


if [info exists use_bzip2] { if [exists use_bzip2] {
set extract.cmd bzip2 option extract.cmd bzip2
} elseif [info exists use_zip] { } elseif [exists use_zip] {
set extract.cmd unzip option extract.cmd unzip
set extract.pre_args -q option extract.pre_args -q
set extract.post_args "-d ${extract.dir}" option extract.post_args "-d [option extract.dir]"
} }
} }


proc extract_start {args} { proc extract_start {args} {
global UI_PREFIX portname global UI_PREFIX


ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $portname]" ui_msg "$UI_PREFIX [format [msgcat::mc "Extracting %s"] [option portname]]"
} }


proc extract_main {args} { proc extract_main {args} {
global portname distname distpath distfiles use_bzip2 extract.only extract.cmd extract.before_args extract.after_args extract.args UI_PREFIX global UI_PREFIX


if {![info exists distfiles] && ![info exists extract.only]} { if {![exists distfiles] && ![exists extract.only]} {
# nothing to do # nothing to do
return 0 return 0
} }


foreach distfile ${extract.only} { foreach distfile [option extract.only] {
ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile] ... " -nonewline ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile] ... " -nonewline
set extract.args "$distpath/$distfile" option extract.args "[option distpath]/$distfile"
if [catch {system "[command extract]"} result] { if [catch {system "[command extract]"} result] {
return -code error "$result" return -code error "$result"
} }
Expand Down
9 changes: 4 additions & 5 deletions src/port1.0/portfetch.tcl
Expand Up @@ -33,11 +33,10 @@ package provide portfetch 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.fetch [target_new com.apple.fetch fetch_main] set com.apple.fetch [target_new com.apple.fetch fetch_main]
${com.apple.fetch} set init fetch_init target_init ${com.apple.fetch} fetch_init
${com.apple.fetch} provides fetch target_provides ${com.apple.fetch} fetch
${com.apple.fetch} requires main target_requires ${com.apple.fetch} main
${com.apple.fetch} deplist depends_fetch target_prerun ${com.apple.fetch} fetch_start
${com.apple.fetch} set prerun fetch_start


# define options: distname master_sites # define options: distname master_sites
options master_sites patch_sites extract.sufx distfiles patchfiles use_zip use_bzip2 dist_subdir fetch.type cvs.module cvs.root cvs.password cvs.tag options master_sites patch_sites extract.sufx distfiles patchfiles use_zip use_bzip2 dist_subdir fetch.type cvs.module cvs.root cvs.password cvs.tag
Expand Down
11 changes: 5 additions & 6 deletions src/port1.0/portinstall.tcl
Expand Up @@ -33,12 +33,11 @@ package provide portinstall 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.install [target_new com.apple.install install_main] set com.apple.install [target_new com.apple.install install_main]
${com.apple.install} set runtype always target_runtype ${com.apple.install} always
${com.apple.install} provides install target_provides ${com.apple.install} install
${com.apple.install} requires main fetch extract checksum patch configure build target_requires ${com.apple.install} main fetch extract checksum patch configure build
${com.apple.install} deplist depends_run depends_lib target_prerun ${com.apple.install} install_start
${com.apple.install} set prerun install_start target_postrun ${com.apple.install} install_registry
${com.apple.install} set postrun install_registry


# define options # define options
options install.target install.destroot build.target.install options install.target install.destroot build.target.install
Expand Down
2 changes: 1 addition & 1 deletion src/port1.0/portmain.tcl
Expand Up @@ -36,7 +36,7 @@ package provide portmain 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.main [target_new com.apple.main main] set com.apple.main [target_new com.apple.main main]
${com.apple.main} provides main target_provides ${com.apple.main} main


# define options # define options
options prefix name version revision categories maintainers options prefix name version revision categories maintainers
Expand Down
6 changes: 3 additions & 3 deletions src/port1.0/portmpkg.tcl
Expand Up @@ -33,9 +33,9 @@ package provide portmpkg 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.mpkg [target_new com.apple.mpkg mpkg_main] set com.apple.mpkg [target_new com.apple.mpkg mpkg_main]
${com.apple.mpkg} set runtype always target_runtype ${com.apple.mpkg} always
${com.apple.mpkg} provides mpkg target_provides ${com.apple.mpkg} mpkg
${com.apple.mpkg} requires package target_requires ${com.apple.mpkg} package


# define options # define options
options package.type package.destpath options package.type package.destpath
Expand Down
8 changes: 4 additions & 4 deletions src/port1.0/portpackage.tcl
Expand Up @@ -33,9 +33,9 @@ package provide portpackage 1.0
package require portutil 1.0 package require portutil 1.0


set com.apple.package [target_new com.apple.package package_main] set com.apple.package [target_new com.apple.package package_main]
${com.apple.package} set runtype always target_runtype ${com.apple.package} always
${com.apple.package} provides package target_provides ${com.apple.package} package
${com.apple.package} requires install target_requires ${com.apple.package} install


# define options # define options
options package.type package.destpath options package.type package.destpath
Expand Down Expand Up @@ -76,7 +76,7 @@ proc package_pkg {portname portversion} {
file copy -force -- ${portresourcepath}/package/background.tiff ${pkgpath}/Contents/Resources/background.tiff file copy -force -- ${portresourcepath}/package/background.tiff ${pkgpath}/Contents/Resources/background.tiff
system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom" system "mkbom ${destpath} ${pkgpath}/Contents/Archive.bom"
system "cd ${pkgpath}/Contents/Resources/ && ln -fs ../Archive.bom ${portname}-${portversion}.bom" system "cd ${pkgpath}/Contents/Resources/ && ln -fs ../Archive.bom ${portname}-${portversion}.bom"
system "cd ${destpath} && pax -w -z . > ${pkgpath}/Contents/Archive.pax.gz" system "cd ${destpath} && pax -x cpio -w -z . > ${pkgpath}/Contents/Archive.pax.gz"
system "cd ${pkgpath}/Contents/Resources/ && ln -fs ../Archive.pax.gz ${portname}-${portversion}.pax.gz" system "cd ${pkgpath}/Contents/Resources/ && ln -fs ../Archive.pax.gz ${portname}-${portversion}.pax.gz"


write_sizes_file ${pkgpath}/Contents/Resources/${portname}-${portversion}.sizes ${portname} ${portversion} ${pkgpath} ${destpath} write_sizes_file ${pkgpath}/Contents/Resources/${portname}-${portversion}.sizes ${portname} ${portversion} ${pkgpath} ${destpath}
Expand Down

0 comments on commit 6f6cbd0

Please sign in to comment.