Debtar script
Jump to navigation
Jump to search
This is my debtar script:
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage $0 name version [ srcdirname ]"
exit 1
fi
name=$1
version=$2
if [ $# -eq 2 ]; then
srcdirname=$name
else
srcdirname=$3
fi
tar zcvf ${name}_$version.orig.tar.gz \
--transform "s/^$srcdirname/$name-$version/" \
--exclude "$srcdirname/debian" \
--exclude "$srcdirname/.git" \
$srcdirname