updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / autarchy / autarchy.sh
blob03555fc2ac2031362d9fccaec57683a6b61a801d
1 #!/bin/bash
3 # AUTARCHY: a script to create a tarball including all files required by the PKGBUILD
4 #
5 # by Alessio 'mOLOk' Bolognino
7 ver=0.3
8 software=${1%/}
10 usage(){
11 echo -e "\nusage: \t`basename $0` \"software\"\n"
12 echo -e "\t\"software\" must be a directory including"
13 echo -e "\tthe PKGBUILD and all the files."
16 if [ $# != 1 ]; then
17 echo "ERROR: Wrong number of parameters" 1>&2
18 usage
19 exit -2
22 if [[ ! -d $1 ]]; then
23 echo "ERROR: $1: No such directory" 1>&2
24 usage
25 exit -1
28 lsfiles(){
29 source $software/PKGBUILD
30 for file in ${source[@]}; do
31 echo $software/$file | grep -v '://'
32 done
33 if [ x$install != x ]; then echo $software/$install; fi
34 if [ -r $software/ChangeLog ]; then echo $software/ChangeLog; fi
36 echo -e "${software}.tar.gz includes:\n\n$software/PKGBUILD \n`lsfiles $software`\n "
37 tar cfz ${software}.tar.gz $software/PKGBUILD `lsfiles $software` && echo 'done! :)' || echo 'failed :('