1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 23:17:59 +01:00
Files
pentadactyl-pm/common/make_jar.sh
"M.Terada" 3f4602ca3c Fix: build system
Hi developers

I'm afraid you don't notice the build system have been borken since
help system is replace to XSLTransform from asciidoc.
because the build system does'nt archives *.xsl files.

Please review the attached patches

Best regards.
----
teramako
2009-11-02 00:22:22 -05:00

59 lines
1.2 KiB
Bash

#!/bin/sh
set -e
top=$(pwd)
jar=$1
bases=$2
dirs=$3
text=$4
bin=$5
shift 5;
files="$@"
stage="$top/${jar%.*}"
mkdir -p $stage
getfiles () {
filter="\.($(echo $1 | tr ' ' '|'))$"; shift
find "$@" -not -path '*\.hg*' 2>/dev/null | grep -E "$filter" || true
}
copytext () {
sed -e "s,###VERSION###,$VERSION,g" \
-e "s,###DATE###,$BUILD_DATE,g" \
<"$1" >"$2"
cmp -s "$1" "$2" ||
( echo "modified: $1"; diff -u "$1" "$2" | grep '^[-+][^-+]' )
}
for base in $bases
do
(
set -e
cd $base
[ ${jar##*.} = jar ] && stage="$stage/${base##*/}"
for dir in $dirs
do
for f in $(getfiles "$bin" "$dir")
do
mkdir -p "$stage/${f%/*}"
cp $f "$stage/$f"
done
for f in $(getfiles "$text" "$dir")
do
mkdir -p "$stage/${f%/*}"
copytext "$f" "$stage/$f"
done
done
for f in $files
do
[ -f "$f" ] && copytext "$f" "$stage/$f"
done
true
) || exit 1
done
[ -f "$top/$jar" ] && rm -f "$top/$jar"
(set -e; cd $stage; zip -9r "$top/$jar" *) || exit 1
rm -rf "$stage"