t8001/t8002: blame: demonstrate acceptance of bogus -LX,+0 and -LX,-0

Empty ranges -LX,+0 and -LX,-0 are nonsensical in the context of blame
yet they are accepted. They should be errors. Demonstrate this
shortcoming.

Signed-off-by: Eric Sunshine <8d6e34f987851aa599257d3831a1af040886842f@sunshineco.com>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

# This file isn't used as a test script directly, instead it is
# sourced from t8001-annotate.sh and t8002-blame.sh.

check_count () {
	head= &&
	file='file' &&
	options= &&
	while :
	do
		case "$1" in
		-h) head="$2"; shift; shift ;;
		-f) file="$2"; shift; shift ;;
		-*) options="$options $1"; shift ;;
		*) break ;;
		esac
	done &&
	echo "$PROG $options $file $head" >&4 &&
	$PROG $options $file $head >actual &&
	perl -e '
		my %expect = (@ARGV);
		my %count = map { $_ => 0 } keys %expect;
		while (<STDIN>) {
			if (/^[0-9a-f]+\t\(([^\t]+)\t/) {
				my $author = $1;
				for ($author) { s/^\s*//; s/\s*$//; }
				$count{$author}++;
			}
		}
		my $bad = 0;
		while (my ($author, $count) = each %count) {
			my $ok;
			my $value = 0;
			$value = $expect{$author} if defined $expect{$author};
			if ($value != $count) {
				$bad = 1;
				$ok = "bad";
			}
			else {
				$ok = "good";
			}
			print STDERR "Author $author (expected $value, attributed $count) $ok\n";
		}
		exit($bad);
	' "$@" <actual
}

test_expect_success 'setup A lines' '
	echo "1A quick brown fox jumps over the" >file &&
	echo "lazy dog" >>file &&
	git add file &&
	GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
	git commit -a -m "Initial."
'

test_expect_success 'blame 1 author' '
	check_count A 2
'

test_expect_success 'setup B lines' '
	echo "2A quick brown fox jumps over the" >>file &&
	echo "lazy dog" >>file &&
	GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
	git commit -a -m "Second."
'

test_expect_success 'blame 2 authors' '
	check_count A 2 B 2
'

test_expect_success 'setup B1 lines (branch1)' '
	git checkout -b branch1 master &&
	echo "3A slow green fox jumps into the" >>file &&
	echo "well." >>file &&
	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
	git commit -a -m "Branch1-1"
'

test_expect_success 'blame 2 authors + 1 branch1 author' '
	check_count A 2 B 2 B1 2
'

test_expect_success 'setup B2 lines (branch2)' '
	git checkout -b branch2 master &&
	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
	git commit -a -m "Branch2-1"
'

test_expect_success 'blame 2 authors + 1 branch2 author' '
	check_count A 2 B 1 B2 1
'

test_expect_success 'merge branch1 & branch2' '
	git pull . branch1
'

test_expect_success 'blame 2 authors + 2 merged-in authors' '
	check_count A 2 B 1 B1 2 B2 1
'

test_expect_success 'blame ancestor' '
	check_count -h master A 2 B 2
'

test_expect_success 'blame great-ancestor' '
	check_count -h master^ A 2
'

test_expect_success 'setup evil merge' '
	echo "evil merge." >>file &&
	git commit -a --amend
'

test_expect_success 'blame evil merge' '
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1
'

test_expect_success 'setup incomplete line' '
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="C" GIT_AUTHOR_EMAIL="C@test.git" \
	git commit -a -m "Incomplete"
'

test_expect_success 'blame incomplete line' '
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1 C 1
'

test_expect_success 'setup edits' '
	mv file file.orig &&
	{
		cat file.orig &&
		echo
	} | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" >file &&
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="D" GIT_AUTHOR_EMAIL="D@test.git" \
	git commit -a -m "edit"
'

test_expect_success 'blame edits' '
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1
'

test_expect_success 'setup obfuscated email' '
	echo "No robots allowed" >file.new &&
	cat file >>file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" \
	git commit -a -m "norobots"
'

test_expect_success 'blame obfuscated email' '
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L 1 (all)' '
	check_count -L1 A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L , (all)' '
	check_count -L, A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L X (X to end)' '
	check_count -L5 B1 1 C 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L X, (X to end)' '
	check_count -L5, B1 1 C 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L ,Y (up to Y)' '
	check_count -L,3 A 1 B2 1 E 1
'

test_expect_success 'blame -L X,X' '
	check_count -L3,3 B2 1
'

test_expect_success 'blame -L X,Y' '
	check_count -L3,6 B 1 B1 1 B2 1 D 1
'

test_expect_success 'blame -L Y,X (undocumented)' '
	check_count -L6,3 B 1 B1 1 B2 1 D 1
'

test_expect_failure 'blame -L X,+0' '
	test_must_fail $PROG -L1,+0 file
'

test_expect_success 'blame -L X,+1' '
	check_count -L3,+1 B2 1
'

test_expect_success 'blame -L X,+N' '
	check_count -L3,+4 B 1 B1 1 B2 1 D 1
'

test_expect_failure 'blame -L X,-0' '
	test_must_fail $PROG -L1,-0 file
'

test_expect_success 'blame -L X,-1' '
	check_count -L3,-1 B2 1
'

test_expect_success 'blame -L X,-N' '
	check_count -L6,-4 B 1 B1 1 B2 1 D 1
'

test_expect_success 'blame -L /RE/ (RE to end)' '
	check_count -L/evil/ C 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,/RE2/' '
	check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1
'

test_expect_success 'blame -L X,/RE/' '
	check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,Y' '
	check_count -L/99/,7 B1 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,+N' '
	check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,-N' '
	check_count -L/99/,-3 B 1 B2 1 D 1
'

# 'file' ends with an incomplete line, so 'wc' reports one fewer lines than
# git-blame sees, hence the last line is actually $(wc...)+1.
test_expect_success 'blame -L X (X == nlines)' '
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L$n C 1
'

test_expect_success 'blame -L X (X == nlines + 1)' '
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L$n file
'

test_expect_success 'blame -L X (X > nlines)' '
	test_must_fail $PROG -L12345 file
'

test_expect_success 'blame -L ,Y (Y == nlines)' '
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L,$n A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L ,Y (Y == nlines + 1)' '
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L,$n file
'

test_expect_success 'blame -L ,Y (Y > nlines)' '
	test_must_fail $PROG -L,12345 file
'

test_expect_success 'setup -L :regex' '
	tr Q "\\t" >hello.c <<-\EOF &&
	int main(int argc, const char *argv[])
	{
	Qputs("hello");
	}
	EOF
	git add hello.c &&
	GIT_AUTHOR_NAME="F" GIT_AUTHOR_EMAIL="F@test.git" \
	git commit -m "hello" &&

	mv hello.c hello.orig &&
	sed -e "/}/ {x; s/$/Qputs(\"goodbye\");/; G;}" <hello.orig |
	tr Q "\\t" >hello.c &&
	GIT_AUTHOR_NAME="G" GIT_AUTHOR_EMAIL="G@test.git" \
	git commit -a -m "goodbye" &&

	mv hello.c hello.orig &&
	echo "#include <stdio.h>" >hello.c &&
	cat hello.orig >>hello.c &&
	tr Q "\\t" >>hello.c <<-\EOF
	void mail()
	{
	Qputs("mail");
	}
	EOF
	GIT_AUTHOR_NAME="H" GIT_AUTHOR_EMAIL="H@test.git" \
	git commit -a -m "mail"
'

test_expect_success 'blame -L :literal' '
	check_count -f hello.c -L:main F 4 G 1
'

test_expect_success 'blame -L :regex' '
	check_count -f hello.c "-L:m[a-z][a-z]l" H 4
'

test_expect_success 'blame -L :nomatch' '
	test_must_fail $PROG -L:nomatch hello.c
'

test_expect_success 'setup incremental' '
	(
	GIT_AUTHOR_NAME=I &&
	export GIT_AUTHOR_NAME &&
	GIT_AUTHOR_EMAIL=I@test.git &&
	export GIT_AUTHOR_EMAIL &&
	>incremental &&
	git add incremental &&
	git commit -m "step 0" &&
	printf "partial" >>incremental &&
	git commit -a -m "step 0.5" &&
	echo >>incremental &&
	git commit -a -m "step 1"
	)
'

test_expect_success 'blame empty' '
	check_count -h HEAD^^ -f incremental
'

test_expect_success 'blame -L 0 empty (undocumented)' '
	check_count -h HEAD^^ -f incremental -L0
'

test_expect_success 'blame -L 1 empty' '
	test_must_fail $PROG -L1 incremental HEAD^^
'

test_expect_success 'blame -L 2 empty' '
	test_must_fail $PROG -L2 incremental HEAD^^
'

test_expect_success 'blame half' '
	check_count -h HEAD^ -f incremental I 1
'

test_expect_success 'blame -L 0 half (undocumented)' '
	check_count -h HEAD^ -f incremental -L0 I 1
'

test_expect_success 'blame -L 1 half' '
	check_count -h HEAD^ -f incremental -L1 I 1
'

test_expect_success 'blame -L 2 half' '
	test_must_fail $PROG -L2 incremental HEAD^
'

test_expect_success 'blame -L 3 half' '
	test_must_fail $PROG -L3 incremental HEAD^
'

test_expect_success 'blame full' '
	check_count -f incremental I 1
'

test_expect_success 'blame -L 0 full (undocumented)' '
	check_count -f incremental -L0 I 1
'

test_expect_success 'blame -L 1 full' '
	check_count -f incremental -L1 I 1
'

test_expect_success 'blame -L 2 full' '
	test_must_fail $PROG -L2 incremental
'

test_expect_success 'blame -L 3 full' '
	test_must_fail $PROG -L3 incremental
'

test_expect_success 'blame -L' '
	test_must_fail $PROG -L file
'

test_expect_success 'blame -L X,+' '
	test_must_fail $PROG -L1,+ file
'

test_expect_success 'blame -L X,-' '
	test_must_fail $PROG -L1,- file
'

test_expect_success 'blame -L X (non-numeric X)' '
	test_must_fail $PROG -LX file
'

test_expect_success 'blame -L X,Y (non-numeric Y)' '
	test_must_fail $PROG -L1,Y file
'

test_expect_success 'blame -L X,+N (non-numeric N)' '
	test_must_fail $PROG -L1,+N file
'

test_expect_success 'blame -L X,-N (non-numeric N)' '
	test_must_fail $PROG -L1,-N file
'

# This file isn't used as a test script directly, instead it is
# sourced from t8001-annotate.sh and t8002-blame.sh.

check_count () {
	head= &&
	file='file' &&
	options= &&
	while :
	do
		case "$1" in
		-h) head="$2"; shift; shift ;;
		-f) file="$2"; shift; shift ;;
		-*) options="$options $1"; shift ;;
		*) break ;;
		esac
	done &&
	echo "$PROG $options $file $head" >&4 &&
	$PROG $options $file $head >actual &&
	perl -e '
		my %expect = (@ARGV);
		my %count = map { $_ => 0 } keys %expect;
		while (<STDIN>) {
			if (/^[0-9a-f]+\t\(([^\t]+)\t/) {
				my $author = $1;
				for ($author) { s/^\s*//; s/\s*$//; }
				$count{$author}++;
			}
		}
		my $bad = 0;
		while (my ($author, $count) = each %count) {
			my $ok;
			my $value = 0;
			$value = $expect{$author} if defined $expect{$author};
			if ($value != $count) {
				$bad = 1;
				$ok = "bad";
			}
			else {
				$ok = "good";
			}
			print STDERR "Author $author (expected $value, attributed $count) $ok\n";
		}
		exit($bad);
	' "$@" <actual
}

test_expect_success 'setup A lines' '
	echo "1A quick brown fox jumps over the" >file &&
	echo "lazy dog" >>file &&
	git add file &&
	GIT_AUTHOR_NAME="A" GIT_AUTHOR_EMAIL="A@test.git" \
	git commit -a -m "Initial."
'

test_expect_success 'blame 1 author' '
	check_count A 2
'

test_expect_success 'setup B lines' '
	echo "2A quick brown fox jumps over the" >>file &&
	echo "lazy dog" >>file &&
	GIT_AUTHOR_NAME="B" GIT_AUTHOR_EMAIL="B@test.git" \
	git commit -a -m "Second."
'

test_expect_success 'blame 2 authors' '
	check_count A 2 B 2
'

test_expect_success 'setup B1 lines (branch1)' '
	git checkout -b branch1 master &&
	echo "3A slow green fox jumps into the" >>file &&
	echo "well." >>file &&
	GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="B1@test.git" \
	git commit -a -m "Branch1-1"
'

test_expect_success 'blame 2 authors + 1 branch1 author' '
	check_count A 2 B 2 B1 2
'

test_expect_success 'setup B2 lines (branch2)' '
	git checkout -b branch2 master &&
	sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="B2@test.git" \
	git commit -a -m "Branch2-1"
'

test_expect_success 'blame 2 authors + 1 branch2 author' '
	check_count A 2 B 1 B2 1
'

test_expect_success 'merge branch1 & branch2' '
	git pull . branch1
'

test_expect_success 'blame 2 authors + 2 merged-in authors' '
	check_count A 2 B 1 B1 2 B2 1
'

test_expect_success 'blame ancestor' '
	check_count -h master A 2 B 2
'

test_expect_success 'blame great-ancestor' '
	check_count -h master^ A 2
'

test_expect_success 'setup evil merge' '
	echo "evil merge." >>file &&
	git commit -a --amend
'

test_expect_success 'blame evil merge' '
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1
'

test_expect_success 'setup incomplete line' '
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="C" GIT_AUTHOR_EMAIL="C@test.git" \
	git commit -a -m "Incomplete"
'

test_expect_success 'blame incomplete line' '
	check_count A 2 B 1 B1 2 B2 1 "A U Thor" 1 C 1
'

test_expect_success 'setup edits' '
	mv file file.orig &&
	{
		cat file.orig &&
		echo
	} | sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" >file &&
	echo "incomplete" | tr -d "\\012" >>file &&
	GIT_AUTHOR_NAME="D" GIT_AUTHOR_EMAIL="D@test.git" \
	git commit -a -m "edit"
'

test_expect_success 'blame edits' '
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1
'

test_expect_success 'setup obfuscated email' '
	echo "No robots allowed" >file.new &&
	cat file >>file.new &&
	mv file.new file &&
	GIT_AUTHOR_NAME="E" GIT_AUTHOR_EMAIL="E at test dot git" \
	git commit -a -m "norobots"
'

test_expect_success 'blame obfuscated email' '
	check_count A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L 1 (all)' '
	check_count -L1 A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L , (all)' '
	check_count -L, A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L X (X to end)' '
	check_count -L5 B1 1 C 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L X, (X to end)' '
	check_count -L5, B1 1 C 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L ,Y (up to Y)' '
	check_count -L,3 A 1 B2 1 E 1
'

test_expect_success 'blame -L X,X' '
	check_count -L3,3 B2 1
'

test_expect_success 'blame -L X,Y' '
	check_count -L3,6 B 1 B1 1 B2 1 D 1
'

test_expect_success 'blame -L Y,X (undocumented)' '
	check_count -L6,3 B 1 B1 1 B2 1 D 1
'

test_expect_success 'blame -L X,+1' '
	check_count -L3,+1 B2 1
'

test_expect_success 'blame -L X,+N' '
	check_count -L3,+4 B 1 B1 1 B2 1 D 1
'

test_expect_success 'blame -L X,-1' '
	check_count -L3,-1 B2 1
'

test_expect_success 'blame -L X,-N' '
	check_count -L6,-4 B 1 B1 1 B2 1 D 1
'

test_expect_success 'blame -L /RE/ (RE to end)' '
	check_count -L/evil/ C 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,/RE2/' '
	check_count -L/robot/,/green/ A 1 B 1 B2 1 D 1 E 1
'

test_expect_success 'blame -L X,/RE/' '
	check_count -L5,/evil/ B1 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,Y' '
	check_count -L/99/,7 B1 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,+N' '
	check_count -L/99/,+3 B1 1 D 1 "A U Thor" 1
'

test_expect_success 'blame -L /RE/,-N' '
	check_count -L/99/,-3 B 1 B2 1 D 1
'

# 'file' ends with an incomplete line, so 'wc' reports one fewer lines than
# git-blame sees, hence the last line is actually $(wc...)+1.
test_expect_success 'blame -L X (X == nlines)' '
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L$n C 1
'

test_expect_success 'blame -L X (X == nlines + 1)' '
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L$n file
'

test_expect_success 'blame -L X (X > nlines)' '
	test_must_fail $PROG -L12345 file
'

test_expect_success 'blame -L ,Y (Y == nlines)' '
	n=$(expr $(wc -l <file) + 1) &&
	check_count -L,$n A 1 B 1 B1 1 B2 1 "A U Thor" 1 C 1 D 1 E 1
'

test_expect_success 'blame -L ,Y (Y == nlines + 1)' '
	n=$(expr $(wc -l <file) + 2) &&
	test_must_fail $PROG -L,$n file
'

test_expect_success 'blame -L ,Y (Y > nlines)' '
	test_must_fail $PROG -L,12345 file
'

test_expect_success 'setup -L :regex' '
	tr Q "\\t" >hello.c <<-\EOF &&
	int main(int argc, const char *argv[])
	{
	Qputs("hello");
	}
	EOF
	git add hello.c &&
	GIT_AUTHOR_NAME="F" GIT_AUTHOR_EMAIL="F@test.git" \
	git commit -m "hello" &&

	mv hello.c hello.orig &&
	sed -e "/}/ {x; s/$/Qputs(\"goodbye\");/; G;}" <hello.orig |
	tr Q "\\t" >hello.c &&
	GIT_AUTHOR_NAME="G" GIT_AUTHOR_EMAIL="G@test.git" \
	git commit -a -m "goodbye" &&

	mv hello.c hello.orig &&
	echo "#include <stdio.h>" >hello.c &&
	cat hello.orig >>hello.c &&
	tr Q "\\t" >>hello.c <<-\EOF
	void mail()
	{
	Qputs("mail");
	}
	EOF
	GIT_AUTHOR_NAME="H" GIT_AUTHOR_EMAIL="H@test.git" \
	git commit -a -m "mail"
'

test_expect_success 'blame -L :literal' '
	check_count -f hello.c -L:main F 4 G 1
'

test_expect_success 'blame -L :regex' '
	check_count -f hello.c "-L:m[a-z][a-z]l" H 4
'

test_expect_success 'blame -L :nomatch' '
	test_must_fail $PROG -L:nomatch hello.c
'

test_expect_success 'setup incremental' '
	(
	GIT_AUTHOR_NAME=I &&
	export GIT_AUTHOR_NAME &&
	GIT_AUTHOR_EMAIL=I@test.git &&
	export GIT_AUTHOR_EMAIL &&
	>incremental &&
	git add incremental &&
	git commit -m "step 0" &&
	printf "partial" >>incremental &&
	git commit -a -m "step 0.5" &&
	echo >>incremental &&
	git commit -a -m "step 1"
	)
'

test_expect_success 'blame empty' '
	check_count -h HEAD^^ -f incremental
'

test_expect_success 'blame -L 0 empty (undocumented)' '
	check_count -h HEAD^^ -f incremental -L0
'

test_expect_success 'blame -L 1 empty' '
	test_must_fail $PROG -L1 incremental HEAD^^
'

test_expect_success 'blame -L 2 empty' '
	test_must_fail $PROG -L2 incremental HEAD^^
'

test_expect_success 'blame half' '
	check_count -h HEAD^ -f incremental I 1
'

test_expect_success 'blame -L 0 half (undocumented)' '
	check_count -h HEAD^ -f incremental -L0 I 1
'

test_expect_success 'blame -L 1 half' '
	check_count -h HEAD^ -f incremental -L1 I 1
'

test_expect_success 'blame -L 2 half' '
	test_must_fail $PROG -L2 incremental HEAD^
'

test_expect_success 'blame -L 3 half' '
	test_must_fail $PROG -L3 incremental HEAD^
'

test_expect_success 'blame full' '
	check_count -f incremental I 1
'

test_expect_success 'blame -L 0 full (undocumented)' '
	check_count -f incremental -L0 I 1
'

test_expect_success 'blame -L 1 full' '
	check_count -f incremental -L1 I 1
'

test_expect_success 'blame -L 2 full' '
	test_must_fail $PROG -L2 incremental
'

test_expect_success 'blame -L 3 full' '
	test_must_fail $PROG -L3 incremental
'

test_expect_success 'blame -L' '
	test_must_fail $PROG -L file
'

test_expect_success 'blame -L X,+' '
	test_must_fail $PROG -L1,+ file
'

test_expect_success 'blame -L X,-' '
	test_must_fail $PROG -L1,- file
'

test_expect_success 'blame -L X (non-numeric X)' '
	test_must_fail $PROG -LX file
'

test_expect_success 'blame -L X,Y (non-numeric Y)' '
	test_must_fail $PROG -L1,Y file
'

test_expect_success 'blame -L X,+N (non-numeric N)' '
	test_must_fail $PROG -L1,+N file
'

test_expect_success 'blame -L X,-N (non-numeric N)' '
	test_must_fail $PROG -L1,-N file
'


Script to configure the namenode3

Script to configure the namenode3

Signed-off-by: mystique <a2c28a79fd059c0038bf659c822f1c4f689fa2d4@quantumfoam.uni.me>

error: pathspec 'docker-image-build/hadoop/hadoopClusterConf/datanode3-setup.sh' did not match any file(s) known to git


image-processing script

image-processing script

#!/bin/sh

for i in *.jpg
  do
  # Rotate the images
# convert -rotate 180 $i $i

  # Crop the images
  convert -crop 1600x1600+900+150 $i $i
done

error: pathspec 'images/wetlands/crop.sh' did not match any file(s) known to git


adding example script to show how to embed shall (to avoid sourcing it)

#!/usr/bin/env bash
#
# example of shall being embedded in a script (instead of sourcing it)
# the block below has been created with the command
# $ gzip -c < shall |base64|sed -e '1i\SHALLSTART' -e '$a\SHALLEND' -e 's/^/#/'
# end can be decoded and applied to the local script using
# $ eval "$(sed -n -e '/^#SHALLSTART/,/^#SHALLEND/p' "$0"|sed -e '/^#SHALL/d' -e 's/^#//'|base64 -d -|gzip -dc -)"
# (see below)
#

#SHALLSTART
#H4sIADPa3lMAA5VUXW+bMBR951dcUSSSdaQf2xNVtlVVs1ZpGynttJdoyIVLQAE7xSZd1PS/79oQ
#IE1VaUgJ+H4e33PsA+sAchEuUj6HUOQ545GExzVIVErbyiWwLGUSJShhIiEueahSwaV1QMmCZ2t4
#FsVCQhrDWpQQsixraz2nKhGlAvYoZJkphCVTiRwMBuD3qICpERbIyMO2WaYPefSr17deLKAnzKOh
#7ZzYZqFYMUdF69NqHdxfnd/cBLeTi/E9Wc2yWjlVKFRxBFGtlwh2bbbh9NtRhKsjXmbZZl7gErwn
#cFNJYLb7dM9AJchNvn502WD06+6CGvUwTAR4uiDh6/Vn/GXGty1nzo8Zf7X7VWvMJDY1Si41Jp1k
#/3fhTtE4tcz799X1xdXQ6T0naZiATukb+2R6/XO/pCjSedCta9Lf4P1gpCaf0uuh4oplhLPptWNt
#NmVbrxXbBeZiRWxrlRjiK761nIKS68+AfA3vsSggh5SD00V0BpGwurN0crOMBMd9+K6rm1fdS861
#sBlIemUICiWpk0QXCW1/FGKxQFzStwZE4Q8U0KIhUbQyrCbKwZ7WVR3tJ203arONxX4jIZMnFs06
#ow3UgCfjw8N9vZiEmKXZeymj8+ubOqmzc20N7s5vLxv2ujYDCxoRvTbDkYYYPRQJEcYpJ3qYbA6D
#Oc/gan/g7jg4y+lwF5Tyl2rpABpKM7cOgOHxW0sNk1jqOCbjOlALIDYC6EUYZqxA8EabkO4UL5oB
#ePEXrzq57p8K1kaKQvU7CqGaNY+aD3tXKHqQVUf6DZ2Whu7QWrbtKep7TPrgNFlmXD3Z/wxtOsgy
#DBEjjFqrrmRYxGhQ32Ma047bwyc4hs2m7jaiaC0sQ4gP+0R+WGfLa4LZEoudm9tiUmKhJuOGovrA
#fjIHtfLq7u/4OyxNLx+Gzvd9DGSng4E1BFilvpLDr75U9IfKZ6lv/QP/yy6jewYAAA==
#SHALLEND
eval "$(sed -n -e '/^#SHALLSTART/,/^#SHALLEND/p' "$0"|sed -e '/^#SHALL/d' -e 's/^#//'|base64 -d -|gzip -dc -)"

# just to proof that shall is actually there..
test_noop()
{
    assertOK true
}

testRun

error: pathspec 'exampleShallEmbedded.sh' did not match any file(s) known to git


'main': Add an XFail test for issue #202.

#!/usr/bin/env zsh
# -------------------------------------------------------------------------------------------------
# Copyright (c) 2020 zsh-syntax-highlighting contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
#  * Redistributions of source code must retain the above copyright notice, this list of conditions
#    and the following disclaimer.
#  * Redistributions in binary form must reproduce the above copyright notice, this list of
#    conditions and the following disclaimer in the documentation and/or other materials provided
#    with the distribution.
#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors
#    may be used to endorse or promote products derived from this software without specific prior
#    written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# -------------------------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# -------------------------------------------------------------------------------------------------

touch foo
chmod -x foo
BUFFER=$'./foo; ./foo'

expected_region_highlight=(
  '1 5 unknown-token "issue #202"' # ./foo (in middle)
  '6 6 commandseparator' # ;
  '8 12 unknown-token "issue #202"' # ./foo (at end)
)

error: pathspec 'highlighters/main/test-data/plain-file-in-command-position.zsh' did not match any file(s) known to git


Better style -- list one file per line.

Better style -- list one file per line.

#!/bin/bash

mkdir -p $PREFIX/bin

if [ $PY3K -eq 1 ]
then
    2to3 --write \
	hisat2_extract_exons.py \
	hisat2_extract_snps_haplotypes_UCSC.py \
	hisat2_extract_splice_sites.py \
	hisat2-build hisat2-inspect \
	hisat2_simulate_reads.py \
	hisat2_extract_snps_haplotypes_VCF.py \
	hisatgenotype_extract_vars.py \
	hisatgenotype_typing.py
fi

for i in \
    hisat2 \
    hisat2-align-s \
    hisat2-align-l \
    hisat2-build \
    hisat2-build-s \
    hisat2-build-l \
    hisat2-inspect \
    hisat2-inspect-s \
    hisat2-inspect-l \
    hisat2_extract_splice_sites.py \
    hisat2_extract_exons.py \
    hisat2_simulate_reads.py \
    hisat2_extract_snps_haplotypes_UCSC.py \
    hisat2_extract_snps_haplotypes_VCF.py \
    hisatgenotype_extract_vars.py \
    hisatgenotype_typing.py;
do
    echo $i
    cp $i $PREFIX/bin
    chmod +x $PREFIX/bin/$i
done

cp -r example $PREFIX/bin

#!/bin/bash

mkdir -p $PREFIX/bin

if [ $PY3K -eq 1 ]
then
    2to3 --write hisat2_extract_exons.py hisat2_extract_snps_haplotypes_UCSC.py hisat2_extract_splice_sites.py hisat2-build hisat2-inspect hisat2_simulate_reads.py hisat2_extract_snps_haplotypes_VCF.py hisatgenotype_extract_vars.py hisatgenotype_typing.py
fi

for i in \
    hisat2 \
    hisat2-align-s \
    hisat2-align-l \
    hisat2-build \
    hisat2-build-s \
    hisat2-build-l \
    hisat2-inspect \
    hisat2-inspect-s \
    hisat2-inspect-l \
    hisat2_extract_splice_sites.py \
    hisat2_extract_exons.py \
    hisat2_simulate_reads.py \
    hisat2_extract_snps_haplotypes_UCSC.py \
    hisat2_extract_snps_haplotypes_VCF.py \
    hisatgenotype_extract_vars.py \
    hisatgenotype_typing.py;
do
    echo $i
    cp $i $PREFIX/bin
    chmod +x $PREFIX/bin/$i
done

cp -r example $PREFIX/bin


steps to install minikube locally

steps to install minikube locally

Signed-off-by: kmova <6a28dfa88869c0f71365518480e309e6698873e0@mayadata.io>

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo cp kubectl /usr/local/bin/ && rm kubectl

export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
mkdir -p $HOME/.kube
touch $HOME/.kube/config

export KUBECONFIG=$HOME/.kube/config
sudo -E minikube start --vm-driver=none

# this for loop waits until kubectl can access the api server that Minikube has created
for i in {1..150}; do # timeout for 5 minutes
   ./kubectl get po &> /dev/null
   if [ $? -ne 1 ]; then
      break
  fi
  sleep 2
done

error: pathspec 'minikube/setup-minikube.sh' did not match any file(s) known to git


.sh file for bench mem.

.sh file for bench mem.

function pause() {
	read -n1 -r -p "Press any key to continue..." key
}

clang -Wall -Wextra -O3 -o bench_sg_mem bench_sg_mem.c scapegoat.c
pause
./bench_sg_mem
pause
clang++ -Wall -Wextra -O3 bench_rb_mem.cpp scapegoat.lib -o bench_rb_mem
pause
./bench_rb_mem
pause

error: pathspec 'src/build_and_run_bench_mem.sh' did not match any file(s) known to git


Cleaned up the script and added the Parameters section to the top so the launch parameters can be modified.

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/bryankaraffa/rightscale_scripts.git/'


properly handle changeless deployment attempts

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/byuweb/web-cdn.git/'


fix spelling

fix spelling


another test

another test

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/geoffreychiou/industrial_ci.git/'


added index.txt to generated files

added index.txt to generated files

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/apache/infrastructure-puppet.git/'


Create xrandr-set-newmode.sh

Create xrandr-set-newmode.sh

Create a new mode, add it, and set it as current. Configured for VNC by default.

#!/bin/bash

if [[ -z "$output" ]]; then
    output=VNC-0
fi

modeline=`cvt $1 $2 $3 | grep Modeline | sed 's/Modeline\s*//'`
mode=`echo $modeline | awk '{print $1}'`

xrandr --newmode $modeline
xrandr --addmode "$output" $mode
xrandr --output "$output" --mode $mode

error: pathspec 'linux/xrandr-set-newmode.sh' did not match any file(s) known to git


compile.sh

compile.sh

/bin/rm -rf webapps/root/WEB-INF/classes/*
/usr/bin/javac -sourcepath src/java/ -classpath lib/*:lib/*/*:webapps/root/WEB-INF/lib/* -d webapps/root/WEB-INF/classes/ src/java/nxt/*.java src/java/nxt/*/*.java

error: pathspec 'compile.sh' did not match any file(s) known to git


creating an script to compile and test the library

#!/bin/sh

clear
echo "Compiling LIBQIF Library"
#creating the "*.o" files ---------------------------------------------------------

#--- that needs armadillo
g++ -I./inc -c src/Channel.cpp
g++ -I./inc -c src/Graph.cpp
g++ -I./inc -c src/Gain.cpp
g++ -I./inc -c src/Prob.cpp
g++ -I./inc -c src/Mechanism.cpp

#--- that needs the basic things and scilab_call
g++ -I./inc -c src/EntropyModel.cpp
g++ -I./inc -c src/Shannon.cpp
g++ -I./inc -c src/MinEntropy.cpp
g++ -I./inc -c src/Guessing.cpp

#--- that needs glpk
g++ -I./inc -c src/LinearProgram.cpp -lglpk

#--- that needs LinearProgram
g++ -I./inc -c src/GLeakage.cpp -lglpk

#creating the library---------------------------------------------------------------

ar -rvs libqif.a Channel.o inc/Channel.h Graph.o inc/Graph.h Gain.o inc/Gain.h Prob.o inc/Prob.h Mechanism.o inc/Mechanism.h EntropyModel.o inc/EntropyModel.h Shannon.o inc/Shannon.h MinEntropy.o inc/MinEntropy.h Guessing.o inc/Guessing.h LinearProgram.o inc/LinearProgram.h GLeakage.o inc/GLeakage.h

mv libqif.a lib/

# Documentation --------------------------------------------------------------------
echo "Creating Library Documentation"

# preparing doxygen files
cd doxygen/
mv Doxyfile footer.html init stylesheet.css mainpage.dox header.html ../
cd ..
#requires doxygen
# doxygen Doxyfile

# restoring the doxygen files
mv Doxyfile footer.html init stylesheet.css mainpage.dox header.html doxygen/

# TESTING ---------------------------------------------------------------------------
echo "testing the LIBQIF library"

# creating .o files
g++ -I./inc -c tests/ChannelTest.cc
g++ -I./inc -c tests/GraphTest.cc
g++ -I./inc -c tests/GainTest.cc
g++ -I./inc -c tests/ProbTest.cc
g++ -I./inc -c tests/MechanismTest.cc
g++ -I./inc -c tests/EntropyModelTest.cc
g++ -I./inc -c tests/ShannonTest.cc
g++ -I./inc -c tests/MinEntropyTest.cc
g++ -I./inc -c tests/GuessingTest.cc
g++ -I./inc -c tests/LinearProgramTest.cc
g++ -I./inc -c tests/GLeakageTest.cc

# linking with gtest
g++ -I./inc Channel.o ChannelTest.o lib/gtest_main.a -lpthread -o tests/ChannelTest
g++ -I./inc Graph.o GraphTest.o lib/gtest_main.a -lpthread -o tests/GraphTest
g++ -I./inc Gain.o GainTest.o lib/gtest_main.a -lpthread -o tests/GainTest
g++ -I./inc Prob.o ProbTest.o lib/gtest_main.a -lpthread -o tests/ProbTest
g++ -I./inc Mechanism.o MechanismTest.o lib/gtest_main.a lib/libqif.a -lpthread -o tests/MechanismTest
g++ -I./inc EntropyModel.o EntropyModelTest.o lib/gtest_main.a -lpthread -o tests/EntropyModelTest
g++ -I./inc Shannon.o ShannonTest.o lib/gtest_main.a lib/libqif.a -lpthread -o tests/ShannonTest
g++ -I./inc MinEntropy.o MinEntropyTest.o lib/gtest_main.a lib/libqif.a -lpthread -o tests/MinEntropyTest
g++ -I./inc Guessing.o GuessingTest.o lib/gtest_main.a lib/libqif.a -lpthread -o tests/GuessingTest
g++ -I./inc LinearProgram.o LinearProgramTest.o lib/gtest_main.a -lglpk -lpthread -o tests/LinearProgramTest
g++ -I./inc GLeakage.o GLeakageTest.o lib/gtest_main.a lib/libqif.a -lpthread -o tests/GLeakageTest
rm *.o

# running test cases
cd tests/
 ./ChannelTest
 ./GraphTest
 ./GainTest
 ./ProbTest
 ./MechanismTest
 ./EntropyModelTest
 ./ShannonTest
 ./MinEntropyTest
 ./GuessingTest
 ./LinearProgramTest
 ./GLeakageTest
cd ..

# ----------------------------------------------------------------------------------
echo "LIBQIF Library is in bin/libqif.a"
echo "LIBQIF Library Documentation is in html/index.html"
echo "LIBQIF example is in samples/"
g++ -I./inc -L./ -o samples/programa1 samples/Main.cpp lib/libqif.a


Updated build script

Updated build script

#!/bin/sh

CCB_VERSION=$1

# Remove build directory
cd ..
rm -Rf build/

# Clean and build CocosBuilder
cd CocosBuilder/
xcodebuild -alltargets clean
xcodebuild -target CocosBuilder -configuration Debug build

# Create archives
cd ..
# mkdir "build/CocosBuilder-$CCB_VERSION-examples"
mkdir "build/CocosBuilder-$CCB_VERSION-CCBReader"
# cp -RL "Examples" "build/CocosBuilder-$CCB_VERSION-examples/"
cp -RL "Examples/CocosBuilderExample/libs/CCBReader" "build/CocosBuilder-$CCB_VERSION-CCBReader/"

cd build/
zip -r "CocosBuilder-$CCB_VERSION.zip" CocosBuilder.app
# zip -r "CocosBuilder-$CCB_VERSION-examples.zip" "CocosBuilder-$CCB_VERSION-examples"
zip -r "CocosBuilder-$CCB_VERSION-CCBReader.zip" "CocosBuilder-$CCB_VERSION-CCBReader"

#!/bin/sh

CCB_VERSION=$1

# Remove build directory
cd ..
rm -Rf build/

# Clean and build CocosBuilder
cd CocosBuilder/
xcodebuild -alltargets clean
xcodebuild -target CocosBuilder -configuration Debug build

# Create archives
cd ..
# mkdir "build/CocosBuilder-$CCB_VERSION-examples"
# mkdir "build/CocosBuilder-$CCB_VERSION-CCBReader"
# cp -RL "Examples" "build/CocosBuilder-$CCB_VERSION-examples/"
# cp -RL "Examples/CocosBuilderExample/libs/CCBReader" "build/CocosBuilder-$CCB_VERSION-CCBReader/"

cd build/
zip -r "CocosBuilder-$CCB_VERSION.zip" CocosBuilder.app
# zip -r "CocosBuilder-$CCB_VERSION-examples.zip" "CocosBuilder-$CCB_VERSION-examples"
# zip -r "CocosBuilder-$CCB_VERSION-CCBReader.zip" "CocosBuilder-$CCB_VERSION-CCBReader"


Adds script that builds and copies Solr schema.

#!/bin/sh
./manage.py build_solr_schema > schema.xml
sudo mv schema.xml /opt/solr/apache-solr-3.6.1/example/solr/conf/schema.xml

error: pathspec 'scripts/build_solr_schema.sh' did not match any file(s) known to git


set the version and commit in the build

set the version and commit in the build

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/vrischmann/ghmirror.git/'


github deployment setup script integrated with server farmer

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/tomaszklim/misc-scripts.git/'


Initial commit of AD bootstrap script

Initial commit of AD bootstrap script

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/riverspiv/cloudera-director.git/'


Add a simple Linux/Puppet script to kickstart Puppet on Debian-based hosts

This has only been tested on Ubuntu 10.04 LTS

#!/bin/sh -x

export PATH=/var/lib/gems/1.8/bin:$PATH

which puppet

if [ $? -ne 0 ]; then
    apt-get update

    apt-get install -y ruby1.8 \
                    ruby1.8-dev \
                    libopenssl-ruby1.8 \
                    rubygems

    gem install puppet --no-ri --no-rdoc
fi

puppet apply --verbose --modulepath=./modules manifests/site.pp

error: pathspec 'scripts/linux_puppet.sh' did not match any file(s) known to git


Put stuff in _build instead of root (#1164)

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/let-def/reason.git/'


Add a small script to run a few quality checks locally

It depends on makeobj and cppcheck. Probably a good idea to use those
anyway, and run this script before a push. We can probably add more
checks later on.

CCMAIL: 03fe5f9bac754ba079a2fce5224b325eabbb3d76@kde.org

#! /bin/sh

# Looking for the .git directory to be sure we're
# at the top level of the working directory

while ! test -e ".git"; do
	cd ..
	if test "$PWD" = "/"; then
		echo "We're not in a git working directory!"
		exit 1
	fi
done

project=`basename $PWD`

echo "Starting quality checks for $project"

echo "Automated Tests"
makeobj test || exit 1

echo "CppCheck"
cppcheck --quiet --enable=style --enable=performance --enable=portability --enable=information --enable=missingInclude --inline-suppr .

error: pathspec 'scripts/qualitycheck.sh' did not match any file(s) known to git


update conda

update conda

#!/bin/bash
set -e
set -x
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

if [[ $TRAVIS_OS_NAME = "linux" ]]
then
    tag=Linux
else
    tag=MacOSX
fi

# install conda
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-$tag-x86_64.sh
sudo bash Miniconda3-latest-$tag-x86_64.sh -b -p /anaconda
sudo chown -R $USER /anaconda
export PATH=/anaconda/bin:$PATH
conda update conda
conda install -y --file https://raw.githubusercontent.com/bioconda/bioconda-utils/$BIOCONDA_UTILS_TAG/conda-requirements.txt
conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64

# setup bioconda channel
conda config --add channels bioconda
conda config --add channels r
conda config --add channels file://anaconda/conda-bld

# setup bioconda-utils
pip install git+https://github.com/galaxyproject/galaxy-lib.git@871c090
pip install git+https://github.com/bioconda/bioconda-utils.git@$BIOCONDA_UTILS_TAG

#!/bin/bash
set -e
set -x
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

if [[ $TRAVIS_OS_NAME = "linux" ]]
then
    tag=Linux
else
    tag=MacOSX
fi

# install conda
curl -O https://repo.continuum.io/miniconda/Miniconda3-latest-$tag-x86_64.sh
sudo bash Miniconda3-latest-$tag-x86_64.sh -b -p /anaconda
sudo chown -R $USER /anaconda
export PATH=/anaconda/bin:$PATH
conda install -y --file https://raw.githubusercontent.com/bioconda/bioconda-utils/$BIOCONDA_UTILS_TAG/conda-requirements.txt
conda index /anaconda/conda-bld/linux-64 /anaconda/conda-bld/osx-64

# setup bioconda channel
conda config --add channels bioconda
conda config --add channels r
conda config --add channels file://anaconda/conda-bld

# setup bioconda-utils
pip install git+https://github.com/galaxyproject/galaxy-lib.git@871c090
pip install git+https://github.com/bioconda/bioconda-utils.git@$BIOCONDA_UTILS_TAG


Add screenlayout script for HP ZBoot Studio x360 G5

Has logic for home eGPU setup, and if nouveau is loaded or not.

#!/bin/sh

EDP=`xrandr | grep "\<connected\>" | grep -i edp | cut -d " " -f 1`

connect3() {
	xrandr --output $EDP --mode 1920x1080 --pos 1920x1200 \
			--output $1 --primary --mode 1920x1200 --pos 1920x0 \
			--output $2 --mode 1920x1080 --pos 0x0 \
			--output $3 --mode 1920x1080 --pos 3840x0
}

# Notes: 2048x1152 on the laptop display seems to be quite sharper than
# 1920x1080.

PROVIDERS=`xrandr --listproviders | head -n 1 | cut -d ":" -f 3`

for i in `seq 1 $PROVIDERS`; do
	xrandr --setprovideroutputsource $i 0
done

# it seems like xrandr --list monitors should show connected monitors that
# are not active
CONNECTED=`xrandr | grep "\<connected\>" | wc -l`

if [ $CONNECTED -eq 1 ]; then
	xrandr --output $EDP --mode 1920x1080 --primary
elif [ $CONNECTED -eq 4 ]; then
	connect3 `xrandr | grep "\<connected\>" | grep -v -i edp | cut -d " " -f 1 | sort | xargs`
fi

error: pathspec 'misc/screenlayout/hpzbstdxg5.sh' did not match any file(s) known to git


Script to run puppet once. Also checks hasn't been running too long.

#!/bin/bash
#

# If the running agents PID is lest than the mmin old we should give it more time.
MMIN=59
LMIN=180
PIDLOC="/var/run/puppet/agent.pid"
RUNLOC="/var/lib/puppet/state/agent_catalog_run.lock"

#
# Check that the agent lock isn't there longer than is reasonable
#
if [ -f $RUNLOC ]; then
  if [ -f $PIDLOC ]; then
    /usr/bin/logger "Puppet appears to be running."
  else
    RT=`find $RUNLOC -mmin +$LMIN |wc -l`
    if [ $RT -gt 0 ]; then
      /usr/bin/logger "Puppet agent lock file isn't right, making very sure puppet is dead then removing it."
      /usr/bin/killall puppet
      /usr/bin/killall -9 puppet
      /bin/sleep 30
      rm $RUNLOC -f
    else
      /usr/bin/logger "Puppet lock file exist however it is less than $LMIN minutes old"
    fi
  fi
fi

#
# Check the pid isn't there for more than $MMIN
#
if [ -f $PIDLOC ]; then
  RT=`find $PIDLOC -mmin +$MMIN |wc -l`
  if [ $RT -gt 0 ]; then
    /usr/bin/logger "Puppet is killed after running too long."
    /usr/bin/killall puppet
    /bin/sleep 30
  else
    /usr/bin/logger "Puppet is still running less than $MMIN minutes."
  fi
fi

#
# If the Pid doesn't exist start up puppet
#
if [ ! -f $PIDLOC ]; then
  /usr/bin/logger "Puppet starting from script with the hostname `hostname`"
  /usr/bin/puppet agent --onetime --logdest syslog
fi

error: pathspec 'linux/puppet/puppet_single_run.sh' did not match any file(s) known to git


Added script to generate content for windows host file

#!/usr/bin/env bash

echo 'Creating host files...'
cd /vagrant/www/wordpress-skydreams/htdocs/

wp db query "SELECT domain FROM wp_domain_mapping wdm WHERE wdm.active = 1 ORDER BY domain" | sed 1d | while read -r url
do
cd /vagrant/www/wordpress-skydreams/domains

echo '192.168.50.4 '$url >> domainHosts.txt
done

error: pathspec 'scripts/wordpress-skydreams/generate-windows-host.sh' did not match any file(s) known to git


Update update_containers.sh

Update update_containers.sh

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/gandalf-the-white/foundation.git/'


Exceptions

Exceptions

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/bashrc/freedombone.git/'


Add helper to create and export a virtualbox machine image from virtual disk image

#!/bin/sh -e

usage() {
	cat <<EOF
Usage:
$(basename "$0") "/path/to/diskimage.vdi"

Description:
Creates and exports a machine image (OVF) from virtual disk image

EOF
}

cleanup() {
  if [ -n "$VM" ] && VBoxManage list vms | grep -q "$VM"; then
    # Detach the diskimage before deleting the virtual image
    VBoxManage storageattach "$VM" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium none
    VBoxManage unregistervm "$VM" --delete || echo > /dev/null
  fi
}

trap cleanup EXIT INT TERM

msg_status() {
	echo "\033[0;32m-- $1\033[0m"
}

msg_error() {
	echo "\033[0;31m-- $1\033[0m"
}

render_template() {
  eval "echo \"$(cat "$1")\""
}

if [ ! -f "$1" ]; then
  usage
	exit 1
fi

TIMESTAMP=$(date +"%s")
VM="macOS_${TIMESTAMP}"
HARDDRIVE="$1"
OUTPUT="${HARDDRIVE%.vdi}.ovf"

msg_status "Creating new virtual machine"
VBoxManage createvm --name "$VM" --ostype "MacOS_64" --register

msg_status "Adding SATA Controller"
VBoxManage storagectl "$VM" --name "SATA Controller" --add sata --controller IntelAHCI

msg_status "Attaching vdi"
VBoxManage storageattach "$VM" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$HARDDRIVE"

msg_status "Setting up virtual machine"
VBoxManage modifyvm "$VM" --audiocontroller "hda"
VBoxManage modifyvm "$VM" --chipset "ich9"
VBoxManage modifyvm "$VM" --firmware "efi"
VBoxManage modifyvm "$VM" --cpus "2"
VBoxManage modifyvm "$VM" --hpet "on"
VBoxManage modifyvm "$VM" --keyboard "usb"
VBoxManage modifyvm "$VM" --memory "4096"
VBoxManage modifyvm "$VM" --mouse "usbtablet"
VBoxManage modifyvm "$VM" --vram "128"

msg_status "Exporting the virtual machine"
VBoxManage export "$VM" --output "$OUTPUT"

msg_status "Done. Virtual machine export located at $OUTPUT."

error: pathspec 'prepare_iso/prepare_ovf.sh' did not match any file(s) known to git


add setup reverse_tunnel.sh

add setup reverse_tunnel.sh

#!/bin/bash
if [ -z "$SUDO_USER" ]; then
    echo "$0 must be called from sudo. Try: 'sudo ${0}'"
    exit 1
fi

SCRIPT_LOCATION="/etc/network/if-up.d/reverse_ssh_tunnel"

echo "Creating file in $SCRIPT_LOCATION"
echo "Installing openssh-server and autossh"
apt-get install openssh-server autossh
echo "Randomly creating port numbers (edit these in the file to change if you want)"

PORT_NUMBER=$[ ( $RANDOM % 10000 )  + 10000 ]
MONITORING_PORT_NUMBER=$[ ( $RANDOM % 10000 )  + 20000 ]

echo "PORT_NUMBER: ${PORT_NUMBER}"
echo "MONITORING_PORT_NUMBER: ${MONITORING_PORT_NUMBER}"
echo "Enter servername or IP address for the middleman server"
read MIDDLEMAN_SERVER
echo "Enter username to use for logging into $MIDDLEMAN_SERVER:[$SUDO_USER]"
read MIDDLEMAN_USERNAME
if [[ -z $MIDDLEMAN_USERNAME ]]; then
  MIDDLEMAN_USERNAME=$SUDO_USER
fi
echo "Checking to see if we can login using public key authentication: ssh $MIDDLEMAN_USERNAME@$MIDDLEMAN_SERVER (TODO, TO BE IMPLEMENTED!)"
su $SUDO_USER -c "ssh $MIDDLEMAN_USERNAME@$MIDDLEMAN_SERVER \"echo I am in\""

echo "Checking to see if GatewayPorts is set on $MIDDLEMAN_SERVER"
su $SUDO_USER -c "ssh $MIDDLEMAN_USERNAME@$MIDDLEMAN_SERVER \"cat /etc/ssh/sshd_config | grep 'GatewayPorts yes'\""

echo "Do you want to upload your public key to the middleman and setup public key authentication? ([y]/n)"
read COPY_KEY

if [ ! "${COPY_KEY}" = "n" ]; then
  su $SUDO_USER -c "ssh-copy-id $MIDDLEMAN_USERNAME@$MIDDLEMAN_SERVER"
fi

echo "#!/bin/sh
# ------------------------------
# Added by setup_reverse_tunnel.sh
# ------------------------------
# See autossh and google for reverse ssh tunnels to see how this works

# When this script runs it will allow you to ssh into this machine even if it is behind a firewall or has a NAT'd IP address.
# From any ssh capable machine you just type ssh -p $PORT_NUMBER $SUDO_USER@$MIDDLEMAN_SERVER

# This is the username on your local server who has public key authentication setup at the middleman
USER_TO_SSH_IN_AS=$MIDDLEMAN_USERNAME

# This is the username and hostname/IP address for the middleman (internet accessible server)
MIDDLEMAN_SERVER_AND_USERNAME=$MIDDLEMAN_USERNAME@$MIDDLEMAN_SERVER

# Port that the middleman will listen on (use this value as the -p argument when sshing)
PORT_MIDDLEMAN_WILL_LISTEN_ON=$PORT_NUMBER

# Connection monitoring port, don't need to know this one
AUTOSSH_PORT=$MONITORING_PORT_NUMBER

# Ensures that autossh keeps trying to connect
AUTOSSH_GATETIME=0
su -c \"autossh -f -N -R *:\${PORT_MIDDLEMAN_WILL_LISTEN_ON}:localhost:22 \${MIDDLEMAN_SERVER_AND_USERNAME} -oLogLevel=error  -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no\" $SUDO_USER
" > $SCRIPT_LOCATION

echo "Making script executable"
chmod +x $SCRIPT_LOCATION

echo "Tunnel will now automatically run whenever a network connection comes up"
echo "Do you want to start the tunnel now? [y]/n"
read START_TUNNEL

if [ ! "${START_TUNNEL}" = "n" ]; then
  $SCRIPT_LOCATION
fi

echo "You might want to add the following to your .ssh/config (and then copy it to other machines) so that you can set this up easily:

Host $HOSTNAME.tunnel
  Port $PORT_NUMBER
  HostName $MIDDLEMAN_SERVER
  User $MIDDLEMAN_USERNAME
"

error: pathspec 'setup_reverse_tunnel.sh' did not match any file(s) known to git


Handle additional reqs push failure as non failing

When pushing changes to gerrit for requirements proposals there are
cases where we want to ignore push errors. Specifically when gerrit is
complaining because you are pushing the same commit or one with
identical comments. We should just ignore these errors as it means the
current reqs proposal is up to date.

See
https://review.openstack.org/Documentation/error-no-changes-made.html
for more info.

Change-Id: I5d7a1991449a80f570191eaad49dc3f9a0ff1a6a

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/open-switch/infra_puppet-jenkins.git/'


Add test for 'addHostToFileIfNotExists' in 'lib/add-functions.sh'

#!/usr/bin/env roundup
#
# addlib test
#/ usage: rerun stubbs:test -m MODULE
#
# Author: Ines Neubach <ines.neubach@idn.astzweig.de>
#

# Include addlib file
# -----------------
MODULE="$(basename $(cd ..; pwd))";
LIB_PATH="${RERUN_MODULES}/${MODULE}/lib/add-functions.sh";
if [ ! -f ${LIB_PATH} ]; then
    exit;
fi

source ${LIB_PATH};

# The Plan
# --------

describe "addlib - addHostToFileIfNotExists"

it_stops_with_no_arguments() {
  local RETV;
  RETV="$(addHostToFileIfNotExists && echo $? || echo $?)";
  test ${RETV} -eq 30;
}

it_stops_with_filePath_not_existing() {
  local RETV DEST_FN="${MODULE}-notexistingfile1-$$.txt";
  test ! -f ${DEST_FN};
  trap "rm -f ${DEST_FN}" EXIT INT;

  RETV="$(addHostToFileIfNotExists "${DEST_FN}" && echo $? || echo $?)";
  test ! -f ${DEST_FN};
  test ${RETV} -eq 30;
}

it_works_with_existing_file() {
  local RETV DEST_FN="./${MODULE}-existingfile1-$$.txt";
  local HOST="www.example.dev example.dev" IP="127.0.0.1";
  local RESULTSTR="$(echo -e ${IP}\\$'t'${HOST})";
  [ ! -f "${DEST_FN}" ] && touch "${DEST_FN}";
  trap "rm -f ${DEST_FN}" EXIT INT;

  RETV="$(addHostToFileIfNotExists "${DEST_FN}" "${HOST}" "${IP}" && echo $? || echo $?)";
  test ${RETV} -eq 0;
  test "$(cat ${DEST_FN})" == "${RESULTSTR}";
}

error: pathspec 'tests/addlib-addHostToFileIfNotExists-1-test.sh' did not match any file(s) known to git


[openjpeg] Release cmake build type (#5209)

Seems that some bugs in openjpeg can be triggered only in release mode.
More specifically, I was trying to reproduce https://github.com/uclouvain/openjpeg/issues/1228 using the OSS-Fuzz harness and I failed.
I figured out that the bug is indeed reachable by the harness, but can be uncovered only in Release mode, otherwise, an assertion error blocks it.
I guess that they use assertions only in Debug mode (WTF) and remove them in Release.
So, IMO openjpeg should be fuzzed in Release mode as the configuration used in production is the one relevant for security.

#!/bin/bash -eu
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make clean -s
make -j$(nproc) -s
cd ..

./tests/fuzzers/build_google_oss_fuzzers.sh
./tests/fuzzers/build_seed_corpus.sh

#!/bin/bash -eu
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

mkdir build
cd build
cmake ..
make clean -s
make -j$(nproc) -s
cd ..

./tests/fuzzers/build_google_oss_fuzzers.sh
./tests/fuzzers/build_seed_corpus.sh


GIT rm files from history added

GIT rm files from history added

#!/bin/bash
set -o errexit

# Author: David Underhill
# Script to permanently delete files/folders from your git repository.  To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-delete-history path1 path2

if [ $# -eq 0 ]; then
    exit 0
fi

# make sure we're at the root of git repo
if [ ! -d .git ]; then
    echo "Error: must run this script from the root of a git repository"
    exit 1
fi

# remove all paths passed as arguments from the history of the repo
files=$@
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD

# remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && git reflog expire --all &&  git gc --aggressive --prune

error: pathspec 'git-rm-from-history.sh' did not match any file(s) known to git


Simple support script to gather libnetwork info

This script gathers some basic information from a system that might
be useful to help troubleshoot problems.  If added into an image
including the proper binaries, running looks something like this:

    docker run --rm \
        -v /var/run/docker.sock:/var/run/docker.sock \
        -v /var/run/docker/netns:/var/run/docker/netns \
        --privileged --net=host nwsupport /bin/support

Signed-off-by: Daniel Hiltgen <450e8eee12e8d348f09427c205cd53e1e4ff975a@docker.com>

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/vdemeester/libnetwork.git/'


Add IPv6 patterns to ignore list of host completion

#
# Sets completion options.
#
# Authors:
#   Robby Russell <robby@planetargon.com>
#   Sorin Ionescu <sorin.ionescu@gmail.com>
#

# Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then
  return 1
fi

# Load and initialize the completion system ignoring insecure directories.
autoload -Uz compinit && compinit -i

setopt COMPLETE_IN_WORD    # Complete from both ends of a word.
setopt ALWAYS_TO_END       # Move cursor to the end of a completed word.
setopt PATH_DIRS           # Perform path search even on command names with slashes.
setopt AUTO_MENU           # Show completion menu on a succesive tab press.
setopt AUTO_LIST           # Automatically list choices on ambiguous completion.
setopt AUTO_PARAM_SLASH    # If completed parameter is a directory, add a trailing slash.
unsetopt MENU_COMPLETE     # Do not autoselect the first completion entry.
unsetopt FLOW_CONTROL      # Disable start/stop characters in shell editor.

# Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>'

# Use caching to make completion for cammands such as dpkg and apt usable.
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "$HOME/.zcache"

# Case-insensitive (all), partial-word, and then substring completion.
if zstyle -t ':omz:completion:*' case-sensitive; then
  zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  setopt CASE_GLOB
else
  zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  unsetopt CASE_GLOB
fi

# Group matches and describe.
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' verbose yes

# Fuzzy match mistyped completions.
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric

# Increase the number of errors based on the length of the typed word.
zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)'

# Don't complete unavailable commands.
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'

# Array completion element sorting.
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters

# Directories
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
zstyle ':completion:*' squeeze-slashes true

# History
zstyle ':completion:*:history-words' stop yes
zstyle ':completion:*:history-words' remove-all-dups yes
zstyle ':completion:*:history-words' list false
zstyle ':completion:*:history-words' menu yes

# Environmental Variables
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}

# Populate hostname completion.
zstyle -e ':completion:*:hosts' hosts 'reply=(
  ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//,/ }
  ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
  ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'

# Don't complete uninteresting users...
zstyle ':completion:*:*:*:users' ignored-patterns \
  adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
  dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
  hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
  mailman mailnull mldonkey mysql nagios \
  named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
  operator pcap postfix postgres privoxy pulse pvm quagga radvd \
  rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*'

# ... unless we really want to.
zstyle '*' single-ignored show

# Ignore multiple entries.
zstyle ':completion:*:(rm|kill|diff):*' ignore-line other
zstyle ':completion:*:rm:*' file-patterns '*:all-files'

# Kill
zstyle ':completion:*:*:*:*:processes' command 'ps -u $USER -o pid,user,comm -w'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01'
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:*:kill:*' force-list always
zstyle ':completion:*:*:kill:*' insert-ids single

# Man
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true

# Media Players
zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
zstyle ':completion:*:*:mpg321:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG|flac):ogg\ files *(-/):directories'
zstyle ':completion:*:*:mocp:*' file-patterns '*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories'

# Mutt
if [[ -s ~/.mutt/aliases ]]; then
  zstyle ':completion:*:*:mutt:*' menu yes select
  zstyle ':completion:*:mutt:*' users ${${${(f)"$(<~/.mutt/aliases)"}#alias[[:space:]]}%%[[:space:]]*}
fi

# SSH/SCP/RSYNC
zstyle ':completion:*:(scp|rsync):*' tag-order 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order users 'hosts:-host:host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*(.|:)*' loopback ip6-loopback localhost ip6-localhost broadcasthost
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^[-[:alnum:]]##(.[-[:alnum:]]##)##' '*@*'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^(<->.<->.<->.<->|(|::)([[:xdigit:].]##:(#c,2))##(|%*))' '127.0.0.<->' '255.255.255.255' '::1' 'fe80::*'

#
# Sets completion options.
#
# Authors:
#   Robby Russell <robby@planetargon.com>
#   Sorin Ionescu <sorin.ionescu@gmail.com>
#

# Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then
  return 1
fi

# Load and initialize the completion system ignoring insecure directories.
autoload -Uz compinit && compinit -i

setopt COMPLETE_IN_WORD    # Complete from both ends of a word.
setopt ALWAYS_TO_END       # Move cursor to the end of a completed word.
setopt PATH_DIRS           # Perform path search even on command names with slashes.
setopt AUTO_MENU           # Show completion menu on a succesive tab press.
setopt AUTO_LIST           # Automatically list choices on ambiguous completion.
setopt AUTO_PARAM_SLASH    # If completed parameter is a directory, add a trailing slash.
unsetopt MENU_COMPLETE     # Do not autoselect the first completion entry.
unsetopt FLOW_CONTROL      # Disable start/stop characters in shell editor.

# Treat these characters as part of a word.
WORDCHARS='*?_-.[]~&;!#$%^(){}<>'

# Use caching to make completion for cammands such as dpkg and apt usable.
zstyle ':completion::complete:*' use-cache on
zstyle ':completion::complete:*' cache-path "$HOME/.zcache"

# Case-insensitive (all), partial-word, and then substring completion.
if zstyle -t ':omz:completion:*' case-sensitive; then
  zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  setopt CASE_GLOB
else
  zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
  unsetopt CASE_GLOB
fi

# Group matches and describe.
zstyle ':completion:*:*:*:*:*' menu select
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:corrections' format ' %F{green}-- %d (errors: %e) --%f'
zstyle ':completion:*:descriptions' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*:messages' format ' %F{purple} -- %d --%f'
zstyle ':completion:*:warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:*:default' list-prompt '%S%M matches%s'
zstyle ':completion:*' format ' %F{yellow}-- %d --%f'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' verbose yes

# Fuzzy match mistyped completions.
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric

# Increase the number of errors based on the length of the typed word.
zstyle -e ':completion:*:approximate:*' max-errors 'reply=($((($#PREFIX+$#SUFFIX)/3))numeric)'

# Don't complete unavailable commands.
zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec))'

# Array completion element sorting.
zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters

# Directories
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories
zstyle ':completion:*:*:cd:*:directory-stack' menu yes select
zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand'
zstyle ':completion:*' squeeze-slashes true

# History
zstyle ':completion:*:history-words' stop yes
zstyle ':completion:*:history-words' remove-all-dups yes
zstyle ':completion:*:history-words' list false
zstyle ':completion:*:history-words' menu yes

# Environmental Variables
zstyle ':completion::*:(-command-|export):*' fake-parameters ${${${_comps[(I)-value-*]#*,}%%,*}:#-*-}

# Populate hostname completion.
zstyle -e ':completion:*:hosts' hosts 'reply=(
  ${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) 2>/dev/null)"}%%[#| ]*}//,/ }
  ${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
  ${=${${${${(@M)${(f)"$(cat ~/.ssh/config 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}}
)'

# Don't complete uninteresting users...
zstyle ':completion:*:*:*:users' ignored-patterns \
  adm amanda apache avahi beaglidx bin cacti canna clamav daemon \
  dbus distcache dovecot fax ftp games gdm gkrellmd gopher \
  hacluster haldaemon halt hsqldb ident junkbust ldap lp mail \
  mailman mailnull mldonkey mysql nagios \
  named netdump news nfsnobody nobody nscd ntp nut nx openvpn \
  operator pcap postfix postgres privoxy pulse pvm quagga radvd \
  rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs '_*'

# ... unless we really want to.
zstyle '*' single-ignored show

# Ignore multiple entries.
zstyle ':completion:*:(rm|kill|diff):*' ignore-line other
zstyle ':completion:*:rm:*' file-patterns '*:all-files'

# Kill
zstyle ':completion:*:*:*:*:processes' command 'ps -u $USER -o pid,user,comm -w'
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;36=0=01'
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:*:kill:*' force-list always
zstyle ':completion:*:*:kill:*' insert-ids single

# Man
zstyle ':completion:*:manuals' separate-sections true
zstyle ':completion:*:manuals.(^1*)' insert-sections true

# Media Players
zstyle ':completion:*:*:mpg123:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
zstyle ':completion:*:*:mpg321:*' file-patterns '*.(mp3|MP3):mp3\ files *(-/):directories'
zstyle ':completion:*:*:ogg123:*' file-patterns '*.(ogg|OGG|flac):ogg\ files *(-/):directories'
zstyle ':completion:*:*:mocp:*' file-patterns '*.(wav|WAV|mp3|MP3|ogg|OGG|flac):ogg\ files *(-/):directories'

# Mutt
if [[ -s ~/.mutt/aliases ]]; then
  zstyle ':completion:*:*:mutt:*' menu yes select
  zstyle ':completion:*:mutt:*' users ${${${(f)"$(<~/.mutt/aliases)"}#alias[[:space:]]}%%[[:space:]]*}
fi

# SSH/SCP/RSYNC
zstyle ':completion:*:(scp|rsync):*' tag-order 'hosts:-host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:(scp|rsync):*' group-order users files all-files hosts-domain hosts-host hosts-ipaddr
zstyle ':completion:*:ssh:*' tag-order users 'hosts:-host hosts:-domain:domain hosts:-ipaddr:ip\ address *'
zstyle ':completion:*:ssh:*' group-order hosts-domain hosts-host users hosts-ipaddr
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-host' ignored-patterns '*.*' loopback localhost
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-domain' ignored-patterns '<->.<->.<->.<->' '^*.*' '*@*'
zstyle ':completion:*:(ssh|scp|rsync):*:hosts-ipaddr' ignored-patterns '^<->.<->.<->.<->' '127.0.0.<->'


Whitespace cleanups in redhat-common/build_lib.sh

#!/bin/bash
# This is sourced by the RHEL release specific build extras to provide common
# RHEL build functionality.

# OS information for the OS we are building crowbar on to.
OS_TOKEN="$OS-$OS_VERSION"
PKG_TYPE="rpms"
PKG_ALLOWED_ARCHES=("x86_64" "noarch")
CHROOT_PKGDIR="var/cache/yum"
CHROOT_GEMDIR="usr/lib/ruby/gems/1.8/cache"
OS_METADATA_PKGS="createrepo"
declare -A SEEN_RPMS

# we need extglobs, so enable them.
shopt -s extglob

# Have the chroot update its package metadata
chroot_update() { in_chroot /usr/bin/yum -y makecache; }

# Install some packages in the chroot environment.
chroot_install() {
    if [[ $1 ]]; then
        in_chroot /usr/bin/yum -y install "$@"
    fi
    in_chroot /usr/bin/yum -y update
}

# Fetch (but do not install) packages into the chroot environment
chroot_fetch() {
    if [[ $1 ]]; then
        in_chroot /usr/bin/yum -y --downloadonly install "$@" || :
    fi
    in_chroot /usr/bin/yum -y update
}

# Make a repository file in the chroot environment.  We use this when we get a URL
# from one of the packages files (as opposed to an RPM that contains repo info.
make_repo_file() {
    # $1 = name of repo
    # $2 = Priority
    # $3 = URL
    local repo=$(mktemp "/tmp/repo-$1-XXXX.repo")
    cat >"$repo" <<EOF
[$1]
name=Repo for $1
baseurl=$3
priority=$2
enabled=1
gpgcheck=0
EOF
    sudo cp "$repo" "$CHROOT/etc/yum.repos.d/"
    rm "$repo"
}

# Add repositories to the chroot environment.
# This also add proxy information if needed.
add_repos() {
    for repo in "$@"; do
        rtype="${repo%% *}"
        rdest="${repo#* }"
        case $rtype in
            rpm) rdest="${rdest#* }"
                f="$(mktemp /tmp/tmp-XXXXXX.rpm)"
                curl -o "$f" "$rdest"
                sudo cp "$f" "$CHROOT/tmp"
                rm "$f"
                in_chroot /bin/rpm -Uvh "$f";;
            bare) make_repo_file $rdest;;
        esac
    done
    [[ $USE_PROXY = "1" ]] || return 0
    (   cd "$CHROOT"
        for f in etc/yum.repos.d/*; do
            [[ -f "$f" ]] || continue
            in_chroot /bin/grep -q '^proxy=' "/$f" && continue
            in_chroot /bin/grep -q '^baseurl=http://.*127\.0\.0\.1.*' "/$f" && \
                continue
            in_chroot sed -i "/^name/ a\proxy=http://$PROXY_HOST:$PROXY_PORT" "$f"
            [[ $PROXY_USER ]] && \
                in_chroot sed -i "/^proxy/ a\proxy_username=$PROXY_USER" "$f"
            [[ $PROXY_PASSWORD ]] && \
                in_chroot sed -i "^/proxy_username/ a\proxy_password=$PROXY_PASSWORD" "$f"
            : ;
        done
    )
}

# Check to see if something is a valid RPM package name.
is_pkg() { [[ $1 = *.rpm ]]; }

__barclamp_pkg_metadata_needs_update() (
    cd "$CACHE_DIR/barclamps/$1/$OS_TOKEN/pkgs"
    [[ -d repodata ]] || return 0
    while read fname; do
        [[ $fname -nt repodata ]] && return 0
    done < <(find . -name '*.rpm' -type f)
    return 1
)

__make_barclamp_pkg_metadata () {
    in_chroot /bin/bash -c "cd /mnt; createrepo -d -q ."
    sudo chown -R "$(whoami)" "$CACHE_DIR/barclamps/$bc/$OS_TOKEN/pkgs"
    touch "$CACHE_DIR/barclamps/$bc/$OS_TOKEN/pkgs/repodata"
    if [[ $CURRENT_CACHE_BRANCH ]]; then
        CACHE_NEEDS_COMMIT=true
        in_cache git add "barclamps/$bc/$OS_TOKEN/pkgs/repodata"
    fi
}

add_offline_repos() (
    in_chroot mkdir -p /etc/yum.repos.d
    for bc in "${BARCLAMPS[@]}"; do
        [[ -d $CACHE_DIR/barclamps/$bc/$OS_TOKEN/pkgs/repodata ]] || continue
        sudo mkdir -p "$CHROOT/packages/barclamps/$bc"
        sudo mount --bind "$CACHE_DIR/barclamps/$bc/$OS_TOKEN/pkgs" \
            "$CHROOT/packages/barclamps/$bc"
        make_repo_file "barclamp-$bc" 99 "file:///packages/barclamps/$bc"
    done
)

# This function makes a functional centos chroot environment.
# We do this so that we can build an install DVD that has Crowbar staged
# on it without having to have a handy Redhat/CentOS environment to build from.
# It also makes sure that even if we do, we don't inadvertently wind up installing
# packages on the build system by mistake.
__make_chroot() {
    postcmds=()
    # Install basic packages.
    for pkg in "${OS_BASIC_PACKAGES[@]}"; do
        for f in "$(find_cd_pool)/$pkg"-[0-9]*+(noarch|x86_64).rpm; do
            rpm2cpio "$f" | \
                (cd "$CHROOT"; sudo cpio --extract \
                --make-directories --no-absolute-filenames \
                --preserve-modification-time)
        done
        if [[ $pkg =~ (centos|redhat)-release ]]; then
            sudo mkdir -p "$CHROOT/tmp"
            sudo cp "$f" "$CHROOT/tmp/${f##*/}"
            postcmds+=("/bin/rpm -ivh --force --nodeps /tmp/${f##*/}")
        fi
    done
    # install priorities support
    mkdir -p "$CACHE_DIR/$OS_TOKEN/pkgs"
    [[ -f $CACHE_DIR/$OS_TOKEN/pkgs/$PRIORITIES_RPM ]] || \
        curl -o "$CACHE_DIR/$OS_TOKEN/pkgs/$PRIORITIES_RPM" \
        "$PRIORITIES_HTTP"
    rpm2cpio "$CACHE_DIR/$OS_TOKEN/pkgs/$PRIORITIES_RPM" | \
        ( cd "$CHROOT"; sudo cpio --extract \
                --make-directories --no-absolute-filenames \
                --preserve-modification-time)
    # fix up the chroot to make sure we can use it
    sudo cp /etc/resolv.conf "$CHROOT/etc/resolv.conf"
    sudo rm -f "$CHROOT/etc/yum.repos.d/"*

    for d in proc sys dev dev/pts; do
        mkdir -p "$CHROOT/$d"
        sudo mount --bind "/$d" "$CHROOT/$d"
    done
    # third, run any post cmds we got earlier
    for cmd in "${postcmds[@]}"; do
        in_chroot $cmd
    done
    # Work around packages we don't have, but that the yum bootstrap
    # will grab for us.
    in_chroot mkdir -p "/usr/lib/python2.4/site-packages/urlgrabber.broke"
    for f in "$CHROOT/usr/lib/python2.4/site-packages/urlgrabber/keepalive"*; do
        in_chroot mv "${f#$CHROOT}" \
            "/usr/lib/python2.4/site-packages/urlgrabber.broke/"
    done
    # Make sure yum does not throw away our caches for any reason.
    in_chroot /bin/sed -i -e '/keepcache/ s/0/1/' /etc/yum.conf
    in_chroot /bin/bash -c "echo 'exclude = *.i?86' >>/etc/yum.conf"

    [[ $USE_PROXY = "1" ]] && (
        cd "$CHROOT"
        for f in etc/yum.repos.d/*; do
            [[ -f "$f" ]] || continue
            in_chroot /bin/grep -q '^proxy=' "/$f" && continue
            in_chroot /bin/grep -q '^baseurl=http://.*127\.0\.0\.1.*' "/$f" && \
                continue
            in_chroot sed -i "/^name/ a\proxy=http://$PROXY_HOST:$PROXY_PORT" "$f"
            [[ $PROXY_USER ]] && \
                in_chroot sed -i "/^proxy/ a\proxy_username=$PROXY_USER" "$f"
            [[ $PROXY_PASSWORD ]] && \
                in_chroot sed -i "^/proxy_username/ a\proxy_password=$PROXY_PASSWORD" "$f"
            : ;
        done
    )
    # Make sure that the bootstrap only uses local data off the install DVD.
    in_chroot mv /etc/yum.repos.d /etc/yum.repos.d.old
    in_chroot mkdir -p /etc/yum.repos.d/
    in_chroot mkdir -p /packages/base
    sudo mount --bind "$IMAGE_DIR" "$CHROOT/packages/base"
    make_repo_file redhat-base 99 "file:///packages/base/$OS_REPO_POOL"
    # have yum bootstrap everything else into usefulness
    in_chroot yum -y install yum yum-downloadonly createrepo
    # Once we have the chroot bootstrapped, restore the CentOS repos.
    # If we are using a proxy, fastestmirror usually does the Wrong Thing.
    [[ $USE_PROXY = 1 && \
        -f $CHROOT/etc/yum/pluginconf.d/fastestmirror.conf ]] && \
        in_chroot sed -ie '/^enabled/ s/1/0/' \
        /etc/yum/pluginconf.d/fastestmirror.conf
    if [[ $ALLOW_CACHE_UPDATE = true ]]; then
        in_chroot /bin/bash -c 'cp /etc/yum.repos.d.old/* /etc/yum.repos.d'
    fi
}

# Extract version information from an RPM file
rpmver() {
    [[ -f $1 && $1 = *.rpm ]] || die "$1 is not an rpm!"
    if [[ ! ${SEEN_RPMS["${1##*/}"]} ]]; then
        local ver=$(rpm --queryformat \
            '%{NAME}-%{ARCH} %{EPOCH}:%{VERSION}-%{RELEASE}' \
            --nodigest --nosignature -qp "$1")
        SEEN_RPMS["${1##*/}"]="${ver// (none):/ }"
    fi
    echo "${SEEN_RPMS["${1##*/}"]}"
}

# Get a package name in the form of $name-$arch
pkg_name() {
    local res="$(rpmver "$1")"
    echo "${res% *}"
}

# Check to see if package $1 is more recent than package $2
pkg_cmp() {
    # $1 = RPM 1
    # $2 = RPM 2
    local rpm1=$(rpmver "$1") rpm2="$(rpmver "$2")"
    [[ ${rpm1% *} = ${rpm2% *} ]] || \
        die "$1 and $2 do not reference the same package!"
    vercmp "${rpm1#* }" "${rpm2#* }"
}

# Copy our isolinux bits into place and append our kickstarts into the initrds.
final_build_fixups() {
    # Copy our isolinux files.
    debug "Updating the isolinux boot information"
    mv "$BUILD_DIR/extra/isolinux" "$BUILD_DIR"
    # Add our kickstart files into the initrd images.
    debug "Adding our kickstarts to the initrd images."
    (cd "$IMAGE_DIR"; find -name initrd.img |cpio -o) | \
        (cd "$BUILD_DIR"; cpio -i --make-directories)
    chmod -R u+rw "$BUILD_DIR"
    (cd "$BUILD_DIR/extra"; find . -name '*.ks' | \
        cpio --create --format=newc 2>/dev/null | \
                gzip -9 > "initrd.img.append"
        cat "initrd.img.append" >> "../isolinux/initrd.img"
        cat "initrd.img.append" >> "../images/pxeboot/initrd.img")
}

generate_minimal_install() { : ; }

# Check to make sure our required commands are installed.
for cmd in rpm; do
    which "$cmd" &>/dev/null || \
        die 1 "Please install $cmd before trying to build Crowbar."
done


add script to run all test cases

add script to run all test cases

Signed-off-by: Lucas Cordeiro <0991a736ff71ac851dd9d4ccd1fc11e28a454326@gmail.com>

#!/bin/bash

MODULES="closed-loop digital-system white-box"

echo ""
echo "Script DSVerifier Started:" $(date +"%T")
echo ""

for module in $MODULES; do
  echo "============================== "
  echo -n "Running" $module...
  START=$(date +"%s")
  cd $module
  make
  END=$(date +"%s")
  echo "Done!"
  make clean > /dev/null
  cd ..
  echo "Time elapsed: " $(( $END - $START )) "s"
  echo "Time elapsed: " $(( $END - $START )) "s"
done
echo "============================== "

echo ""
echo "Script DSVerifier Ended:" $(date +"%T")
echo ""

error: pathspec 'regression/cbmc/run-all.sh' did not match any file(s) known to git


added vm test image script

added vm test image script

#!/bin/bash

set -ex

wget http://files.pharo.org/vm/src/vm-test-image-20.zip
unzip vm-test-image-20.zip -d vm-test-image

PHARO_IMAGE=`find vm-test-image -name \*.image`

echo $PHARO_IMAGE

error: pathspec 'image/newVMTestImage.sh' did not match any file(s) known to git


Support reddit static urls, and add extra detection for failed image extraction

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/taeram/reddit-update-wallpaper.git/'


Builds, creates war and copies the war to the webapps of the tomcat.

#!/bin/bash

PROJECT_LOC=`pwd`

echo "Setting up the environment variables"

export JAVA_HOME_15=/home/shazra/jdk1.5.0_22
export JAVA_HOME_16=/home/shazra/jdk1.6.0_45
export JAVA_HOME_17=/home/shazra/jdk1.7.0_72
export JAVA_HOME=/home/shazra/jdk1.5.0_22
export ANT_HOME=/usr/bin/ant

cd $PROJECT_LOC
echo "Current directory" `pwd`
ant war

if [ $? -eq 0 ]; then
	echo "Building Mondrian is successful"
fi

echo "--------- Download tomcat----------"
wget "http://mirror.dkd.de/apache/tomcat/tomcat-8/v8.0.21/bin/apache-tomcat-8.0.21-deployer.tar.gz"

tar -xvzf apache-tomcat-8.0.21-deployer.tar.gz

error: pathspec 'infrastructure_build.sh' did not match any file(s) known to git


Updating Bamboo Agent to v4.5

Updating Bamboo Agent to v4.5

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/blinkreaction/elastic-bamboo-agent.git/'


dependency installation script added

dependency installation script added

pip install theano --user
pip install keras --user
pip install lasagne --user

error: pathspec 'install_dependencies.sh' did not match any file(s) known to git


removed activate.sh

removed activate.sh

# Run alias
alias run='python run.py'

# Git commit hook
if [ ! -f .git/hooks/pre-commit ]; then
    echo -e "#!/bin/sh\n\n\npython run.py check" > .git/hooks/pre-commit
    chmod +x .git/hooks/pre-commit
fi

# Python env
virtualenv venv
source venv/bin/activate
python run.py install


Remove trailing whitespace

Remove trailing whitespace

# activate.sh
# Sets up the shell environment.

# Get absolute path of this directory. Below snippet from
# stackoverflow.com/questions/59895:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do
  THIS_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$THIS_DIR/$SOURCE"
done

export DOTFILES="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

function ,path-add() {
    # usage: ,path-add [--prepend] [<directories>]
    #
    # Adds current directory or given directories to path. If --prepend not
    # given, directories are appended.
    #
    # Also updates $_OLD_VIRTUAL_PATH set by Python's virtualenv, so that path
    # changes persist through a venv deactivate command.

    if [[ $1 = "--prepend" ]]; then
        prepend=true
        paths=(${@:2})
    else
        prepend=false
        paths=($@)
    fi

    if [ -z "$paths" ]; then
        paths[0]=$PWD
    fi

   for path in "${paths[@]}"; do

       # Ignore paths that don't exist
       if [ ! -f "$path" ] && [ ! -d "$path" ]; then
           continue
        fi

        fullpath="$(cd "$path"; echo $PWD)"

        if [[ ":$PATH:" != *":$fullpath:"* ]]; then

            if [[ "$prepend" = true ]]; then
                export PATH="$fullpath:$PATH"
                export _OLD_VIRTUAL_PATH="$fullpath:$PATH"
            else
                export PATH="$PATH:$fullpath"
                export _OLD_VIRTUAL_PATH="$PATH:$fullpath"
            fi
        fi
    done
}

function ,dotfiles-ls {
    # In numerical order, list paths ending in .dot.xx.sh, then list paths
    # ending in .dot.sh.

    if [[ $(uname -a) == *Darwin* ]]; then
        find_re="find -E $DOTFILES -regex"
    else
        find_re="find $DOTFILES -regextype posix-extended -regex"
    fi

    for f in $($find_re ".+\.dot\.[0-9][0-9]\.sh" | sort -t "." -k 2); do
        echo $f
    done

    for f in $(find $DOTFILES -name "*.dot.sh"); do
        echo "$f"
    done
}

,path-add $(find $DOTFILES -type d -name bin)

for f in $(,dotfiles-ls); do
    source "$f"
done


[base-builder-rust] Make install_rust.sh executable. (#6354)

#!/bin/bash -eux
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

curl https://sh.rustup.rs | sh -s -- -y --default-toolchain=nightly --profile=minimal
cargo install cargo-fuzz && rm -rf /rust/registry
# Needed to recompile rust std library for MSAN
rustup component add rust-src --toolchain nightly


Update jdk.6.install.sh

Update jdk.6.install.sh

#!/bin/sh
###
# jdk.6.install.sh
# https://github.com/furplag/linux-config-tips
# Copyright 2016 furplag
# Licensed under MIT (https://github.com/furplag/linux-config-tips/blob/master/LICENSE)

# Automatically setting up to use Java.
# 1. Downloading JDK only use command-line.
# 2. Does not remove previous version of JDK, if "yum update jdk" runs.
# 3. Set "alternatives" for JDK.
# 4. Set $JAVA_HOME (relate to alternatives config).

# variables
resourceURL="http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin"
resource=`echo $resourceURL | sed -e "s/^.*\///"`
installVer=`echo $resource | cut -d "-" -f 2 | cut -d "u" -f 1`
installUVer=`echo $resource | cut -d "-" -f 2 | cut -d "u" -f 2`
installJDK=1.$installVer.0_$installUVer
installRoot=/usr/java
priority=`echo $installJDK | sed -e "s/[\.]//g" | sed -e "s/_/0/"`

if [ ! ${EUID:-${UID}} = 0 ]; then echo -e "Permission Denied, Root user only.\nHint: sudo ${0}"; exit 0; fi

echo -e "Oracle JDK ${installVer}u${installUVer} install with \"alternatives java\".\n"

echo -e "\n  # Checking installed package named \"jdk\".\n"
if [ "${conflictPackage=$(rpm -qa jdk | grep x86_64)}" ]; then
  conflictJDK=`echo $conflictPackage | cut -d "-" -f 2`
  conflictVer=`echo $conflictJDK | cut -d "." -f 2`
  conflictUVer=`echo $conflictJDK | cut -d "_" -f 2`
  if [ $installJDK = $conflictJDK ]; then
    echo "    JDK ${conflictVer}u${conflictUVer} already installed."
  elif [ 6 -gt $conflictVer ]; then
    echo "    Ah, we have encountered Prehistoric JDK now !\n"
  elif [ $installVer -gt $conflictVer ]; then
    echo "    previous version of JDK ${conflictVer}u${conflictUVer} has installed."
  elif [ $installVer -lt $conflictVer ]; then
    echo "    newer version of JDK ${conflictVer}u${conflictUVer} has installed."
  elif [ $installVer -eq $conflictVer ]; then
    if [ $installUVer -gt $conflictUVer ]; then
      echo "    previous version of JDK ${conflictVer}u${conflictUVer} has installed."
    else
      echo "    newer version of JDK ${conflictVer}u${conflictUVer} has installed."
    fi
  else
    echo "    newer version of JDK ${conflictVer}u${conflictUVer} has installed."
  fi
fi

if [ $conflictPackage ]; then
  if [ $installJDK = $conflictJDK ]; then
    resourceURL=
  elif [ $installVer -eq $conflictVer ]; then
    if [ $installUVer -gt $conflictUVer ]; then
      echo "    update JDK ${conflictVer}u${conflictUVer} to JDK ${installVer}u${installUVer}."
    else
      echo "    does not install JDK ${installVer}u${installUVer}."
      resourceURL=
    fi
  elif [ $installVer -gt $conflictVer ]; then
    echo "    escaping prehistoric version of JDK ..."
    tar cfz /tmp/stealth.jdk.tar.gz /usr/java/jdk1.[0-$conflictVer]* >/dev/null 2>&1
  else
    resourceURL=`echo $resourceURL | sed -e "s/\-rpm//"`
    resource=`echo $resource | sed -e "s/\-rpm//"`
  fi
elif [ -e /usr/java/jdk$installJDK ]; then
  echo "    JDK ${installVer}u${installUVer} (not managed package) already installed."
  resourceURL=
fi

if [ "${resource}" ] && [ "${resourceURL}" ]; then
  echo -e "\n  # Download Oracle JDK ${installVer}.\n"
    wget $resourceURL \
      --no-check-certificate \
      --no-cookies \
      --header "Cookie: oraclelicense=accept-securebackup-cookie" \
      -qNO /tmp/$resource
  if [ -e /tmp/$resource ] && [ `echo $resource | grep -e "\.bin$" | wc -l` -gt 0 ]; then
    echo "    unpacking ${resource} ..."
    chmod +x /tmp/$resource
    if [ `echo $resource | grep -e "\-rpm"` ]; then
      installSource=`unzip -l /tmp/$resource -x sun-javadb* 2>/dev/null | grep rpm | grep -v -e "${resource}$" | sed -e "s/.*\s//"`
      unzip -o /tmp/$resource -d /tmp -x sun-javadb* >/dev/null 2>&1
    else
      /tmp/$resource -x >/dev/null 2>&1
      installSource="jdk${installJDK}"
      if [ -e "${installSource}" ]; then
        mv $installSource /tmp
      else
        installSource=
      fi
    fi
  elif [ -e /tmp/$resource ]; then
    installSource=$resource
  fi
fi

if [ "${installSource}" ] && [ -e /tmp/$installSource ]; then
  echo -e "\n  # Install JDK package.\n"
  if [ `echo $installSource | grep -e "rpm$" | wc -l` -gt 0 ]; then
    yum install -y /tmp/$installSource >/dev/null 2>&1
  else
    [ ! -e /usr/java ] && mkdir /usr/java
    mv /tmp/$installSource /usr/java/$installSource
  fi
fi

if [ -e /usr/java/jdk$installJDK/bin/java ] || \
   [ -e /usr/java/jdk$conflictJDK/bin/java ]; then
  wget https://raw.githubusercontent.com/furplag/linux-config-tips/master/rhel/java/jdk.$installVer.alternatives.sh \
    -qNO /tmp/jdk.$installVer.alternatives.sh && \
    chmod +x /tmp/jdk.$installVer.alternatives.sh
  if [ -e /usr/java/jdk$installJDK/bin/java ]; then
    /tmp/jdk.$installVer.alternatives.sh "${installJDK}" && \
    alternatives --set java /usr/java/jdk$installJDK/bin/java
  else
    /tmp/jdk.$installVer.alternatives.sh "${conflictJDK}" && \
    alternatives --set java /usr/java/jdk$conflictJDK/bin/java
  fi
  [ ! -e /etc/profile.d/java.sh ] && \
  echo -e "\n  # Set Environment \$JAVA_HOME (relate to alternatives config).\n"
  cat <<_EOT_ > /etc/profile.d/java.sh
# Set Environment with alternatives for Java VM.
export JAVA_HOME=\$(readlink /etc/alternatives/java | sed -e 's/\/bin\/java//g')
_EOT_
  [ -e /etc/profile.d/java.sh ] && \
    source /etc/profile.d/java.sh
fi

echo -e "\n  # Cleanup ...\n"
rm -rf /tmp/$resource /tmp/$installSource /tmp/jdk.$installVer.alternatives.sh >/dev/null 2>&1

if [ "${conflictPackage}" ] && \
   [ $installVer -eq $conflictVer ] && \
   [ $installUVer -gt $conflictUVer ]; then
  alternatives --remove java /usr/java/jdk$conflictJDK/bin/java >/dev/null 2>&1
fi

[ -e /tmp/stealth.jdk.tar.gz ] && \
  tar zxf /tmp/stealth.jdk.tar.gz -C /usr/java --strip=2 && \
  rm -rf /tmp/stealth.jdk.tar.gz

if [ -e /usr/java/jdk$installJDK ]; then
  echo -e "\n# Now complete to setting JDK ${installVer}u${installUVer}.\n"
  java -version
  [ "${JAVA_HOME}" ] && echo -e "JAVA_HOME:${JAVA_HOME}"
elif [ -e /usr/java/jdk$conflictJDK ]; then
  echo -e "\n# Now complete to setting JDK ${conflictVer}u${conflictUVer} (not changed).\n"
  java -version
  [ "${JAVA_HOME}" ] && echo -e "JAVA_HOME:${JAVA_HOME}"
else
  echo -e "\n# Install failed."
  [ `java -version 2>/dev/null | wc -l` -gt 0 ] && java -version
  [ "${JAVA_HOME}" ] && echo -e "JAVA_HOME:${JAVA_HOME}"
fi
[ -e /etc/alternatives/java ] && \
  echo -e "alternatives java:\n`alternatives --display java | grep -e "^\/usr\/java/.*\/bin\/java"`\n"
[ -e /etc/profile.d/java.sh ] && \
  echo -e "usage:\n# alternatives --config java && source /etc/profile\n"

#!/bin/sh
###
# jdk.6.install.sh
# https://github.com/furplag/linux-config-tips
# Copyright 2016 furplag
# Licensed under MIT (https://github.com/furplag/linux-config-tips/blob/master/LICENSE)

# Automatically setting up to use Java.
# 1. Downloading JDK only use command-line.
# 2. Does not remove previous version of JDK, if "yum update jdk" runs.
# 3. Set "alternatives" for JDK.
# 4. Set $JAVA_HOME (relate to alternatives config).

# variables
resourceURL="http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64-rpm.bin"
resource=`echo $resourceURL | sed -e "s/^.*\///"`
installVer=`echo $resource | cut -d "-" -f 2 | cut -d "u" -f 1`
installUVer=`echo $resource | cut -d "-" -f 2 | cut -d "u" -f 2`
installJDK=1.$installVer.0_$installUVer
installRoot=/usr/java
priority=`echo $installJDK | sed -e "s/[\.]//g" | sed -e "s/_/0/"`

if [ ! ${EUID:-${UID}} = 0 ]; then echo -e "Permission Denied, Root user only.\nHint: sudo ${0}"; exit 0; fi

echo -e "Oracle JDK ${installVer}u${installUVer} install with \"alternatives java\".\n"

echo -e "\n  # Checking installed package named \"jdk\".\n"
if [ "${conflictPackage=$(rpm -qa jdk | grep x86_64)}" ]; then
  conflictJDK=`echo $conflictPackage | cut -d "-" -f 2`
  conflictVer=`echo $conflictJDK | cut -d "." -f 2`
  conflictUVer=`echo $conflictJDK | cut -d "_" -f 2`
  if [ $installJDK = $conflictJDK ]; then
    echo "    JDK ${conflictVer}u${conflictUVer} already installed."
  elif [ 6 -gt $conflictVer ]; then
    echo "    Ah, we have encountered Prehistoric JDK now !\n"
  elif [ $installVer -gt $conflictVer ]; then
    echo "    previous version of JDK ${conflictVer}u${conflictUVer} has installed."
  elif [ $installVer -lt $conflictVer ]; then
    echo "    newer version of JDK ${conflictVer}u${conflictUVer} has installed."
  elif [ $installVer -eq $conflictVer ]; then
    if [ $installUVer -gt $conflictUVer ]; then
      echo "    previous version of JDK ${conflictVer}u${conflictUVer} has installed."
    else
      echo "    newer version of JDK ${conflictVer}u${conflictUVer} has installed."
    fi
  else
    echo "    newer version of JDK ${conflictVer}u${conflictUVer} has installed."
  fi
fi

if [ $conflictPackage ]; then
  if [ $installJDK = $conflictJDK ]; then
    resourceURL=
  elif [ $installVer -eq $conflictVer ]; then
    if [ $installUVer -gt $conflictUVer ]; then
      echo "    update JDK ${conflictVer}u${conflictUVer} to JDK ${installVer}u${installUVer}."
    else
      echo "    does not install JDK ${installVer}u${installUVer}."
      resourceURL=
    fi
  elif [ $installVer -gt $conflictVer ]; then
    echo "    escaping prehistoric version of JDK ..."
    tar cfz /tmp/stealth.jdk.tar.gz /usr/java/jdk1.[0-$conflictVer]* >/dev/null 2>&1
  else
    resourceURL=`echo $resourceURL | sed -e "s/\-rpm//"`
    resource=`echo $resource | sed -e "s/\-rpm//"`
  fi
elif [ -e /usr/java/jdk$installJDK ]; then
  echo "    JDK ${installVer}u${installUVer} (not managed package) already installed."
  resourceURL=
fi

if [ "${resource}" ] && [ "${resourceURL}" ]; then
  echo -e "\n  # Download Oracle JDK ${installVer}.\n"
    wget $resourceURL \
      --no-check-certificate \
      --no-cookies \
      --header "Cookie: oraclelicense=accept-securebackup-cookie" \
      -qNO /tmp/$resource
  if [ -e /tmp/$resource ] && [ `echo $resource | grep -e "\.bin$" | wc -l` -gt 0 ]; then
    echo "    unpacking ${resource} ..."
    chmod +x /tmp/$resource
    if [ `echo $resource | grep -e "\-rpm"` ]; then
      installSource=`unzip -l /tmp/$resource -x sun-javadb* 2>/dev/null | grep rpm | grep -v -e "${resource}$" | sed -e "s/.*\s//"`
      unzip -o /tmp/$resource -d /tmp -x sun-javadb* >/dev/null 2>&1
    else
      /tmp/$resource -x >/dev/null 2>&1
      installSource="jdk${installJDK}"
      if [ -e "${installSource}" ]; then
        mv $installSource /tmp
      else
        installSource=
      fi
    fi
  elif [ -e /tmp/$resource ]; then
    installSource=$resource
  fi
fi

if [ "${installSource}" ] && [ -e /tmp/$installSource ]; then
  echo -e "\n  # Install JDK package.\n"
  if [ `echo $installSource | grep -e "rpm$" | wc -l` -gt 0 ]; then
    yum install -y /tmp/$installSource >/dev/null 2>&1
  else
    [ ! -e /usr/java ] && mkdir /usr/java
    mv /tmp/$installSource /usr/java/$installSource
  fi
fi

if [ -e /usr/java/jdk$installJDK/bin/java ] || \
   [ -e /usr/java/jdk$conflictJDK/bin/java ]; then
  wget https://raw.githubusercontent.com/furplag/linux-config-tips/master/rhel/jdk.$installVer.alternatives.sh \
    -qNO /tmp/jdk.$installVer.alternatives.sh && \
    chmod +x /tmp/jdk.$installVer.alternatives.sh
  if [ -e /usr/java/jdk$installJDK/bin/java ]; then
    /tmp/jdk.$installVer.alternatives.sh "${installJDK}" && \
    alternatives --set java /usr/java/jdk$installJDK/bin/java
  else
    /tmp/jdk.$installVer.alternatives.sh "${conflictJDK}" && \
    alternatives --set java /usr/java/jdk$conflictJDK/bin/java
  fi
  [ ! -e /etc/profile.d/java.sh ] && \
  echo -e "\n  # Set Environment \$JAVA_HOME (relate to alternatives config).\n"
  cat <<_EOT_ > /etc/profile.d/java.sh
# Set Environment with alternatives for Java VM.
export JAVA_HOME=\$(readlink /etc/alternatives/java | sed -e 's/\/bin\/java//g')
_EOT_
  [ -e /etc/profile.d/java.sh ] && \
    source /etc/profile.d/java.sh
fi

echo -e "\n  # Cleanup ...\n"
rm -rf /tmp/$resource /tmp/$installSource /tmp/jdk.$installVer.alternatives.sh >/dev/null 2>&1

if [ "${conflictPackage}" ] && \
   [ $installVer -eq $conflictVer ] && \
   [ $installUVer -gt $conflictUVer ]; then
  alternatives --remove java /usr/java/jdk$conflictJDK/bin/java >/dev/null 2>&1
fi

[ -e /tmp/stealth.jdk.tar.gz ] && \
  tar zxf /tmp/stealth.jdk.tar.gz -C /usr/java --strip=2 && \
  rm -rf /tmp/stealth.jdk.tar.gz

if [ -e /usr/java/jdk$installJDK ]; then
  echo -e "\n# Now complete to setting JDK ${installVer}u${installUVer}.\n"
  java -version
  [ "${JAVA_HOME}" ] && echo -e "JAVA_HOME:${JAVA_HOME}"
elif [ -e /usr/java/jdk$conflictJDK ]; then
  echo -e "\n# Now complete to setting JDK ${conflictVer}u${conflictUVer} (not changed).\n"
  java -version
  [ "${JAVA_HOME}" ] && echo -e "JAVA_HOME:${JAVA_HOME}"
else
  echo -e "\n# Install failed."
  [ `java -version 2>/dev/null | wc -l` -gt 0 ] && java -version
  [ "${JAVA_HOME}" ] && echo -e "JAVA_HOME:${JAVA_HOME}"
fi
[ -e /etc/alternatives/java ] && \
  echo -e "alternatives java:\n`alternatives --display java | grep -e "^\/usr\/java/.*\/bin\/java"`\n"
[ -e /etc/profile.d/java.sh ] && \
  echo -e "usage:\n# alternatives --config java && source /etc/profile\n"


Added files via upload

Added files via upload

#!/bin/bash
#
# $Id$
# check_rcs.sh
# vi: set ts=4 sw=4 ai:	#
# Script to check for locked RCS files older than x number of days

DAYS=14

### Main Script Starts Here ###

# Current time EPOCH
TODAY=$(date +%s)

MAXTIME=$((DAYS*86400))

for rcsfile in $(find . -type f -name '*,v')
do
	LOCKER=$(rlog -L $rcsfile | grep -i "locked by")
	rv=$?
	if [ $rv -eq 0 ]; then
		CHANGED=$(stat -f %m -t %s)
		TIMELOCKED=$((TODAY-CHANGED))
		DAYSLOCKED=$((TIMELOCKED/86400))
		if [ "$TIMELOCKED" -gt "$MAXTIME" ]; then
			echo "RCS File $rcsfile locked for $DAYSLOCKED days."
		fi
	fi
done

error: pathspec 'nsr/check_rcs.sh' did not match any file(s) known to git


update bash script to install utils

update bash script to install utils

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/alpenliebe/Sortable.git/'