Skip to content
Permalink
Browse files

Merging 3 days of diffs last good backup:

  - 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
Kevin Van Vechten committed Mar 1, 2003
1 parent 8b97cce commit 6f6cbd02ffc4331200eef3bde75870f2cebd41a4
@@ -33,10 +33,9 @@ package provide portbuild 1.0
package require portutil 1.0

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

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


set UI_PREFIX "---> "

proc build_getmaketype {args} {
global build.type build.cmd os.platform

if ![info exists build.type] {
if {![exists build.type]} {
return make
}
switch -exact -- ${build.type} {
switch -exact -- [option build.type] {
bsd {
if {${os.platform} == "darwin"} {
if {[option os.platform] == "darwin"} {
return bsdmake
} else {
return make
}
}
gnu {
if {${os.platform} == "darwin"} {
if {[option os.platform] == "darwin"} {
return gnumake
} else {
return gmake
@@ -76,16 +72,16 @@ proc build_getmaketype {args} {
return pbxbuild
}
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
}
}
}

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} {
@@ -33,9 +33,9 @@ package provide portchecksum 1.0
package require portutil 1.0

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

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

proc dmd5 {file} {
global checksums

foreach {name type sum} $checksums {
foreach {name type sum} [option checksums] {
if {$name == $file} {
return $sum
}
@@ -81,14 +79,14 @@ proc checksum_start {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 ![info exists all_dist_files] {
return 0
}

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

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

foreach distfile $all_dist_files {
@@ -35,19 +35,20 @@ package provide portclean 1.0
package require portutil 1.0

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

set UI_PREFIX "--->"

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} {
global workpath
exec rm -rf [file join ${workpath}]
exec rm -rf [file join [option workpath]]
return 0
}
@@ -33,10 +33,9 @@ package provide portconfigure 1.0
package require portutil 1.0

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

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

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} {
@@ -33,9 +33,9 @@ package provide portcontents 1.0
package require portutil 1.0

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

set UI_PREFIX "---> "

@@ -36,43 +36,30 @@ package provide portdepends 1.0
package require portutil 1.0

# define options
options depends_fetch depends_build depends_run depends_extract depends_lib
options depends_build depends_run depends_lib
# 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 handle_depends_options
option_proc depends_run handle_depends_options
option_proc depends_extract handle_depends_options
option_proc depends_lib handle_depends_options
option_proc depends_build validate_depends_options
option_proc depends_run validate_depends_options
option_proc depends_lib validate_depends_options

proc handle_depends_options {option action args} {
proc validate_depends_options {option action args} {
global targets
switch -regex $action {
set|append {
set|append|delete {
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} {
switch $deppath {
lib { set obj [libportfile_new $portname $depregex] }
bin { set obj [binportfile_new $portname $depregex] }
path { set obj [pathportfile_new $portname $depregex] }
}
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]
lib {}
bin {}
path {}
default {return -code error [format [msgcat::mc "unknown depspec type: %s"] $deppath]}
}
} else {
return -code error [format [msgcat::mc "invalid depspec: %s"] $depspec]
}
}
}
delete {
# xxx: need to delete requirement from each item in the deplist
}
}
}
@@ -33,11 +33,10 @@ package provide portextract 1.0
package require portutil 1.0

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

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

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

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} {
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
return 0
}

foreach distfile ${extract.only} {
foreach distfile [option extract.only] {
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] {
return -code error "$result"
}
@@ -33,11 +33,10 @@ package provide portfetch 1.0
package require portutil 1.0

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

# 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
@@ -33,12 +33,11 @@ package provide portinstall 1.0
package require portutil 1.0

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

# define options
options install.target install.destroot build.target.install
@@ -36,7 +36,7 @@ package provide portmain 1.0
package require portutil 1.0

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

# define options
options prefix name version revision categories maintainers
@@ -33,9 +33,9 @@ package provide portmpkg 1.0
package require portutil 1.0

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

# define options
options package.type package.destpath
@@ -33,9 +33,9 @@ package provide portpackage 1.0
package require portutil 1.0

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

# define options
options package.type package.destpath
@@ -76,7 +76,7 @@ proc package_pkg {portname portversion} {
file copy -force -- ${portresourcepath}/package/background.tiff ${pkgpath}/Contents/Resources/background.tiff
system "mkbom ${destpath} ${pkgpath}/Contents/Archive.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"

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

0 comments on commit 6f6cbd0

Please sign in to comment.
You can’t perform that action at this time.