Skip to content

Commit a393c67

Browse files
author
Ailin Nemui
committed
Introduce check for git commands in autogen
This avoids a misleading compile error when users try to `make` an incomplete (or non-git) check-out.
1 parent 6fcafc5 commit a393c67

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

autogen.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ perl syntax.pl
1818

1919
echo "Creating ChangeLog..."
2020
git log > $srcdir/ChangeLog
21+
if test "$?" -ne 0; then
22+
echo "**Error**: ${PKG_NAME} Autogen must be run in a git clone, cannot proceed."
23+
exit 1
24+
fi
2125

2226
files=`echo docs/help/in/*.in|sed -e 's,docs/help/in/Makefile.in ,,' -e 's,docs/help/in/,!,g' -e 's/\.in /.in ?/g'`
2327
cat docs/help/in/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '!?' '\t\n' > docs/help/in/Makefile.am

irssi-version.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ DATE=`GIT_DIR=$1/.git git log -1 --pretty=format:%ai HEAD`
55
VERSION_DATE=`echo $DATE | cut -f 1 -d ' ' | tr -d -`
66
VERSION_TIME=`echo $DATE | cut -f 2 -d ' ' | awk -F: '{printf "%d", $1$2}'`
77

8+
if test -z "$VERSION_DATE"; then
9+
exec>&2
10+
echo "**Error**: `basename "$0"` must be run in a git clone, cannot proceed."
11+
exit 1
12+
fi
13+
814
echo "#define IRSSI_VERSION_DATE $VERSION_DATE"
915
echo "#define IRSSI_VERSION_TIME $VERSION_TIME"
1016

0 commit comments

Comments
 (0)