diff options
author | Riku Voipio <riku.voipio@linaro.org> | 2017-08-29 11:02:42 +0300 |
---|---|---|
committer | Yonghee Han <onstudy@samsung.com> | 2019-01-17 09:58:11 +0900 |
commit | be57d19ae0bd21f2de48dc3e54c1f78aa0013de7 (patch) | |
tree | 7bd190116d8c3fefa503c0ed43467c74947688e1 | |
parent | f4119b6fdb054fc7782874c7edebcd2cbd7a95d6 (diff) | |
download | obs-server-2.7-submit/devel/20190730.075427.tar.gz obs-server-2.7-submit/devel/20190730.075427.tar.bz2 obs-server-2.7-submit/devel/20190730.075427.zip |
[backend] Fix empty packages.gz testsubmit/trunk/20190927.012743submit/devel/20190730.075427release-20190125
in case no packages are produced, dpkg-scanpackages outputs nothing,
causing and empty Packages.new. test against non-zero filesize, and
remove Packages.new if it exists.
Change-Id: I97061e4c8a5bf12c708dae56efba77ad1940aae0
-rwxr-xr-x | src/backend/bs_publish | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/bs_publish b/src/backend/bs_publish index f784273..3a0413f 100755 --- a/src/backend/bs_publish +++ b/src/backend/bs_publish @@ -620,7 +620,7 @@ sub deleterepo_susetags { sub compress_and_rename { my($file) =@_; - if (-f "$file.new") { + if (-s "$file.new") { unlink("$file"); link("$file.new", "$file"); qsystem('gzip', '-9', '-n', '-f', "$file.new") && print " gzip $file.new failed: $?\n"; @@ -628,6 +628,7 @@ sub compress_and_rename { unlink("$file.gz"); rename("$file.new.gz", "$file.gz"); } else { + unlink("$file.new"); unlink("$file"); unlink("$file.gz"); } |