test/init.sh: handle broken dir symlinks
This commit is contained in:
parent
56327412ca
commit
d0874f9a2d
3 changed files with 13 additions and 6 deletions
|
|
@ -1 +1 @@
|
|||
3.2.dev7
|
||||
3.2.dev8
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
test.cmdtest_py_d.cfg: configuration data for cmdtest.py
|
||||
"""
|
||||
|
||||
import os
|
||||
cmd_groups_altcoin = []
|
||||
|
||||
cmd_groups_dfl = {
|
||||
'main': ('CmdTestMain',{}),
|
||||
|
|
@ -29,4 +29,5 @@ cfgs = {
|
|||
'3': {}, # main
|
||||
}
|
||||
|
||||
def fixup_cfgs(): pass
|
||||
def fixup_cfgs():
|
||||
pass
|
||||
|
|
|
|||
12
test/init.sh
12
test/init.sh
|
|
@ -47,9 +47,15 @@ build_mmgen_extmod() {
|
|||
create_dir_links() {
|
||||
for link_name in 'mmgen' 'scripts'; do
|
||||
target="$wallet_repo/$link_name"
|
||||
if [ -e $link_name ]; then
|
||||
[ $(realpath --relative-to=. $link_name) == $target ] || die "'$link_name' does not point to '$target'"
|
||||
else
|
||||
if [ -L $link_name ]; then
|
||||
[ "$(realpath --relative-to=. $link_name 2>/dev/null)" == $target ] || {
|
||||
echo "Removing broken symlink '$link_name'"
|
||||
rm $link_name
|
||||
}
|
||||
elif [ -e $link_name ]; then
|
||||
die "'$link_name' is not a symbolic link. Please remove or relocate it and re-run this script"
|
||||
fi
|
||||
if [ ! -e $link_name ]; then
|
||||
echo "Creating symlink: $link_name"
|
||||
ln -s $target
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue