File: common

package info (click to toggle)
openbox 3.7~rc2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,892 kB
  • sloc: ansic: 38,834; xml: 1,358; sh: 665; makefile: 613; python: 421
file content (56 lines) | stat: -rw-r--r-- 1,316 bytes parent folder | download
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/sh

NOW=$(date +%s)
SRCDIR="$PWD"
WORKDIR="/tmp/openbox.$NOW"
TESTDIR="$WORKDIR/.test"

clean() {
  cd "$SRCDIR"
  if test -d "$WORKDIR"; then
    chmod -R +w "$WORKDIR"
    rm -r -f "$WORKDIR"
  fi
}

error() {
  echo "error: $1"
  test -n "$2" && echo "$2"
  clean
  exit 1
}

RELEASE_SHA=$(git rev-parse "$REV")
test $? = 0 || error "revision $REV not found"

#NON_MASTER=$(git rev-list $RELEASE_SHA ^master)
#test $? = 0 || error "git rev-list failed"
#test -z $NON_MASTER || error "REVISION contains commits not on master"

git new-workdir "$SRCDIR" "$WORKDIR"
test $? = 0 || error "git-new-workdir failed"

echo "working in $WORKDIR"

cd "$WORKDIR"
test $? = 0 || error "cd to $WORKDIR failed"

git checkout -q $RELEASE_SHA
test $? = 0 || error "git-checkout failed"

# get last release
if test -z "$LAST"; then
    LAST=$(git describe --match 'release-*' --abbrev=0 $REV)
    test $? = 0 || \
	error "unable to find last release"
    echo "Using previous release as $LAST"
fi

H="$(head -1 CHANGELOG|cut -d: -f 1)"
test $H = $VERSION ||
  error "CHANGELOG does not contain version $VERSION"

CL="$(cat CHANGELOG|sed -n /^$VERSION:\$/,/^\$/p|tail -n +2|head -n -1)"
CLNOWRAP=$(echo "$CL" \
  |sed -e "s/^  \*/*/"|sed -n '1h;1!H;${;g;s/\n    / /g;p;}')
SHORTLOG="$(git shortlog --no-merges $LAST..$REV)"