Ticket #37834: TMPDIR.diff

File TMPDIR.diff, 1.6 KB (added by ryandesign (Ryan Carsten Schmidt), 12 years ago)

proposed patch

  • src/port1.0/portutil.tcl

     
    55# Copyright (c) 2002-2003 Apple Inc.
    66# Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org>
    77# Copyright (c) 2006-2007 Markus W. Weissmann <mww@macports.org>
    8 # Copyright (c) 2004-2012 The MacPorts Project
     8# Copyright (c) 2004-2013 The MacPorts Project
    99# All rights reserved.
    1010#
    1111# Redistribution and use in source and binary forms, with or without
     
    13181318    set procedure [ditem_key $ditem procedure]
    13191319    set savedhome [file join $portdbpath home]
    13201320    set env(HOME) "${workpath}/.home"
     1321    set env(TMPDIR) "${workpath}/.tmp"
    13211322
    13221323    if {[ditem_key $ditem state] != "no"} {
    13231324        set target_state_fd [open_statefile]
     
    15321533    }
    15331534
    15341535    set env(HOME) $savedhome
     1536    if {[info exists env(TMPDIR)]} {
     1537        unset env(TMPDIR)
     1538    }
    15351539
    15361540    return $result
    15371541}
     
    16651669    }
    16661670
    16671671    if {![tbool ports_dryrun]} {
    1668         if {![file isdirectory $workpath]} {
    1669             file mkdir "${workpath}/.home"
     1672        set need_chown 0
     1673        if {![file isdirectory $workpath/.home]} {
     1674            file mkdir $workpath/.home
     1675            set need_chown 1
     1676        }
     1677        if {![file isdirectory $workpath/.tmp]} {
     1678            file mkdir $workpath/.tmp
     1679            set need_chown 1
     1680        }
     1681        if {$need_chown} {
    16701682            chownAsRoot $subbuildpath
    16711683        }
    16721684        # Create a symlink to the workpath for port authors