~evergreen-bugs/evergreen/rel_3_11

« back to all changes in this revision

Viewing changes to Open-ILS/updates/check

  • Committer: phasefx
  • Date: 2010-08-24 19:04:20 UTC
  • Revision ID: git-v1:53a0bd89fe11176c309b6bcf7f812e3bb60b1283
Staff Client Build/Update Enhancements patch from Thomas Berezansky

Among other things, allows cross-compilation of Windows installers from Unix environments via NSIS, and enables Mozilla's upgrade mechanism for performing upgrades without needing to download and execute external files.

See https://bugs.launchpad.net/evergreen/+bug/616452/ for more details.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17330 dcc99617-32d9-48b4-a31d-7c20da2025e4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
echo "Content-Type: text/xml"
 
3
cat <<HEAD
 
4
 
 
5
<?xml version="1.0"?>
 
6
<updates>
 
7
HEAD
 
8
UPDATE_LOC=$(dirname $PWD)
 
9
PATH_INFO=${PATH_INFO#/}
 
10
CHANNEL=${PATH_INFO%%/*}
 
11
PATH_INFO=${PATH_INFO#*/}
 
12
VERSION=${PATH_INFO%%/*}
 
13
if [ ! -f "$UPDATE_LOC/patch/$CHANNEL/VERSION" ]; then
 
14
        CHANNEL=""
 
15
else
 
16
        CHANNEL="$CHANNEL/"
 
17
fi
 
18
if [ -f "$UPDATE_LOC/patch/${CHANNEL}VERSION" ]; then
 
19
        URLBASE="http://$HTTP_HOST$(dirname $SCRIPT_NAME)/${CHANNEL}"
 
20
        CURVERSION=$(cat $UPDATE_LOC/patch/${CHANNEL}VERSION)
 
21
        [ -f "$UPDATE_LOC/patch/${CHANNEL}DETAILS" ] && DETAILSURL=$(cat $UPDATE_LOC/${CHANNEL}DETAILS)
 
22
        [ -n "$DETAILSURL" ] && DETAILSURL=" detailsURL=\"$DETAILSURL\""
 
23
        if [ -n "$CURVERSION" -a "$VERSION" != "$CURVERSION" ]; then
 
24
                if [ -f "$UPDATE_LOC/pub/${CHANNEL}$CURVERSION.mar" -a -f "$UPDATE_LOC/patch/${CHANNEL}$CURVERSION.patchline" ]; then
 
25
                        echo "<update type=\"minor\" version=\"$CURVERSION\"$DETAILSURL>"
 
26
                        sed -e "s|URL=\"|URL=\"$URLBASE|" "$UPDATE_LOC/patch/${CHANNEL}$CURVERSION.patchline"
 
27
                        if [ -f "$UPDATE_LOC/pub/${CHANNEL}$VERSION-$CURVERSION.mar" -a -f "$UPDATE_LOC/patch/${CHANNEL}$VERSION-$CURVERSION.patchline" ]; then
 
28
                                sed -e "s|URL=\"|URL=\"$URLBASE|" "$UPDATE_LOC/patch/${CHANNEL}$VERSION-$CURVERSION.patchline"
 
29
                        fi
 
30
                        echo "</update>"
 
31
                fi
 
32
        fi
 
33
fi
 
34
cat <<FOOTER
 
35
</updates>
 
36
FOOTER