diff options
author | Daniel Black <daniel@mariadb.org> | 2023-04-15 07:52:17 +0800 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2023-04-17 19:17:58 +1000 |
commit | 3b85e3dcc11e9638c9670a299eccdb77a51c1a19 (patch) | |
tree | 51eb716f3bfeb3021143c8eb15c4a400c941256e | |
parent | 71f16c836f5f91e2983c28d6a14bf3687bea78bb (diff) | |
download | mariadb-git-3b85e3dcc11e9638c9670a299eccdb77a51c1a19.tar.gz |
MDEV-30687: Make small facelifting to autobake-debs.sh (fix)
Appending to 'eatmydata' will obviously cause an executable that
doesn't exist. Use an array to create the entire executable.
Also while we are at it, check the fakeroot actually works before
using it.
-rwxr-xr-x | debian/autobake-deb.sh | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index cf14eb701b5..eed1f65fef6 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -170,34 +170,39 @@ dch -b -D "${LSBNAME}" -v "${VERSION}" "Automatic build with ${LOGSTRING}." --co echo "Creating package version ${VERSION} ... " -BUILDPACKAGE_DPKGCMD="" +BUILDPACKAGE_DPKGCMD=() + +# Fakeroot test +if fakeroot true; then + BUILDPACKAGE_DPKGCMD+=( "fakeroot" "--" ) +fi # Use eatmydata is available to build faster with less I/O, skipping fsync() # during the entire build process (safe because a build can always be restarted) if which eatmydata > /dev/null then - BUILDPACKAGE_DPKGCMD="eatmydata" + BUILDPACKAGE_DPKGCMD+=("eatmydata") fi -BUILDPACKAGE_DPKGCMD+="dpkg-buildpackage" +BUILDPACKAGE_DPKGCMD+=("dpkg-buildpackage") # Using dpkg-buildpackage args # -us Allow unsigned sources # -uc Allow unsigned changes # -I Tar ignore -BUILDPACKAGE_DPKG_ARGS=(-us -uc -I) +BUILDPACKAGE_DPKGCMD+=(-us -uc -I) # There can be also extra flags that are appended to args if [ -n "$BUILDPACKAGE_FLAGS" ] then read -ra BUILDPACKAGE_TMP_ARGS <<< "$BUILDPACKAGE_FLAGS" - BUILDPACKAGE_DPKG_ARGS=("${BUILDPACKAGE_DPKG_ARGS[@]} ${BUILDPACKAGE_TMP_ARGS[@]}") + BUILDPACKAGE_DPKGCMD+=( "${BUILDPACKAGE_TMP_ARGS[@]}" ) fi # Build the package # Pass -I so that .git and other unnecessary temporary and source control files # will be ignored by dpkg-source when creating the tar.gz source package. -fakeroot -- "${BUILDPACKAGE_DPKGCMD}" "${BUILDPACKAGE_DPKG_ARGS[@]}" +"${BUILDPACKAGE_DPKGCMD[@]}" # If the step above fails due to missing dependencies, you can manually run # sudo mk-build-deps debian/control -r -i |