-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake
executable file
·57 lines (43 loc) · 1.17 KB
/
make
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
#!/bin/bash
#include environment variables
EXTDIR=`dirname $(readlink -fen $0)`
. "$EXTDIR"/../admin/env.sh
CURDIR=$(readlink -fen $PWD)
if [ -z "$1" ]; then
if [ "$EXTDIR" != "$CURDIR" ]; then
echo "Usage: ./make package_dir ... " 1>&2
echo "No argument version only allowed from $EXTDIR!" 1>&2
exit 1;
fi
dirs=(*/)
else
dirs=("$@")
fi
WWW_TRED=$WWW/tred
REPO=$WWW_TRED/extensions/core
DEVEL=$(readlink -fen $EXTDIR/../tred/devel)
PACKER=$DEVEL/pack_extension.sh
mkdir -p "$REPO"
for d in "${dirs[@]%/}"; do
echo "*** Building extension $d"
if ! grep -q "$d" "$REPO"/extensions.lst; then
echo "Adding $d to extensions.lst"
echo "$d" >> "$REPO"/extensions.lst
fi
if [ -f ".make.d/$d" ]; then
( . ".make.d/$d" )
fi
"$PACKER" "$d" "$REPO"
done
# Deprectated. The HTML index will be replaced with dynamic php index.
# update repository HTML index
#(
#cd $REPO;
#echo '<extensions>';
#for d in `cat extensions.lst |grep -v '^!' | grep -E '^\s*(-|\w)+\s*$'`; do
# if [ -f "$d/package.xml" ]; then
# cat "$d/package.xml" |grep -v '^<?xml'
# fi
#done;
#echo '</extensions>';
#) | xsltproc "$EXTDIR"/package2html.xsl - > "$REPO/index.html"