File: create_package

package info (click to toggle)
mia 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,532 kB
  • ctags: 16,800
  • sloc: cpp: 137,909; python: 1,057; ansic: 998; sh: 146; xml: 127; csh: 24; makefile: 13
file content (16 lines) | stat: -rw-r--r-- 530 bytes parent folder | download | duplicates (3)
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