Ticket #7891: darwinports.tcl-patch

File darwinports.tcl-patch, 1.2 KB (added by danielluke (Daniel J. Luke), 18 years ago)

Make port upgrade use archive target instead of destroot

Line 
1Index: darwinports.tcl
2===================================================================
3RCS file: /Volumes/src/cvs/od/proj/darwinports/base/src/darwinports1.0/darwinports.tcl,v
4retrieving revision 1.209
5diff -u -r1.209 darwinports.tcl
6--- darwinports.tcl     19 Mar 2006 17:25:08 -0000      1.209
7+++ darwinports.tcl     21 Mar 2006 15:36:17 -0000
8@@ -1436,7 +1436,8 @@
9 
10 # upgrade procedure
11 proc darwinports::upgrade {portname dspec variationslist optionslist {depscachename ""}} {
12-    global darwinports::registry.installtype
13+       global darwinports::registry.installtype
14+       global darwinports::portarchivemode
15        array set options $optionslist
16        array set variations $variationslist
17        if {![string match "" $depscachename]} {
18@@ -1659,7 +1660,13 @@
19        }
20 
21        # install version_in_tree
22-       if {[catch {set result [dportexec $workername destroot]} result] || $result != 0} {
23+       if {0 == [string compare "yes" ${darwinports::portarchivemode}]} {
24+               set upgrade_action "archive"
25+       } else {
26+               set upgrade_action "destroot"
27+       }
28+
29+       if {[catch {set result [dportexec $workername $upgrade_action]} result] || $result != 0} {
30                global errorInfo
31                ui_debug "$errorInfo"
32                ui_error "Unable to upgrade port: $result"