Package: jcal / 0.4.1-2

autogen-bashism.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Description: Fix autogen.sh to work in chroot envs
Author: Lior Kaplan <kaplan@debian.org>

--- a/autogen.sh
+++ b/autogen.sh
@@ -19,21 +19,21 @@
 # along with libjalali.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-#!/bin/bash
+#!/bin/sh
 
 # @OPTIONS
 OPTS="anch"
 LONG_OPTS="nocolor,clean,help,alternative"
 
 # @USAGE
-function usage() {
+usage() {
 	echo -e "Jalali calendar library autogen build script."
 	echo -e "usage: autogen.sh [-nch]"
 	echo -e "try \`autogen.sh --help\' for more information."
 }
 
 # @HELP
-function help() {
+help() {
 	echo -e "usage: autogen.sh [-nch]..."
 	echo -ne "Invokes GNU build system tools in order to create"
 	echo -e " necessary configuration scripts.\n"
@@ -48,7 +48,7 @@
 }
 
 # echoes ``ok'' if parameter is zero, ''failed'' otherwise.
-function printk() {
+printk() {
 	local STAT=$1
 
 	if [ $1 -eq 0 ]; then
@@ -61,14 +61,14 @@
 }
 
 # performs make distclean and removes auto-generated files by GNU build system.
-function clean() {
+clean() {
 	local STAT
 	# files
-	local FUBARS=( "autom4te.cache" "Makefile.in" "m4" "aclocal.m4"
+	local FUBARS={ "autom4te.cache" "Makefile.in" "m4" "aclocal.m4"
 		"configure" "config.sub" "config.guess" "config.log"
 		"config.status" "depcomp" "install-sh" "libtool" "ltmain.sh"
 		"missing" "src/Makefile.in" "man/Makefile.in"
-		"libjalali/Makefile.in" "INSTALL" )
+		"libjalali/Makefile.in" "INSTALL" }
 
 	echo -e "${GREEN}*${RESET} ${YELLOW}cleaning source tree...${RESET}"
 
@@ -77,7 +77,7 @@
 		echo -ne "${GREEN}*{RESET} {YELLOW}performing distclean on"
 		echo -ne " sources if possible...${RESET} "
 		make distclean >/dev/null 2>&1
-		let STAT=$?
+		export STAT=$?
 
 		printk ${STAT}
 		if [ ${STAT} -ne 0 ]; then
@@ -98,7 +98,7 @@
 }
 
 # Setting colors to vt100 standard values, NULL if 0 gets passed to set_color()
-function set_colors() {
+set_colors() {
 	local HAS_COLOR=$1
 
 	if [ ${HAS_COLOR} -eq 1 ]; then
@@ -123,7 +123,7 @@
 # $OUTPUT specifies whether is_present() should work silently or not.
 # $EXIT specifies whther is_present() should exit on the event of
 # service not found.
-function is_present() {
+is_present() {
 	local SERVICE=$1
 	local NAME=$2
 	local OUTPUT=$3
@@ -131,7 +131,7 @@
 	local PRESENT=0
 
 	if [ -n "${SERVICE}" ]; then
-		let PRESENT=1
+		export PRESENT=1
 	fi
 
 	if [ ${OUTPUT} -eq 1 ]; then
@@ -154,7 +154,7 @@
 
 # Checking for tools
 # aclocal, libtoolize, autoconf, automake and autoreconf
-function check_services() {
+check_services() {
 	local STAT
 	ACLOCAL="$(which aclocal 2>/dev/null)"
 	is_present "${ACLOCAL}" "aclocal" 1 1
@@ -182,16 +182,16 @@
 # $EXIT specifies whether perform() should exit on the event of
 # encoutering any errors or not.
 # $PARAMS are the parameters passed to the service.
-function perform() {
-	local SERVICE=$1
-	local NAME=$2
-	local EXIT=$3
-	local PARAMS=$4
+perform() {
+	local SERVICE="$1"
+	local NAME="$2"
+	local EXIT="$3"
+	local PARAMS="$4"
 	local SSTAT
 
 	echo -ne "${GREEN}*${RESET} running ${YELLOW}${NAME}${RESET} ${CYAN}${PARAMS}${RESET}... "
 	${SERVICE} ${PARAMS} >/dev/null 2>&1
-	let STAT=$?
+	export STAT=$?
 
 	printk ${STAT}
 
@@ -227,10 +227,10 @@
 
 	for i in $TEMP; do
 		case $i in
-			-c|--clean) let CLEAN=1;;
-			-n|--nocolor) let COLOR=0;;
-			-h|--help) let HELP=1;;
-			-a|--alternative) let ALTERN=1;;
+			-c|--clean) export CLEAN=1;;
+			-n|--nocolor) export COLOR=0;;
+			-h|--help) export HELP=1;;
+			-a|--alternative) export ALTERN=1;;
 		esac
 	done
 fi