+declare -a nam nam_gz
+if [ "$1" = "chk" ]; then
+ set -e
+ oldifs="$IFS"
+ IFS='
+'
+ for i in $(find -name '*.pho' -o -name '*.phh' -o -name '*.php'); do
+ php5 -l $i
+ done
+
+ taggit="$(git describe --tags | sed 's/^v//g')"
+ tagphp="$(grep "^\$G_brisk_version = " web/Obj/brisk.phh | sed 's/^[^"]\+"//g;s/".*//g')" # ' emacs hell
+ if [ "$taggit" != "$tagphp" ]; then
+ echo
+ echo "WARNING: taggit: [$taggit] tagphp: [$tagphp]"
+ echo
+ fi
+ exit 0
+fi
+
+# before all check errors on the sources
+$0 chk || exit 3
+if [ "$1" = "pkg" ]; then
+ if [ "$2" != "" ]; then
+ tag="$2"
+ else
+ tag="$(git describe)"
+ fi
+ nam=("brisk" "brisk-img" "fieldify")
+ nam_idx=3
+
+ if [ -d ../curl-de-sac ]; then
+ nam[$nam_idx]="curl-de-sac"
+ nam_idx=$((nam_idx + 1))
+ fi
+ pkg_list=""
+ sep=""
+ for i in $( seq 0 $((${#nam[@]} - 1)) ); do
+ echo "$i"
+ nam_gz[$i]="${nam[$i]}_${tag}.tgz"
+ pkg_list="${pkg_list}${sep}${nam_gz[$i]}"
+ sep=", "
+ done
+
+ echo "Build packages ${pkg_list} ."
+ read -p "Proceed [y/n]: " a
+ if [ "$a" != "y" -a "$a" != "Y" ]; then
+ exit 1
+ fi
+ for i in $( seq 0 $((${#nam[@]} - 1)) ); do
+ cd "../${nam[$i]}"
+ git archive --format=tar --prefix=brisk-${tag}/${nam[$i]}/ $tag | gzip > ../${nam_gz[$i]}
+ cd -
+ done
+ exit 0
+fi
+
+if [ -f "$CONFIG_FILE" ]; then
+ source "$CONFIG_FILE"
+ conffile_in="$CONFIG_FILE"
+fi
+
+if [ "x$prefix_path" = "x" ]; then
+ prefix_path="$web_path"
+fi
+
+action=""