[25438] branches/dp2mp-move/base/src/macports1.0/macports.tcl

source_changes at macosforge.org source_changes at macosforge.org
Mon May 21 22:32:32 PDT 2007


Revision: 25438
          http://trac.macosforge.org/projects/macports/changeset/25438
Author:   jmpp at macports.org
Date:     2007-05-21 22:32:32 -0700 (Mon, 21 May 2007)

Log Message:
-----------
Merging eridius' r25142: Adopt the uid/gid of the owner of the svn repo before updating during dportsync for file: sources.

Modified Paths:
--------------
    branches/dp2mp-move/base/src/macports1.0/macports.tcl

Modified: branches/dp2mp-move/base/src/macports1.0/macports.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-05-22 05:27:53 UTC (rev 25437)
+++ branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-05-22 05:32:32 UTC (rev 25438)
@@ -1198,12 +1198,19 @@
 		if {[file exists $portdir/.svn]} {
 		    set svn_commandline "[macports::findBinary svn ${macports::autoconf::svn_path}] update --non-interactive ${portdir}"
 		    ui_debug $svn_commandline
-		    if {[catch {system $svn_commandline}]} {
+		    if {[catch {
+			set euid [geteuid]
+			set egid [getegid]
+			ui_debug "changing euid/egid - current euid: $euid - current egid: $egid"
+			setegid [name_to_gid [file attributes $portdir -group]]
+			seteuid [name_to_uid [file attributes $portdir -owner]]
+			system $svn_commandline
+			seteuid $euid
+			setegid $egid
+		    }]} {
+			ui_debug "$::errorInfo"
 			return -code error "sync failed doing svn update"
 		    }
-		    if {[catch {system "chmod -R a+r \"${portdir}\""}]} {
-			ui_warn "Setting world read permissions on parts of the ports tree failed, need root?"
-		    }
 		}
 	    }
 	    {^mports$} {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070521/96e03f0f/attachment.html


More information about the macports-changes mailing list