Difference between revisions of "Debtar script"
Jump to navigation
Jump to search
(Created page with "This is my debtar script: <source lang=sh> #!/bin/bash if [ $# -lt 2 ]; then echo "Usage $0 name version [ srcdirname ]" exit 1 fi name=$1 version=$2 if [...") |
m |
||
Line 1: | Line 1: | ||
This is my debtar script: | This is my debtar script: | ||
− | <source lang= | + | <source lang=bash> |
#!/bin/bash | #!/bin/bash | ||
Latest revision as of 13:43, 16 April 2019
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