File: create_source_package.sh

package info (click to toggle)
copyq 3.7.3-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 10,480 kB
  • sloc: cpp: 51,894; sh: 734; python: 211; xml: 57; makefile: 34
file content (27 lines) | stat: -rwxr-xr-x 715 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
version=$1
out=${2:-"copyq-${version}.tar.gz"}
version_header="src/common/version.h"

set -e

die () {
    echo "ERROR: $*"
    exit 1
}

grep -q '^v'"$version"'$' CHANGES ||
    die "CHANGES file doesn't contain changes for given version!"

grep -q '"v'"$version"'"' "$version_header" ||
    die "String for given version is missing in \"$version_header\" file!"

git archive --format=tar.gz --prefix="copyq-$version/" --output="$out" "v$version" ||
    die "First arguments must be existing version (tag v<VERSION> must exist in repository)!"

echo "Created source package for version $version: $out"

size=$(stat --format="%s" "$out")
hash=$(md5sum "$out" | cut -d' ' -f 1)
echo " $hash $size $out"