Changeset 69756


Ignore:
Timestamp:
Jul 15, 2010, 7:50:00 PM (7 years ago)
Author:
and.damore@…
Message:

skipping config files in deactivate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc10-configfiles/base/src/registry2.0/portimage.tcl

    r69731 r69756  
    9292    set todeactivate [list]
    9393
     94    # before activating new image we handle deactivation of old version
    9495    if {$use_reg2} {
    9596        registry::read {
     
    162163    }
    163164
     165    #eventually print variants
    164166    if {$v != ""} {
    165167        ui_msg "$UI_PREFIX [format [msgcat::mc "Activating %s @%s"] $name $v]"
     
    168170    }
    169171
     172    #activate new image
    170173    if {$use_reg2} {
    171174        _activate_contents $requested
     
    214217    }
    215218
     219    #branch on sqlite-registry-db or old–flatfile
    216220    if {$use_reg2} {
    217221        if { [string equal $name ""] } {
     
    255259    }
    256260
     261    #here we go -
    257262    if {$use_reg2} {
    258263        if { ![string equal [$requested installtype] "image"] } {
     
    454459
    455460                    set owner [registry::entry owner $file]
    456                     ui_msg "GSOC: $file owner is \"$owner\""
    457461
    458462                    if {$owner != {} && $owner != $port} {
     
    461465                        array unset portinfo
    462466                        array set portinfo [lindex $result 1]
    463                         #GSoC10
    464467                        #here we'll check if you should replace a config file testing a --drop-config option from CLI
    465468                        if {[info exists portinfo(replaced_by)] && [lsearch -regexp $portinfo(replaced_by) "(?i)^[$port name]\$"] != -1} {
     
    530533            set files [lsort -increasing -unique $files]
    531534            set rollback_filelist {}
    532             ui_msg "GSOC DBG: let's activate actual files"
    533535            registry::write {
    534536                # Activate it, and catch errors so we can roll-back
     
    548550            }
    549551        } catch {*} {
    550             ui_msg "GSOC DBG: rollback"
    551552            # roll back activation of this port
    552553            if {[info exists deactivate_this]} {
     
    675676        }
    676677    }
    677     ui_msg "GSOC DBG: end of _activate_contents"
    678678}
    679679
     
    701701
    702702    foreach file $imagefiles {
     703        #GSOC10 we should avoid adding file to $files and instead handle them putting into a separate registry table 
    703704        if { [file exists $file] || (![catch {file type $file}] && [file type $file] == "link") } {
    704705            # Normalize the file path to avoid removing the intermediate
     
    736737            $port deactivate $imagefiles
    737738            foreach file $files {
     739                  if {[is_config_file $file]} {
     740                          puts "GSOC: $file is config file, skipping for now"
     741                          continue
     742                      }                 
    738743                _deactivate_file $file
    739744            }
     
    746751}
    747752
    748 proc gsocdebug {command-string op} {puts "GSOCBDBG: ${command-string}" }
    749 #the following 2 traces breaks macports at activate/deactivate phase, let's keep them commented
    750 #trace add execution ::portimage::activate enter gsocdebug
    751 #trace add execution ::portimage::deactivate enter gsocdebug
    752 trace add execution ::portimage::_check_registry enter gsocdebug
    753 trace add execution ::portimage::_check_contents enter gsocdebug
    754 trace add execution ::portimage::_activate_file enter gsocdebug
    755 trace add execution ::portimage::_activate_contents enter gsocdebug
    756 trace add execution ::portimage::_deactivate_file enter gsocdebug
    757 trace add execution ::portimage::_deactivate_contents enter gsocdebug
     753#proc gsocdebug {command-string op} {puts "GSOCDBG: ${command-string}" }
     754#trace add execution ::portimage::_check_registry enter gsocdebug
     755#trace add execution ::portimage::_check_contents enter gsocdebug
     756#trace add execution ::portimage::_activate_file enter gsocdebug
     757#trace add execution ::portimage::_activate_contents enter gsocdebug
     758#trace add execution ::portimage::_deactivate_file enter gsocdebug
     759#trace add execution ::portimage::_deactivate_contents enter gsocdebug
     760
     761
     762proc is_config_file {filename} {
     763    #replace hardcoded path with $config_path from portmain.tcl, what namespace does "option" add options to?
     764    if {[string match ${::macports::prefix} "$filename"]} {return 1} {return 0}
     765}
     766
    758767# End of portimage namespace
    759768}
Note: See TracChangeset for help on using the changeset viewer.