summaryrefslogtreecommitdiffstats
path: root/make_release
blob: 051bac0c35b75e51438c75948b38b20cd499f361 (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash

RELEASE_DIR=/home/bbb/releases

LIBLITMUS_DIR=/home/bbb/dev/liblitmus2010
LITMUS_DIR=/home/bbb/dev/litmus2010
FT_TOOLS_DIR=/home/bbb/dev/ft_tools/

BASE_TAG="v2.6.36"

TAG=$1

function die {
    echo $1
    echo
    echo "Usage:      make_release <TAG>"
    echo "Example:    make_release 2007.3"
    echo "Given tag:  '${TAG}'"
    exit 1
}

if [ -z "$TAG"  ]; then
    die "TAG missing."
fi

function archive {
    PREFIX=$1
    TGZ=$2

    TMP=`mktemp`
    git archive --format=tar --prefix=$PREFIX/ $TAG > $TMP || \
	die "Could not create archive from tree."
    gzip -c $TMP > $TGZ || die "Could not compress."
    rm $TMP
}

function release_liblitmus {
    echo "Releasing liblitmus."
    cd $LIBLITMUS_DIR || die "Could not cd to $LIBLITMUS_DIR."
    archive liblitmus $TARGET/liblitmus-$TAG.tgz || die "Could not build archive."
    return 0
}

function release_ft_tools {
    echo "Releasing ft_tools."
    cd $FT_TOOLS_DIR || die "Could not cd to $FT_TOOLS_DIR."
    archive ft_tools $TARGET/ft_tools-$TAG.tgz || die "Could not build archive."
    return 0
}

function release_litmus {
    echo "Releasing LITMUS^RT."
    cd $LITMUS_DIR || die "Could not cd to $LITMUS_DIR."
    git diff -p --stat $BASE_TAG $TAG > $TARGET/litmus-rt-$TAG.patch || \
	die "Could not create patch."
    return 0
}



TARGET="$RELEASE_DIR/$TAG"

mkdir -p $TARGET    || die "Could not make directory $TARGET."


release_litmus      || die "Releasing LITMUS^RT failed."
release_liblitmus   || die "Releasing liblitmus failed."
release_ft_tools    || die "Releasing ft_tools  failed."

cd $TARGET
echo "Generating check sums."
sha256sum * > SHA256SUMS

echo "Release generated in $TARGET."