[138062] trunk/base/src
jmr at macports.org
jmr at macports.org
Sat Jun 27 01:06:25 PDT 2015
Revision: 138062
https://trac.macports.org/changeset/138062
Author: jmr at macports.org
Date: 2015-06-27 01:06:25 -0700 (Sat, 27 Jun 2015)
Log Message:
-----------
only delete the db once at the start when running 'port mirror --new' on multiple ports (#21787)
Modified Paths:
--------------
trunk/base/src/port/port.tcl
trunk/base/src/port1.0/portmirror.tcl
Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl 2015-06-27 07:44:48 UTC (rev 138061)
+++ trunk/base/src/port/port.tcl 2015-06-27 08:06:25 UTC (rev 138062)
@@ -4158,6 +4158,21 @@
}
+proc action_mirror { action portlist opts } {
+ global macports::portdbpath
+ # handle --new option here so we only delete the db once
+ array set options $opts
+ set mirror_filemap_path [file join $macports::portdbpath distfiles_mirror.db]
+ if {[info exists options(ports_mirror_new)]
+ && [string is true -strict $options(ports_mirror_new)]
+ && [file exists $mirror_filemap_path]} {
+ # Trash the map file if it existed.
+ file delete -force $mirror_filemap_path
+ }
+
+ action_target $action $portlist $opts
+}
+
proc action_exit { action portlist opts } {
# Return a semaphore telling the main loop to quit
return -999
@@ -4245,6 +4260,8 @@
\
uninstall [list action_uninstall [ACTION_ARGS_PORTS]] \
\
+ mirror [list action_mirror [ACTION_ARGS_PORTS]] \
+ \
installed [list action_installed [ACTION_ARGS_PORTS]] \
outdated [list action_outdated [ACTION_ARGS_PORTS]] \
contents [list action_contents [ACTION_ARGS_PORTS]] \
@@ -4281,7 +4298,6 @@
lint [list action_target [ACTION_ARGS_PORTS]] \
livecheck [list action_target [ACTION_ARGS_PORTS]] \
distcheck [list action_target [ACTION_ARGS_PORTS]] \
- mirror [list action_target [ACTION_ARGS_PORTS]] \
load [list action_target [ACTION_ARGS_PORTS]] \
unload [list action_target [ACTION_ARGS_PORTS]] \
reload [list action_target [ACTION_ARGS_PORTS]] \
Modified: trunk/base/src/port1.0/portmirror.tcl
===================================================================
--- trunk/base/src/port1.0/portmirror.tcl 2015-06-27 07:44:48 UTC (rev 138061)
+++ trunk/base/src/port1.0/portmirror.tcl 2015-06-27 08:06:25 UTC (rev 138062)
@@ -53,28 +53,19 @@
# It also records the path in a database.
proc portmirror::mirror_main {args} {
- global fetch.type mirror_filemap ports_mirror_new portdbpath
+ global fetch.type mirror_filemap portdbpath
set mirror_filemap_path [file join $portdbpath distfiles_mirror.db]
- if {![info exists mirror_filemap]
- && [info exists ports_mirror_new]
- && $ports_mirror_new eq "yes"
- && [file exists $mirror_filemap_path]} {
- # Trash the map file if it existed.
- file delete -force $mirror_filemap_path
- }
-
filemap open mirror_filemap $mirror_filemap_path
# Check the distfiles if it's a regular fetch phase.
- if {"${fetch.type}" == "standard"} {
+ if {${fetch.type} eq "standard"} {
# fetch the files.
portfetch::fetch_init $args
portfetch::fetch_start $args
portfetch::fetch_main $args
# checksum the files.
- #checksum_start
if {[catch {portchecksum::checksum_main $args}]} {
# delete the files.
portfetch::fetch_deletefiles $args
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150627/f5c7ace5/attachment.html>
More information about the macports-changes
mailing list