wip: rewrite s6-rc-up-tree in an actual procgramming language
and write some tests for it, too
This commit is contained in:
15
pkgs/s6-rc-up-tree/scripts/s6-rc
Executable file
15
pkgs/s6-rc-up-tree/scripts/s6-rc
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
echo s6-rc $@
|
||||
if [ "$1" = "-da" ]; then
|
||||
if [ "$2" = "list" ]; then
|
||||
echo wattle # controlled
|
||||
echo wombat # controlled
|
||||
echo turmeric # uncontrolled
|
||||
fi
|
||||
fi
|
||||
if [ "$1" = "-u" ]; then
|
||||
if [ "$2" = "change" ]; then
|
||||
echo "$3" >> $TEST_LOG
|
||||
fi
|
||||
fi
|
31
pkgs/s6-rc-up-tree/scripts/s6-rc-db
Executable file
31
pkgs/s6-rc-up-tree/scripts/s6-rc-db
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
reverse_deps(){
|
||||
echo $1
|
||||
case "$1" in
|
||||
thyme)
|
||||
echo rosemary
|
||||
;;
|
||||
enables-wan)
|
||||
echo wattle # controlled
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
deps(){
|
||||
echo $1
|
||||
case "$1" in
|
||||
rosemary)
|
||||
echo thyme;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if test "$1" = "-d" && test "$2" = "all-dependencies"; then
|
||||
shift; shift;
|
||||
reverse_deps $@
|
||||
elif test "$1" = "all-dependencies"; then
|
||||
shift;
|
||||
deps $@
|
||||
fi
|
Reference in New Issue
Block a user