]> andersk Git - test.git/blame - commit
Initial version of code that allows users to interactively select from
[test.git] / commit
CommitLineData
3a0490f9
MG
1#!/bin/bash -e
2
3trap 'tput bel || :; echo Failed! >&2' EXIT
4
5yes_no() {
6 local c
7 while :; do
8 c="$(set +e
9 trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT
10 stty -echo iuclc -icanon 2>/dev/null
11 dd count=1 bs=1 2>/dev/null | od -An -tx1)"
12 case "$c" in
13 " 0a") if [ -n "$1" ]; then
14 [ $1 -eq 0 ] && echo "Y" || echo "N"
15 return $1
16 fi
17 ;;
18 " 79") echo "Y"
19 return 0
20 ;;
21 " 6e") echo "N"
22 return 1
23 ;;
24 "") echo "Aborted" >&2
25 exit 1
26 ;;
27 *) # The user pressed an unrecognized key. As we are not echoing
28 # any incorrect user input, alert the user by ringing the bell.
29 (tput bel) 2>/dev/null || :
30 ;;
31 esac
32 done
33}
34
35test -r configure.ac
36svn update
c593cf68 37{
3a0490f9 38rev=$(($(svn info | sed -e 's/^Revision: \(.*\)/\1/;t1;d;:1;q')+1))
c593cf68 39} 2>/dev/null
3a0490f9
MG
40prj="$(sed -e 's/^AC_INIT(\([^,]*\),.*/\1/;t1;d;:1;q' configure.ac)"
41ver="$(sed -e 's/^AC_INIT([^,]*, *\([^,]*\),.*/\1/;t1;d;:1;q' configure.ac)"
42sed -ie 's/^\(VCS_REVISION=\).*/\1'"${rev}"'/' configure.ac
1cfd1ec8 43touch shellinabox/vt100.jspp shellinabox/shell_in_a_box.jspp
3a0490f9
MG
44make all distcheck
45( trap 'rm -rf "${prj}-${ver}"' EXIT
46 rm -f "${prj}-${ver}" &&
47 tar zfx "${prj}-${ver}.tar.gz" &&
48 cd "${prj}-${ver}" &&
c593cf68 49 fakeroot dpkg-buildpackage -us -uc &&
3a0490f9
MG
50 cd .. &&
51 rm -f $(ls "${prj}_${ver}-"*.* | egrep -v '.deb$') ) || :
52svn diff $(svn st |
53 egrep -v ' configure$| aclocal.m4$|^[?]' |
54 sed -e 's/^[^ ]* *//') | less
55echo -n 'Commit these changes (Y/n): '
56yes_no 0 || exit 1
57svn commit
58
59trap '' EXIT
60exit 0
This page took 0.284034 seconds and 5 git commands to generate.