]> saetta.ns0.it Git - msys2/commitdiff
Autobuilder: aggiunta la possibilità di specificare i comandi per copiare i file...
authorAndrea Zagli <andrea.zagli@email.it>
Thu, 30 Mar 2017 10:27:53 +0000 (12:27 +0200)
committerAndrea Zagli <andrea.zagli@email.it>
Thu, 30 Mar 2017 10:27:53 +0000 (12:27 +0200)
tools/autobuilder/copy_to_repo.sh

index c9b7aa95908ddd8cfaa3ee2f680fbfec36abc517..063b10e3e360206c781a0be9b441d9261970dc20 100644 (file)
@@ -2,15 +2,19 @@
 
 CUR=$PWD
 FROM=.
-REPO=/opt/msys2/repositories/saetta/
+CMD_COPY_TO_REPO="cp -f <pkgsfilename> /opt/msys2/repositories/saetta"
+CMD_ADD_TO_REPO="cd /opt/msys2/repositories/saetta && ./repo-add saetta.db.tar.gz <pkgsfilename>"
 
-while getopts ":f:t:" opt; do
+while getopts ":f:c:a:" opt; do
        case $opt in
                f)
                    FROM=$OPTARG
                        ;;
-               t)
-                   REPO=$OPTARG
+               c)
+                   CMD_COPY_TO_REPO=$OPTARG
+                       ;;
+               a)
+                   CMD_ADD_TO_REPO=$OPTARG
                        ;;
                \?)
                        echo "Invalid option: -$OPTARG" >&2
@@ -24,10 +28,8 @@ while getopts ":f:t:" opt; do
 done
 
 echo "From: "$FROM
-echo "Repo: "$REPO
 
 if [ ! -d $FROM ]; then echo $FROM" isn't a directory" && exit 0; fi
-if [ ! -d $REPO ]; then echo $REPO" isn't a directory" && exit 0; fi
 
 cd $FROM
 if [ ! -e PKGBUILD ]; then "No PKGBUILD file found in "$FROM && exit 0; fi
@@ -47,10 +49,14 @@ echo "pkgrel: "$pkgrel
 pkgfilename32="mingw-w64-i686-"$realname"-"$pkgver"-"$pkgrel"-any.pkg.tar.xz"
 pkgfilename64="mingw-w64-x86_64-"$realname"-"$pkgver"-"$pkgrel"-any.pkg.tar.xz"
 
-cp -f $pkgfilename32 $REPO
-cp -f $pkgfilename64 $REPO
+if [ -e ~/.zak_msys2_copy_to_repo ]; then . ~/.zak_msys2_copy_to_repo; fi
+
+CMD_COPY_TO_REPO=${CMD_COPY_TO_REPO/"<pkgsfilename>"/"$pkgfilename32 $pkgfilename64"}
+CMD_ADD_TO_REPO=${CMD_ADD_TO_REPO/"<pkgsfilename>"/"$pkgfilename32 $pkgfilename64"}
+
+echo "Command copy to report: "$CMD_COPY_TO_REPO
+echo "Command add to report: "$CMD_ADD_TO_REPO
 
-cd $REPO
-./repo-add saetta.db.tar.gz $pkgfilename32 $pkgfilename64
+$CMD_COPY_TO_REPO
 
-cd $CUR
+$CMD_ADD_TO_REPO