]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
debian: Do not destroy the build result
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Jun 2020 11:22:09 +0000 (11:22 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 Jun 2020 11:22:09 +0000 (11:22 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
debian/build.sh

index 774c54dc65e728a4df1bf66087cf81a3739114ec..6ae92edd7fe32fe77bb8174f899a9030e0b9832f 100644 (file)
@@ -49,6 +49,7 @@ main() {
             if ! sbuild-createchroot --arch="${host_arch}" "${release}" \
                     "${CHROOT_PATH}/${chroot}"; then
                 echo "Could not create chroot for ${release} on ${host_arch}" >&2
+                rm -rf "${tmp}"
                 return 1
             fi
         fi
@@ -65,6 +66,7 @@ main() {
             # Run the build process
             if ! sbuild --dist="${release}" --host="${arch}" --source "sources/${package}"; then
                 echo "Could not build package for ${release} on ${arch}" >&2
+                rm -rf "${tmp}"
                 return 1
             fi
 
@@ -79,8 +81,10 @@ main() {
     rm -rf "${tmp}/sources"
     popd
 
-    # Cleanup
-    rm -rf "${tmp}"
+    # Done!
+    echo "SUCCESS!"
+    echo "  You can find your Debian packages in ${tmp}"
+    return 0
 }
 
 main "$@" || exit $?