New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #27485: gitsync.patch

File gitsync.patch, 1.9 KB (added by andy@…, 2 years ago)
  • base/src/macports1.0/macports.tcl

    diff --git a/base/src/macports1.0/macports.tcl b/base/src/macports1.0/macports.tcl
    index c42e1c4..c38bb3f 100644
    a b proc mportsync {{optionslist {}}} { 
    18961896        switch -regexp -- [macports::getprotocol $source] { 
    18971897            {^file$} { 
    18981898                set portdir [macports::getportdir $source] 
    1899                 if {[file exists $portdir/.svn]} { 
     1899                if {[file exists $portdir/../.git]} { 
     1900                    set git_commandline "cd ${portdir}; [macports::findBinary git] pull" 
     1901                    ui_debug $git_commandline 
     1902                    if { 
     1903                        [catch { 
     1904                            if {[getuid] == 0} { 
     1905                                set euid [geteuid] 
     1906                                set egid [getegid] 
     1907                                ui_debug "changing euid/egid - current euid: $euid - current egid: $egid" 
     1908                                setegid [name_to_gid [file attributes $portdir -group]] 
     1909                                seteuid [name_to_uid [file attributes $portdir -owner]] 
     1910                            } 
     1911                            system $git_commandline 
     1912                            if {[getuid] == 0} { 
     1913                                seteuid $euid 
     1914                                setegid $egid 
     1915                            } 
     1916                        }] 
     1917                    } { 
     1918                        ui_debug "$::errorInfo" 
     1919                        ui_error "Synchronization of the local ports tree failed doing an svn update" 
     1920                        incr numfailed 
     1921                        continue 
     1922                    } 
     1923                } elseif {[file exists $portdir/.svn]} { 
    19001924                    set svn_commandline "[macports::findBinary svn] update --non-interactive ${portdir}" 
    19011925                    ui_debug $svn_commandline 
    19021926                    if {