Debtar script

From vsd
Revision as of 13:43, 16 April 2019 by Renzo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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