Changeset 138062 for trunk/base


Ignore:
Timestamp:
Jun 27, 2015, 8:06:25 AM (5 years ago)
Author:
jmr@…
Message:

only delete the db once at the start when running 'port mirror --new' on multiple ports (#21787)

Location:
trunk/base/src
Files:
2 edited

Legend:

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

    r137850 r138062  
    41584158}
    41594159
     4160
     4161proc action_mirror { action portlist opts } {
     4162    global macports::portdbpath
     4163    # handle --new option here so we only delete the db once
     4164    array set options $opts
     4165    set mirror_filemap_path [file join $macports::portdbpath distfiles_mirror.db]
     4166    if {[info exists options(ports_mirror_new)]
     4167        && [string is true -strict $options(ports_mirror_new)]
     4168        && [file exists $mirror_filemap_path]} {
     4169            # Trash the map file if it existed.
     4170            file delete -force $mirror_filemap_path
     4171    }
     4172
     4173    action_target $action $portlist $opts
     4174}
    41604175
    41614176proc action_exit { action portlist opts } {
     
    42454260    \
    42464261    uninstall   [list action_uninstall      [ACTION_ARGS_PORTS]] \
     4262    \
     4263    mirror      [list action_mirror         [ACTION_ARGS_PORTS]] \
    42474264    \
    42484265    installed   [list action_installed      [ACTION_ARGS_PORTS]] \
     
    42824299    livecheck   [list action_target         [ACTION_ARGS_PORTS]] \
    42834300    distcheck   [list action_target         [ACTION_ARGS_PORTS]] \
    4284     mirror      [list action_target         [ACTION_ARGS_PORTS]] \
    42854301    load        [list action_target         [ACTION_ARGS_PORTS]] \
    42864302    unload      [list action_target         [ACTION_ARGS_PORTS]] \
  • trunk/base/src/port1.0/portmirror.tcl

    r116449 r138062  
    5454
    5555proc portmirror::mirror_main {args} {
    56     global fetch.type mirror_filemap ports_mirror_new portdbpath
     56    global fetch.type mirror_filemap portdbpath
    5757
    5858    set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
    59     if {![info exists mirror_filemap]
    60         && [info exists ports_mirror_new]
    61         && $ports_mirror_new eq "yes"
    62         && [file exists $mirror_filemap_path]} {
    63         # Trash the map file if it existed.
    64         file delete -force $mirror_filemap_path
    65     }
    66 
    6759    filemap open mirror_filemap $mirror_filemap_path
    6860
    6961    # Check the distfiles if it's a regular fetch phase.
    70     if {"${fetch.type}" == "standard"} {
     62    if {${fetch.type} eq "standard"} {
    7163        # fetch the files.
    7264        portfetch::fetch_init $args
     
    7567
    7668        # checksum the files.
    77         #checksum_start
    7869        if {[catch {portchecksum::checksum_main $args}]} {
    7970            # delete the files.
Note: See TracChangeset for help on using the changeset viewer.