You've already forked macports-base
mirror of
https://github.com/macports/macports-base.git
synced 2026-07-12 18:18:43 -07:00
Remove lpush
It's just a trivial alias for lappend.
This commit is contained in:
@@ -140,15 +140,6 @@ proc ldindex {varName args} {
|
||||
return $item
|
||||
}
|
||||
|
||||
# lpush varName ?value ...?
|
||||
# Appends list elements onto a variable
|
||||
# If varName does not exist then it is created
|
||||
# really just an alias for lappend
|
||||
proc lpush {varName args} {
|
||||
upvar 1 $varName var
|
||||
lappend var {*}$args
|
||||
}
|
||||
|
||||
|
||||
# lunshift varName ?value ...?
|
||||
# Prepends list elements onto a variable
|
||||
|
||||
@@ -80,23 +80,6 @@ test ldindex {
|
||||
} -result "ldindex successful."
|
||||
|
||||
|
||||
test lpush {
|
||||
Lpush unit test.
|
||||
} -body {
|
||||
set list {0 1}
|
||||
if {[lpush list 2] != {0 1 2}} {
|
||||
return "FAIL: element not appended"
|
||||
}
|
||||
if {[lpush list 3 4] != {0 1 2 3 4}} {
|
||||
return "FAIL: multiple elements not appended"
|
||||
}
|
||||
if {[lpush list1 0] != 0} {
|
||||
return "FAIL: list not created"
|
||||
}
|
||||
return "lpop successful."
|
||||
} -result "lpop successful."
|
||||
|
||||
|
||||
test lunshift {
|
||||
Lunshift unit test.
|
||||
} -body {
|
||||
|
||||
@@ -385,7 +385,7 @@ proc portdestroot::destroot_finish {args} {
|
||||
}
|
||||
} elseif {[string equal -length [expr {[string length $dfile] + 1}] $dfile/ $prefix]} {
|
||||
# we've found a subpath of our prefix
|
||||
lpush pathsToCheck $dfile
|
||||
lappend pathsToCheck $dfile
|
||||
} else {
|
||||
set dir_allowed no
|
||||
# these files are (at least potentially) outside of the prefix
|
||||
@@ -397,7 +397,7 @@ proc portdestroot::destroot_finish {args} {
|
||||
}
|
||||
}
|
||||
if {$dir_allowed} {
|
||||
lpush pathsToCheck $dfile
|
||||
lappend pathsToCheck $dfile
|
||||
} else {
|
||||
# not a prefix of an allowed path, so it's either the path itself or a violation
|
||||
switch -- $dfile \
|
||||
|
||||
Reference in New Issue
Block a user