Changeset 11174


Ignore:
Timestamp:
Mar 2, 2005, 3:07:11 PM (15 years ago)
Author:
pguyot (Paul Guyot)
Message:

Read/only support for filemap database.
Basically, the filemap database is open read/only until a r/w operation is
required.

One can do, simultaneously:
first: sudo port installed
second (while port installed is still running), sudo port deactivate foo

foo port will be marked unactive by the second process while the first process
will say it is active (since it got an earlier copy of the database).

Previously, such an operation required the first process to unlock the database,
the second process being stopped.

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/registry1.0/receipt_flat.tcl

    r11171 r11174  
    11# receipt_flat.tcl
    2 # $Id: receipt_flat.tcl,v 1.9 2005/03/02 14:56:50 pguyot Exp $
     2# $Id: receipt_flat.tcl,v 1.10 2005/03/02 15:07:11 pguyot Exp $
    33#
    44# Copyright (c) 2004 Will Barton <wbb4@opendarwin.org>
     
    547547                }
    548548        }
     549       
     550        return 0
    549551}
    550552
     
    560562        variable file_map
    561563
    562         if { ![info exists file_map] } {
    563                 open_file_map
    564         }
     564        open_file_map 1
    565565
    566566        if {[filemap exists file_map $file]} {
     
    584584        variable file_map
    585585
    586         if { ![info exists file_map] } {
    587                 open_file_map
    588         }
     586        open_file_map 1
    589587
    590588        set files [filemap list file_map $name]
     
    618616        variable file_map
    619617
    620         if { ![info exists file_map] } {
    621                 open_file_map
    622         }
     618        open_file_map
    623619
    624620        if { [file type $file] == "link" } {
     
    640636        variable file_map
    641637
    642         if { ![info exists file_map] } {
    643                 open_file_map
    644         }
     638        open_file_map
    645639
    646640        foreach f $files {
     
    664658        variable file_map
    665659
    666         if { ![info exists file_map] } {
    667                 open_file_map
    668         }
     660        open_file_map
    669661
    670662        ui_debug "Removing entry from file_map: $file"
     
    682674
    683675        if { [info exists file_map] } {
     676                open_file_map
    684677                filemap save file_map
    685678        }
Note: See TracChangeset for help on using the changeset viewer.