File: create_package

package info (click to toggle)
mia 2.4.3-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,964 kB
  • ctags: 18,491
  • sloc: cpp: 153,197; python: 1,254; sh: 311; xml: 127; makefile: 27; csh: 24; ansic: 9
file content (16 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash 
name=$1
version=$2 
pushd $3
if [ -d .git ]; then 
    git tag | grep "$version" > /dev/null 2>&1 
    if [ "x$?" = "x0" ] ; then 
	git archive --format=tar  --prefix=${name}-${version}/ ${version} | xz -9 >$4/${name}-${version}.tar.xz
    else
	git archive --format=tar  --prefix=${name}-${version}/ HEAD | xz -9 >$4/${name}-${version}.tar.xz
	echo "version tag '$version' not found, using HEAD"
    fi
else 
     echo "Error: package creation only works from a git repository, since it uses 'git archive'"
fi 
popd