source: autobuild/scripts/updatepackage

Last change on this file was 1467, checked in by moo, 9 months ago

strip ext prefix for ext versions dir

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