File: make-tarball

package info (click to toggle)
mkchromecast 0.3.9~git20200902%2Bdb2964a-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 17,636 kB
  • sloc: python: 4,654; makefile: 47; sh: 43; javascript: 34
file content (24 lines) | stat: -rwxr-xr-x 771 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# Re-create a debian source tarball from current git tree. Usage:
#
#    make-tarball [treeish [tarball verion]]
#
#  - Invoked without parameters,  produces a tarball using HEAD as commit
#    and marked according to the version from version.py.
#  - With a single parameter, uses this as git commit to package.
#  - A second parameter, if present, defines the tarball visible version.

here=$(dirname $(readlink -fn $0))
cd $here/..

script='import version; print(version.__version__)'
pkg_version=$(cd mkchromecast; python3 -c "$script" )

tar_version=${2:-$pkg_version}
treeish=${1:-'HEAD'}

tarfile="../mkchromecast_${tar_version}.orig.tar"
git archive --prefix=mkchromecast-${tar_version}/ $treeish > $tarfile
gzip -f $tarfile
echo "Created $tarfile.gz"