<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/b5b549a35371fc9f179d89e7beeb8ef214988000">https://github.com/macports/macports-base/commit/b5b549a35371fc9f179d89e7beeb8ef214988000</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new b5b549a Remove altprefix support
</span>b5b549a is described below
<span style='display:block; white-space:pre;color:#808000;'>commit b5b549a35371fc9f179d89e7beeb8ef214988000
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Dec 27 19:01:41 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> Remove altprefix support
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> This feature allowed using an alternative $portdbpath under ~/.macports
</span><span style='display:block; white-space:pre;color:#404040;'> when port was running with insufficient privileges to use the normal
</span><span style='display:block; white-space:pre;color:#404040;'> one. This added complexity and didn't really have a good reason for
</span><span style='display:block; white-space:pre;color:#404040;'> existing, except as a way to test that ports didn't bypass the destroot
</span><span style='display:block; white-space:pre;color:#404040;'> (as they would fail to install files directly into $prefix when running
</span><span style='display:block; white-space:pre;color:#404040;'> without privileges). With the addition of sandboxing, this reason went
</span><span style='display:block; white-space:pre;color:#404040;'> away, so now the code can too.
</span>---
src/port1.0/portchecksum.tcl | 14 ++------
src/port1.0/portclean.tcl | 67 ++++---------------------------------
src/port1.0/portextract.tcl | 6 +---
src/port1.0/portfetch.tcl | 10 +-----
src/port1.0/portmain.tcl | 27 ++-------------
src/port1.0/portpatch.tcl | 4 +--
src/port1.0/portsandbox.tcl | 6 ++--
src/port1.0/porttrace.tcl | 2 +-
src/port1.0/portutil.tcl | 27 +--------------
src/port1.0/tests/portchecksum.test | 2 --
src/port1.0/tests/portclean.test | 25 --------------
src/port1.0/tests/portpatch.test | 2 --
src/port1.0/tests/portutil.test | 12 +++----
13 files changed, 24 insertions(+), 180 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portchecksum.tcl b/src/port1.0/portchecksum.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index a89b770..6454afa 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portchecksum.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portchecksum.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -209,7 +209,7 @@ proc portchecksum::checksum_start {args} {
</span> #
proc portchecksum::checksum_main {args} {
global UI_PREFIX all_dist_files checksum_types checksums_array portverbose checksum.skip \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- usealtworkpath altprefix default_checksum_types
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ default_checksum_types
</span>
# If no files have been downloaded, there is nothing to checksum.
if {![info exists all_dist_files]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -243,11 +243,7 @@ proc portchecksum::checksum_main {args} {
</span> # get the full path of the distfile.
set fullpath [file join $distpath $distfile]
if {![file isfile $fullpath]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isfile "${altprefix}${fullpath}"]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set fullpath "${altprefix}${fullpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "$distfile does not exist in $distpath"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "$distfile does not exist in $distpath"
</span> }
# check that there is at least one checksum for the distfile.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -344,11 +340,7 @@ proc portchecksum::checksum_main {args} {
</span> # get the full path of the distfile.
set fullpath [file join $distpath $distfile]
if {![file isfile $fullpath]} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isfile "${altprefix}${fullpath}"]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set fullpath "${altprefix}${fullpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error "$distfile does not exist in $distpath"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "$distfile does not exist in $distpath"
</span> }
foreach type $missing_types {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portclean.tcl b/src/port1.0/portclean.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 1db521e..82cf273 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portclean.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portclean.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -60,20 +60,15 @@ proc portclean::clean_start {args} {
</span>
proc portclean::clean_main {args} {
global UI_PREFIX ports_clean_dist ports_clean_work ports_clean_logs \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ports_clean_archive ports_clean_all keeplogs usealtworkpath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$usealtworkpath} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_warn "Only cleaning in ~/.macports; insufficient privileges for standard locations"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ports_clean_archive ports_clean_all keeplogs
</span>
if {[info exists ports_clean_all] && $ports_clean_all eq "yes" || \
[info exists ports_clean_dist] && $ports_clean_dist eq "yes"} {
ui_info "$UI_PREFIX [format [msgcat::mc "Removing distfiles for %s"] [option subport]]"
clean_dist
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {([info exists ports_clean_all] && $ports_clean_all eq "yes" || \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- [info exists ports_clean_archive] && $ports_clean_archive eq "yes")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- && !$usealtworkpath} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists ports_clean_all] && $ports_clean_all eq "yes" || \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [info exists ports_clean_archive] && $ports_clean_archive eq "yes"} {
</span> ui_info "$UI_PREFIX [format [msgcat::mc "Removing temporary archives for %s"] [option subport]]"
clean_archive
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -85,8 +80,7 @@ proc portclean::clean_main {args} {
</span> ui_info "$UI_PREFIX [format [msgcat::mc "Removing work directory for %s"] [option subport]]"
clean_work
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {(([info exists ports_clean_logs] && $ports_clean_logs eq "yes") || ($keeplogs eq "no"))
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- && !$usealtworkpath} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {([info exists ports_clean_logs] && $ports_clean_logs eq "yes") || ($keeplogs eq "no")} {
</span> clean_logs
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -98,7 +92,7 @@ proc portclean::clean_main {args} {
</span> # This is crude, but works.
#
proc portclean::clean_dist {args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global name ports_force distpath dist_subdir distfiles patchfiles usealtworkpath portdbpath altprefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global name ports_force distpath dist_subdir distfiles patchfiles portdbpath
</span>
# remove known distfiles for sure (if they exist)
set count 0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -114,14 +108,6 @@ proc portclean::clean_dist {args} {
</span> }
incr count
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isfile ${altprefix}${distfile}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Removing file: ${altprefix}${distfile}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {delete ${altprefix}${distfile}} result]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$::errorInfo"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "$result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- incr count
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> }
if {$count > 0} {
ui_debug "$count distfile(s) removed."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -145,14 +131,6 @@ proc portclean::clean_dist {args} {
</span> }
incr count
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isfile ${altprefix}${patchfile}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Removing file: ${altprefix}${patchfile}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {delete ${altprefix}${patchfile}} result]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$::errorInfo"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "$result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- incr count
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> }
if {$count > 0} {
ui_debug "$count patchfile(s) removed."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -178,11 +156,7 @@ proc portclean::clean_dist {args} {
</span> # loop through directories
set count 0
foreach dir $dirlist {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$usealtworkpath} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set distdir [file join ${altprefix}${portdbpath} distfiles $dir]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set distdir [file join ${portdbpath} distfiles $dir]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set distdir [file join ${portdbpath} distfiles $dir]
</span> if {[file isdirectory $distdir]} {
ui_debug "Removing directory: ${distdir}"
if {[catch {delete $distdir} result]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -191,14 +165,6 @@ proc portclean::clean_dist {args} {
</span> }
incr count
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isdirectory ${altprefix}${distdir}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Removing directory: ${altprefix}${distdir}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {delete ${altprefix}${distdir}} result]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$::errorInfo"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "$result"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- incr count
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> }
if {$count > 0} {
ui_debug "$count distfile directory(s) removed."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -209,7 +175,7 @@ proc portclean::clean_dist {args} {
</span> }
proc portclean::clean_work {args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global portbuildpath subbuildpath worksymlink usealtworkpath altprefix portpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global portbuildpath subbuildpath worksymlink portpath
</span>
if {[file isdirectory $subbuildpath]} {
ui_debug "Removing directory: ${subbuildpath}"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -225,30 +191,11 @@ proc portclean::clean_work {args} {
</span> ui_debug "No work directory found to remove at ${subbuildpath}"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isdirectory ${altprefix}${subbuildpath}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Removing directory: ${altprefix}${subbuildpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- try -pass_signal {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- delete ${altprefix}${subbuildpath}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } catch {{*} eCode eMessage} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$::errorInfo"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "$eMessage"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- catch {file delete ${altprefix}${portbuildpath}}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "No work directory found to remove at ${altprefix}${subbuildpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Clean symlink, if necessary
if {![catch {file type $worksymlink} result] && $result eq "link"} {
ui_debug "Removing symlink: $worksymlink"
delete $worksymlink
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # clean port dir in alt prefix
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists "${altprefix}${portpath}"]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "removing ${altprefix}${portpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- delete "${altprefix}${portpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span>
return 0
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portextract.tcl b/src/port1.0/portextract.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 68455cf..f90fb54 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portextract.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portextract.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -120,7 +120,7 @@ proc portextract::extract_start {args} {
</span> }
proc portextract::extract_main {args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global UI_PREFIX filespath worksrcpath extract.dir usealtworkpath altprefix use_dmg
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global UI_PREFIX filespath worksrcpath extract.dir use_dmg
</span>
if {![exists distfiles] && ![exists extract.only]} {
# nothing to do
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -131,8 +131,6 @@ proc portextract::extract_main {args} {
</span> ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile]"
if {[file exists $filespath/$distfile]} {
option extract.args "'$filespath/$distfile'"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {![file exists "[option distpath]/$distfile"] && !$usealtworkpath && [file exists "${altprefix}[option distpath]/$distfile"]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- option extract.args "'${altprefix}[option distpath]/$distfile'"
</span> } else {
option extract.args "'[option distpath]/$distfile'"
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -152,9 +150,7 @@ proc portextract::extract_main {args} {
</span> return -code error "$result"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # start gsoc08-privileges
</span> chownAsRoot ${extract.dir}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # end gsoc08-privileges
</span> }
return 0
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portfetch.tcl b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 0e26435..4a692f9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portfetch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -483,7 +483,7 @@ proc portfetch::hgfetch {args} {
</span> proc portfetch::fetchfiles {args} {
global distpath all_dist_files UI_PREFIX \
fetch.user fetch.password fetch.use_epsv fetch.ignore_sslcert fetch.remote_time \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- portverbose usealtworkpath altprefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ portverbose
</span> variable fetch_urls
variable urlmap
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -516,14 +516,6 @@ proc portfetch::fetchfiles {args} {
</span> if {![file writable $distpath]} {
return -code error [format [msgcat::mc "%s must be writable"] $distpath]
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {!$usealtworkpath && [file isfile ${altprefix}${distpath}/${distfile}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {file link -hard "${distpath}/${distfile}" "${altprefix}${distpath}/${distfile}"}]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "failed to hardlink ${distfile} into distpath, copying instead"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file copy "${altprefix}${distpath}/${distfile}" "${distpath}/${distfile}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_info "Found $distfile in ${altprefix}${distpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- continue
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> if {!$sorted} {
sortsites fetch_urls master_sites
set sorted yes
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portmain.tcl b/src/port1.0/portmain.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index ee4bbd2..96f5202 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portmain.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portmain.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -56,7 +56,7 @@ options prefix name version revision epoch categories maintainers \
</span> supported_archs depends_skip_archcheck installs_libs \
license_noconflict copy_log_files \
compiler.cpath compiler.library_path \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- add_users altprefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ add_users
</span>
# Order of option_proc and option_export matters. Filter before exporting.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -145,33 +145,12 @@ if {[option os.platform] eq "darwin"} {
</span> default compiler.cpath {${prefix}/include}
default compiler.library_path {${prefix}/lib}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# start gsoc08-privileges
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Record initial euid/egid
set euid [geteuid]
set egid [getegid]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# if unable to write to workpath, implies running without either root privileges
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# or a shared directory owned by the group so use ~/.macports
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-default altprefix {[file join $user_home .macports]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-if { $euid != 0 && (([info exists workpath] && [file exists $workpath] && ![file writable $workpath]) || ([info exists portdbpath] && ![file writable [file join $portdbpath build]])) } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # set global variable indicating to other functions to use ~/.macports as well
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default worksymlink {[file normalize [file join ${altprefix}${portpath} work]]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default distpath {[file normalize [file join ${altprefix}${portdbpath} distfiles ${dist_subdir}]]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set portbuildpath "${altprefix}${portbuildpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Going to use alternate build prefix: $altprefix"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "workpath = $workpath"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-} else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default worksymlink {[file normalize [file join $portpath work]]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- default distpath {[file normalize [file join $portdbpath distfiles ${dist_subdir}]]}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# end gsoc08-privileges
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default worksymlink {[file normalize [file join $portpath work]]}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+default distpath {[file normalize [file join $portdbpath distfiles ${dist_subdir}]]}
</span>
proc portmain::main {args} {
return 0
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portpatch.tcl b/src/port1.0/portpatch.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index d5569ff..fe4408e 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portpatch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portpatch.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -68,7 +68,7 @@ proc portpatch::build_getpatchtype {args} {
</span> }
proc portpatch::patch_main {args} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global UI_PREFIX usealtworkpath altprefix
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global UI_PREFIX
</span>
# First make sure that patchfiles exists and isn't stubbed out.
if {![exists patchfiles] || [option patchfiles] eq ""} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -83,8 +83,6 @@ proc portpatch::patch_main {args} {
</span> lappend patchlist [option filespath]/$patch_file
} elseif {[file exists [option distpath]/$patch_file]} {
lappend patchlist [option distpath]/$patch_file
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {!$usealtworkpath && [file exists "${altprefix}[option distpath]/$patch_file"]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend patchlist "${altprefix}[option distpath]/$patch_file"
</span> } else {
return -code error [format [msgcat::mc "Patch file %s is missing"] $patch]
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portsandbox.tcl b/src/port1.0/portsandbox.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 011841b..2c2ac84 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portsandbox.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portsandbox.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -41,7 +41,7 @@ default portsandbox_profile {}
</span> # command line usage would be:
# sandbox-exec -p '(version 1) (allow default) (deny file-write*) (allow file-write* <filter>)' some-command
proc portsandbox::set_profile {target} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global os.major portsandbox_profile workpath distpath prefix altprefix \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global os.major portsandbox_profile workpath distpath prefix \
</span> package.destpath configure.ccache ccache_dir
switch $target {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -75,9 +75,7 @@ proc portsandbox::set_profile {target} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # TODO: remove altprefix support
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend allow_dirs $workpath $altprefix
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- lappend allow_dirs ${portutil::autoconf::trace_sipworkaround_path}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend allow_dirs $workpath ${portutil::autoconf::trace_sipworkaround_path}
</span> if {${configure.ccache}} {
lappend allow_dirs $ccache_dir
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/porttrace.tcl b/src/port1.0/porttrace.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 2264c37..725a47b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/porttrace.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/porttrace.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -122,7 +122,7 @@ namespace eval porttrace {
</span> # @param workpath The $workpath of the current installation
proc trace_start {workpath} {
global \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- altprefix developer_dir distpath env macportsuser os.platform \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ developer_dir distpath env macportsuser os.platform \
</span> portpath prefix
variable fifo
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 454afa5..9873074 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1029,9 +1029,7 @@ proc reinplace {args} {
</span> close $tmpfd
set attributes [file attributes $file]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # start gsoc08-privileges
</span> chownAsRoot $file
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # end gsoc08-privileges
</span>
# We need to overwrite this file
if {[catch {file attributes $file -permissions u+w} error]} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1667,30 +1665,7 @@ proc eval_targets {target} {
</span> # open file to store name of completed targets
proc open_statefile {args} {
global workpath worksymlink place_worksymlink subport portpath ports_ignore_different ports_dryrun \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- usealtworkpath altprefix env applications_dir subbuildpath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$usealtworkpath} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_warn_once "privileges" "MacPorts running without privileges.\
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- You may be unable to complete certain actions (e.g. install)."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set newsourcepath "${altprefix}${portpath}"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # copy Portfile (and patch files) if not there already
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # note to maintainers/devs: the original portfile in /opt/local is ALWAYS the one that will be
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # read by macports. The copying of the portfile is done to preserve the symlink provided
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # historically by macports from the portfile directory to the work directory.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # It is NOT read by MacPorts.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {![file exists ${newsourcepath}/Portfile] && ![tbool ports_dryrun]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file mkdir $newsourcepath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "$newsourcepath created"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Going to copy: ${portpath}/Portfile"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file copy ${portpath}/Portfile $newsourcepath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists ${portpath}/files] } {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_debug "Going to copy: ${portpath}/files"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file copy ${portpath}/files $newsourcepath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ env applications_dir subbuildpath
</span>
if {![tbool ports_dryrun]} {
set need_chown 0
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/tests/portchecksum.test b/src/port1.0/tests/portchecksum.test
</span><span style='display:block; white-space:pre;color:#808080;'>index 1d48e0e..d363e60 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/tests/portchecksum.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/tests/portchecksum.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -121,8 +121,6 @@ test checksum_main {
</span>
set checksum.skip no
set distpath $pwd/dpath
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set altprefix prefix
</span>
file mkdir $distpath
close [open $distpath/file w]
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/tests/portclean.test b/src/port1.0/tests/portclean.test
</span><span style='display:block; white-space:pre;color:#808080;'>index d30bdfc..e96d7e3 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/tests/portclean.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/tests/portclean.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -40,10 +40,8 @@ test clean_start {
</span> test clean_dist {
Clean distfiles unit test.
} -body {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath no
</span> set ports_force yes
set portdbpath $pwd/dbpath
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set altprefix /tmp/altprefix
</span> set dist_subdir subdir
set name subdir_name
set distpath $pwd/distpath
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -57,8 +55,6 @@ test clean_dist {
</span> file mkdir $distpath
close [open $distpath/dist_file w+]
close [open $distpath/dist_file2 w+]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file mkdir $altprefix$distpath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- close [open $altprefix$distpath/dist_file2 w+]
</span> file mkdir $portdbpath/distfiles/$dist_subdir
close [open $portdbpath/distfiles/$dist_subdir/subdir_file w+]
close [open $portdbpath/distfiles/$dist_subdir/subdir_$name w+]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -66,8 +62,6 @@ test clean_dist {
</span> # create patch files
file mkdir $patchpath
close [open $patchpath/patch_file2 w+]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file mkdir $altprefix$patchpath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- close [open $altprefix$patchpath/patch_file2 w+]
</span>
portclean::clean_dist
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -77,15 +71,9 @@ test clean_dist {
</span> if {[file exists $distpath/dist_file2]} {
return "FAIL: distfile not removed"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists $altprefix$distpath/dist_file2]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: alt distfile not removed"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> if {[file exists $patchpath/patch_file2]} {
return "FAIL: patchfile not removed"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists $altprefix$patchpath/patch_file2]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: alt patchfile not removed"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> if {[file exists $portdbpath/distfiles/$dist_subdir]} {
return "FAIL: distfiles dir not removed"
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -96,7 +84,6 @@ test clean_dist {
</span> file delete -force $distpath
file delete -force $portdbpath
file delete -force $patchpath
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete -force $altprefix
</span>
} -result "Clean distfiles successful."
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -106,8 +93,6 @@ test clean_work {
</span> } -constraints {
root
} -body {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath no
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set altprefix $pwd/prefix
</span> set portpath portpath
set subbuildpath /subbuild
set worksymlink $pwd/symlink
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -115,9 +100,6 @@ test clean_work {
</span> # create files
file mkdir $subbuildpath
close [open $subbuildpath/test.work w+]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file mkdir $altprefix/subbuild
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- close [open $altprefix/subbuild/test.work w+]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- close [open $altprefix/$portpath w+]
</span> file link -symbolic $worksymlink $subbuildpath
portclean::clean_work
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -125,21 +107,14 @@ test clean_work {
</span> if {[file exists $subbuildpath]} {
return "FAIL: buildpath not removed"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists $altprefix/subbuild]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: subbuild not removed"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span> if {[file exists $worksymlink]} {
return "FAIL: symlink not removed"
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[file exists $altprefix$portpath]} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "FAIL: port dir in alt prefix not removed"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span>
return "Clean work successful."
} -cleanup {
file delete -force $subbuildpath
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete -force $altprefix
</span> file delete -force $worksymlink
} -result "Clean work successful."
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/tests/portpatch.test b/src/port1.0/tests/portpatch.test
</span><span style='display:block; white-space:pre;color:#808080;'>index 95a6395..9f36813 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/tests/portpatch.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/tests/portpatch.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -40,8 +40,6 @@ test patch_main {
</span> set subport gcc_select
set filespath $pwd/files
set distpath $pwd/dist
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set altprefix prefix
</span>
set workpath $pwd/work
set worksrcpath $workpath/src
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/tests/portutil.test b/src/port1.0/tests/portutil.test
</span><span style='display:block; white-space:pre;color:#808080;'>index fe82531..35d03ac 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/tests/portutil.test
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/tests/portutil.test
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -34,22 +34,18 @@ proc init {} {
</span> }
proc init_eval_targets {} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global os_platform os_version os_arch macosx_version pwd
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- global version mport portpath portbuildpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global os_platform os_version os_arch macosx_version pwd \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ version mport portpath portbuildpath macports::portdbpath
</span>
set os_platform darwin
set macosx_version 10.8
set os_version 11
set os_arch i386
set portpath .
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set portbuildpath ./build
</span>
# vars for target_run
<span style='display:block; white-space:pre;background:#ffe0e0;'>- global portdbpath usealtworkpath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set usealtworkpath no
</span> set portdbpath $pwd/
set workpath $pwd/work
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set altprefix ""
</span>
set mport [mportopen file://.]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -502,14 +498,14 @@ test eval_targets {
</span> return "FAIL: invalid target detected"
}
if {[$workername eval eval_targets checksum] != 0} {
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $::errorInfo
</span> return "FAIL: valid target not detected"
}
return "Eval_targets successful."
} -cleanup {
mportclose $mport
<span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete -force $filespath
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- file delete -force work
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ file delete -force $filespath ${pwd}/build ${pwd}/distfiles
</span>
} -result "Eval_targets successful."
</pre><pre style='margin:0'>
</pre>