Changeset 54364


Ignore:
Timestamp:
Jul 25, 2009, 2:06:37 PM (10 years ago)
Author:
raimue@…
Message:

upgrade_sources_conf_default.tcl:
Error out if svn can not be executed. Add an exception if the svn client is too
old for the working copy (as this is common but not a real error) and print a
warning in this case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/upgrade_sources_conf_default.tcl

    r53280 r54364  
    4242            set addDefault true
    4343         } elseif {[regexp {file://(/.+)} $url -> filepath]} {
    44             if {[file exists [file join ${filepath} .svn]] && ![catch {set svnChannel [open "|svn info ${filepath}" r]}]} {
    45                set svnURL {}
    46                while {[gets $svnChannel svnLine] >= 0} {
    47                   regexp {^URL: (.*)} $svnLine -> svnURL
    48                }
    49                close $svnChannel
    50                if {[regexp {^https?://svn\.(macports|macosforge)\.org/repository/macports/trunk/dports} $svnURL]} {
    51                   set addDefault true
     44            if {[file exists [file join ${filepath} .svn]]} {
     45               if {![catch {set svnChannel [open "|svn info ${filepath}" r]} err]} {
     46                  set svnURL {}
     47                  while {[gets $svnChannel svnLine] >= 0} {
     48                     regexp {^URL: (.*)} $svnLine -> svnURL
     49                  }
     50                  if {[catch {close $svnChannel} err]} {
     51                     if {![string match "*This client is too old to work with working copy*" $err]} {
     52                        return -code error $err
     53                     } else {
     54                        puts $err
     55                        puts "WARNING: Unable to check svn URL for '$filepath' as it has been checked out with a newer Subversion client; please manually verify $sourcesConf!"
     56                     }
     57                  }
     58                  if {[regexp {^https?://svn\.(macports|macosforge)\.org/repository/macports/trunk/dports} $svnURL]} {
     59                     set addDefault true
     60                  }
     61               } else {
     62                  return -code error $err
    5263               }
    5364            }
Note: See TracChangeset for help on using the changeset viewer.