aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-08-11 17:44:47 +0000
committermerakor <cem@ckyln.com>2020-08-11 17:44:47 +0000
commitcfa65519e79e041793b5bc37999fad87e0892d32 (patch)
tree06d9c72fd2979d99255509b39bdb94031f9f5ade
parent8be2fa04e8411373bd8fe216f20ee9a4ac74b03a (diff)
downloadcpt-cfa65519e79e041793b5bc37999fad87e0892d32.tar.gz
pkg_build(): remove the diff file if it is empty
FossilOrigin-Name: e418cc6bfbace64b77a907de42afe9afc442c3c91846314fbe7e794964cc9640
-rw-r--r--src/cpt-lib4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpt-lib b/src/cpt-lib
index 0fe3d92..69ebc8e 100644
--- a/src/cpt-lib
+++ b/src/cpt-lib
@@ -752,8 +752,8 @@ pkg_build() {
cp -LRf "$repo_dir" "$pkg_dir/$pkg/$pkg_db/"
# Copy the modified build file to the package directory.
- diff "$pkg_dir/$pkg/$pkg_db/build" .build.cpt > "$pkg_dir/$pkg/$pkg_db/build.diff"
- [ -s "$pkg_dir/$pkg/$pkg_db/build.diff" ] || rm -f "$pkg_dir/$pkg/$pkg_db/build.diff"
+ diff "$pkg_dir/$pkg/$pkg_db/build" .build.cpt > "$pkg_dir/$pkg/$pkg_db/build.diff" &&
+ rm -f "$pkg_dir/$pkg/$pkg_db/build.diff"
# We never ever want this. Let's end the endless conflicts
# and remove it.