source: autobuild/scripts/updatepackage

Last change on this file was 1520, checked in by moo, 3 months ago

revert [1464]

  • Property svn:executable set to *
File size: 2.5 KB
RevLine 
[905]1#!/bin/bash
2. scripts/common
3. scripts/svn
4
5packSource() {
6    local args="$1"
7    local suffix="$2"
8    local file="$outputDir/$ext-$extVersion$rev$suffix"
9
10    if [[ ! -f $file ]]; then
[1520]11        tar -C "$extDir" $VERBOSE --exclude='.*' --exclude=tags "$args" "$file.tmp" "$ext-$extVersion" || die
[905]12        mv "$file.tmp" "$file"
[1220]13        md5sum "$file" | LANG=C sed 's#/.*/##' > "$file.md5.txt"
[905]14    fi
15}
16
17packBinary() {
18    local buildDirVersioned="$buildDir/$extNiceName-$extVersion-$phpReleaseVersion"
19    [[ ! -d "$buildDirVersioned" ]] && return
20    local output="$outputDir$rev/"
21    local _TS=
22    [[ ! -z $nts ]] && _TS=
23    [[ -z $nts ]] && _TS=_TS
24    local distDir="$buildDirVersioned/php/Release${_TS}"
25
26    local -a files
[1168]27    local binaryPackagePath="$outputDir/$extNiceName-$extVersion$rev-$phpReleaseVersion.zip"
28    local debugPackagePath="$outputDir/$extNiceName-debug-pack-$extVersion$rev-$phpReleaseVersion.zip"
29    if [[ ! -f $binaryPackagePath || ! -f $debugPackagePath ]]; then
[905]30        pushd "$buildDirVersioned/php" >/dev/null || die
31        pushv file "Release${_TS}/php_$ext.dll"
32        local i
33        for i in "${packageFiles[@]}" ; do
34            local f="$buildDirVersioned/$ext/$i"
35            if [[ -e $f ]]; then
36                dstdir="$distDir/"$(dirname "$i")
37                if [[ ! -d $dstdir ]]; then
38                    mkdir -p "$dstdir"
39                fi
40                rm -rf "$distDir/$i"
41                cp -a "$f" "$distDir/$i"
42                pushv file "Release${_TS}/$i"
43            fi
44        done
45
46        zip tmp.zip $(find "${files[@]}") || die
[1168]47        mv tmp.zip "$binaryPackagePath"
[1220]48        md5sum "$binaryPackagePath" | LANG=C sed 's#/.*/##' > "$binaryPackagePath.md5.txt"
[905]49
50        zip tmp.zip "Release${_TS}/php_$ext.pdb"
[1168]51        mv tmp.zip "$debugPackagePath"
[1220]52        md5sum "$debugPackagePath" | LANG=C sed 's#/.*/##' > "$debugPackagePath.md5.txt"
[905]53        popd >/dev/null
54    fi
55}
56
57pack() {
58    local prefix=
59    if [[ -z $release ]]; then
60        rev=-r$(svnRevOf $extDirVersioned)
61        prefix="$snapshotOutputDir/$extVersion"
62    else
63        prefix="$releaseOutputDir/$extVersion"
64    fi
65    local outputDir="$prefix$rev"
66    mkdir -p "$outputDir"
67
68    packSource -jcf .tar.bz2
69    packSource -zcf .tar.gz
70    foreachPhpVersion foreachPhpReleaseVersion packBinary
71   
72    local files=$(shopt -s nullglob; echo "$prefix"*)
73    if [[ ! -z $files ]]; then
74        rm $VERBOSE -rf `ls -td $files | sed -n ${snapshotCount:-8}',$p'`
75    fi
76}
77
[963]78if [ `find build -iname php_xcache.dll -size 0 | wc -l` -gt 0 ] ; then
79    echo "corrupt file built"
80    find build -iname php_xcache.dll -size 0
81    exit 1
82fi
83
[905]84case $# in
850)
86    foreachExt foreachExtVersion pack
87    ;;
881)
89    loadExt "$1"
90    foreachExtVersion pack
91    ;;
922)
93    loadExt "$1"
94    loadExtVersion "$2"
95    pack
96    ;;
97*)
98    die "Usage: $0 [ext [extVersion]]"
99    ;;
100esac
Note: See TracBrowser for help on using the repository browser.