- if [[ ! $FPM_RESULTS =~ "File already exists" ]]; then
- if [[ "$FPM_EXIT_CODE" != "0" ]]; then
- echo "Error building debian package for $1:\n $FPM_RESULTS"
+
+ FPM_PACKAGE_NAME=''
+ if [[ $FPM_RESULTS =~ ([A-Za-z0-9_\-.]*.deb) ]]; then
+ FPM_PACKAGE_NAME=${BASH_REMATCH[1]}
+ fi
+
+ if [[ "$FPM_PACKAGE_NAME" == "" ]]; then
+ EXITCODE=1
+ echo "Error: Unabled figure out package name from fpm results:\n $FPM_RESULTS"
+ else
+ if [[ ! $FPM_RESULTS =~ "File already exists" ]]; then
+ if [[ "$FPM_EXIT_CODE" != "0" ]]; then
+ echo "Error building debian package for $1:\n $FPM_RESULTS"
+ else
+ scp -P2222 $FPM_PACKAGE_NAME $APTUSER@$APTSERVER:tmp/
+ CALL_FREIGHT=1
+ fi