Skip to content

Commit 9223803

Browse files
committed
portutil: put internal variables in a namespace
Deleted target_uniqid since it doesn't seem to be used.
1 parent 5297f1c commit 9223803

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/port1.0/portlint.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ proc portlint::lint_main {args} {
524524

525525
###################################################################
526526

527-
global porturl all_variants patchfiles \
527+
global porturl portutil::all_variants patchfiles \
528528
depends_fetch depends_extract depends_patch \
529529
depends_lib depends_build depends_run \
530530
depends_test distfiles fetch.type lint_portsystem \

src/port1.0/portutil.tcl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ package require macports_util 1.0
3838
package require msgcat
3939
package require porttrace 1.0
4040

41-
set targets [list]
42-
set target_uniqid 0
43-
44-
set all_variants [list]
41+
namespace eval portutil {
42+
variable targets [list]
43+
variable all_variants [list]
44+
}
4545

4646
########### External High Level Procedures ###########
4747

@@ -664,7 +664,7 @@ proc variant {args} {
664664
}
665665

666666
# Finally append the ditem to the dlist.
667-
global all_variants
667+
global portutil::all_variants
668668
lappend all_variants $ditem
669669
}
670670

@@ -688,7 +688,7 @@ proc variant_set {name} {
688688
# variant_remove_ditem name
689689
# Remove variant name's ditem from the all_variants dlist
690690
proc variant_remove_ditem {name} {
691-
global all_variants
691+
global portutil::all_variants
692692
set item_index 0
693693
foreach variant_item $all_variants {
694694
set item_provides [ditem_key $variant_item provides]
@@ -1656,7 +1656,7 @@ proc recursive_collect_deps {portname {depsfound {}}} \
16561656

16571657

16581658
proc eval_targets {target} {
1659-
global targets subport version revision portvariants
1659+
global portutil::targets subport version revision portvariants
16601660
set dlist $targets
16611661

16621662
# the statefile will likely be autocleaned away after install,
@@ -2034,7 +2034,7 @@ proc canonicalize_variants {variants {sign "+"}} {
20342034
}
20352035

20362036
proc eval_variants {variations} {
2037-
global PortInfo all_variants subport
2037+
global PortInfo portutil::all_variants subport
20382038
set dlist $all_variants
20392039
upvar $variations upvariations
20402040
lassign [choose_variants $dlist upvariations] chosen negated
@@ -2121,7 +2121,7 @@ proc eval_variants {variations} {
21212121
}
21222122

21232123
proc check_variants {target} {
2124-
global targets ports_force ports_dryrun PortInfo
2124+
global portutil::targets ports_force ports_dryrun PortInfo
21252125
set result 0
21262126
set variations $PortInfo(active_variants)
21272127

@@ -2197,7 +2197,7 @@ proc universal_setup {args} {
21972197

21982198
# constructor for target object
21992199
proc target_new {name procedure} {
2200-
global targets
2200+
global portutil::targets
22012201
set ditem [ditem_create]
22022202

22032203
ditem_key $ditem name $name

0 commit comments

Comments
 (0)