New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 79444


Ignore:
Timestamp:
06/13/11 08:18:38 (4 years ago)
Author:
jmr@…
Message:

remove flat registry support from images_to_archives.tcl (registry gets converted to sqlite automatically)

File:
1 edited

Legend:

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

    r78144 r79444  
    8080            set targetdir [file join ${macports::registry.path} software ${iname}] 
    8181            file mkdir $targetdir 
    82             if {${macports::registry.format} == "receipt_sqlite"} { 
    83                 set contents [$iref imagefiles] 
    84             } else { 
    85                 set contents {} 
    86                 set rawcontents [registry::property_retrieve $iref contents] 
    87                 foreach entry $rawcontents { 
    88                     lappend contents [lindex $entry 0] 
    89                 } 
    90             } 
     82            set contents [$iref imagefiles] 
    9183        } 
    9284        set newlocation [file join $targetdir $archivename] 
     
    112104        if {$installtype == "direct"} { 
    113105            # change receipt to image 
    114             if {${macports::registry.format} == "receipt_sqlite"} { 
    115                 $iref installtype image 
    116                 $iref state imaged 
    117                 $iref activate [$iref imagefiles] 
    118                 $iref state installed 
    119             } else { 
    120                 registry::property_store $iref installtype image 
    121                 foreach entry $contents { 
    122                     registry::register_file $entry $iname 
    123                 } 
    124                 registry::property_store $iref active 1 
    125             } 
     106            $iref installtype image 
     107            $iref state imaged 
     108            $iref activate [$iref imagefiles] 
     109            $iref state installed 
    126110        } 
    127111 
    128         if {${macports::registry.format} == "flat" && $installtype == "image"} { 
    129             # flat receipts also need file paths in contents trimmed to exclude image dir 
    130             set loclen [string length $location] 
    131             set locend [expr $loclen - 1] 
    132             set oldcontents [registry::property_retrieve $iref contents] 
    133             set newcontents {} 
    134             foreach fe $contents { 
    135                 set oldfilepath [lindex $fe 0] 
    136                 if {[string range $oldfilepath 0 $locend] == $location} { 
    137                     set newfilepath [string range $oldfilepath $loclen end] 
    138                     set newentry [list $newfilepath] 
    139                     foreach other [lrange $fe 1 end] { 
    140                         lappend newentry $other 
    141                     } 
    142                     lappend newcontents $newentry 
    143                 } else { 
    144                     lappend newcontents $fe 
    145                 } 
    146             } 
    147             registry::property_store $iref contents $newcontents 
    148         } 
    149112        # set the new location in the registry and delete the old dir 
    150113        registry::property_store $iref location $newlocation 
    151         if {${macports::registry.format} == "flat"} { 
    152             registry::write_entry $iref 
    153         } 
    154114        if {$location != "" && [file isdirectory $location]} { 
    155115            file delete -force $location 
Note: See TracChangeset for help on using the changeset viewer.