(minor) bashism fixes, usability fix, for "able" adc
This commit is contained in:
parent
9a49487d0a
commit
bdef55eee9
|
@ -1,6 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
# WARNING: USES BASH FEATURES TO AVOID A TEMP FILE; CAN BE FIXED IF NEEDED
|
||||
#!/bin/sh
|
||||
|
||||
. $(dirname $0)/adc.common-functions
|
||||
|
||||
|
@ -26,7 +24,7 @@ do
|
|||
shift
|
||||
done
|
||||
|
||||
[[ -z "$locs" ]] && die "give me '@all' or some reponame"
|
||||
[ -z "$locs" ] && die "give me '@all' or some reponame"
|
||||
|
||||
case $op in
|
||||
en|enable )
|
||||
|
@ -36,14 +34,20 @@ case $op in
|
|||
done
|
||||
;;
|
||||
dis|disable )
|
||||
# bashism
|
||||
read msg <<<$(cat)
|
||||
|
||||
TEMPDIR=$(mktemp -d -t tmp.XXXXXXXXXX)
|
||||
export TEMPDIR
|
||||
trap "/bin/rm -rf $TEMPDIR" 0
|
||||
|
||||
echo 'type the message to be shown to users when they try to push; end with Ctrl-D:'
|
||||
echo > $TEMPDIR/msg
|
||||
cat >> $TEMPDIR/msg
|
||||
echo disabling following locations with message:
|
||||
echo $msg
|
||||
cat $TEMPDIR/msg
|
||||
echo
|
||||
for l in $locs
|
||||
do
|
||||
echo $msg > $l/.gitolite.down
|
||||
cat $TEMPDIR/msg > $l/.gitolite.down
|
||||
echo $l
|
||||
done
|
||||
;;
|
||||
|
|
|
@ -57,7 +57,8 @@ do
|
|||
expect "give me '@all' or some reponame"
|
||||
(echo first line; echo second line) | runlocal ssh gitolite able dis @all
|
||||
expect "disabling following locations with message:"
|
||||
expect "first line second line"
|
||||
expect "first line"
|
||||
expect "^second line"
|
||||
expect "/home/gitolite-test"
|
||||
runremote ls -al .gitolite.down
|
||||
expect "^.rw------- 1 gitolite-test gitolite-test .. ... .. ..:.. .gitolite.down"
|
||||
|
@ -67,7 +68,8 @@ do
|
|||
mdc; mdc
|
||||
runlocal git push origin master
|
||||
expect ABORTING
|
||||
expect "first line second line"
|
||||
expect "first line"
|
||||
expect "^second line"
|
||||
expect "fatal: The remote end hung up unexpectedly"
|
||||
|
||||
name "u2 create and push bar/u2/r1 fail"
|
||||
|
@ -75,7 +77,8 @@ do
|
|||
mdc; mdc
|
||||
runlocal git push origin master
|
||||
expect ABORTING
|
||||
expect "first line second line"
|
||||
expect "first line"
|
||||
expect "^second line"
|
||||
expect "fatal: The remote end hung up unexpectedly"
|
||||
|
||||
name "enable entire site"
|
||||
|
@ -106,7 +109,7 @@ do
|
|||
expect "foo down"
|
||||
expect "/home/gitolite-test/repositories/foo.git"
|
||||
runremote ls -al /home/gitolite-test/repositories/foo.git/.gitolite.down
|
||||
expect ".rw------- 1 gitolite-test gitolite-test . ... .. ..:.. /home/gitolite-test/repositories/foo.git/.gitolite.down"
|
||||
expect ".rw------- 1 gitolite-test gitolite-test .* ..:.. /home/gitolite-test/repositories/foo.git/.gitolite.down"
|
||||
|
||||
name "u1 push foo fail"
|
||||
cd ~/td/foo
|
||||
|
|
Loading…
Reference in a new issue