diff --git a/base/src/macports1.0/macports.tcl b/base/src/macports1.0/macports.tcl
index 563477f..7cac8ac 100644
a
|
b
|
proc mportsync {{optionslist {}}} { |
1942 | 1942 | switch -regexp -- [macports::getprotocol $source] { |
1943 | 1943 | {^file$} { |
1944 | 1944 | set portdir [macports::getportdir $source] |
1945 | | if {[file exists $portdir/.svn]} { |
| 1945 | |
| 1946 | if {![catch {macports::findBinary git} result] && |
| 1947 | ![catch {exec sh -c "cd ${portdir} && [macports::findBinary git] rev-parse --is-inside-work-tree"} result]} { |
| 1948 | # determine what type of git repository this is |
| 1949 | if {![catch {exec sh -c "cd ${portdir} && [macports::findBinary git] config --local --get svn-remote.svn.url"} result]} { |
| 1950 | set git_commandline "cd ${portdir}; [macports::findBinary git] stash save; [macports::findBinary git] svn rebase; [macports::findBinary git] stash pop" |
| 1951 | } else { |
| 1952 | set git_commandline "cd ${portdir}; [macports::findBinary git] pull" |
| 1953 | } |
| 1954 | ui_debug $git_commandline |
| 1955 | if { |
| 1956 | [catch { |
| 1957 | if {[getuid] == 0} { |
| 1958 | set euid [geteuid] |
| 1959 | set egid [getegid] |
| 1960 | ui_debug "changing euid/egid - current euid: $euid - current egid: $egid" |
| 1961 | setegid [name_to_gid [file attributes $portdir -group]] |
| 1962 | seteuid [name_to_uid [file attributes $portdir -owner]] |
| 1963 | } |
| 1964 | system $git_commandline |
| 1965 | if {[getuid] == 0} { |
| 1966 | seteuid $euid |
| 1967 | setegid $egid |
| 1968 | } |
| 1969 | }] |
| 1970 | } { |
| 1971 | ui_debug "$::errorInfo" |
| 1972 | ui_error "Synchronization of the local ports tree failed doing a git update" |
| 1973 | incr numfailed |
| 1974 | continue |
| 1975 | } |
| 1976 | } elseif {[file exists $portdir/.svn]} { |
1946 | 1977 | set svn_commandline "[macports::findBinary svn] update --non-interactive ${portdir}" |
1947 | 1978 | ui_debug $svn_commandline |
1948 | 1979 | if { |