diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-08-09 22:34:49 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-08-09 22:34:49 +0300 |
commit | 4a70bc0eb12ac68698f0baab28d3efb0ce42eb8f (patch) | |
tree | 9f6aa391f4b5166d68707c924a8bf106d741e3f5 /scripts | |
parent | a3c7fe2fab7da2671fc200041bb9618c29d825b3 (diff) | |
download | librpm-tizen-4a70bc0eb12ac68698f0baab28d3efb0ce42eb8f.tar.gz librpm-tizen-4a70bc0eb12ac68698f0baab28d3efb0ce42eb8f.tar.bz2 librpm-tizen-4a70bc0eb12ac68698f0baab28d3efb0ce42eb8f.zip |
Avoid truncating /var/log/rpmpkgs in case of errors (rhbz#232830)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/rpm.daily | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/rpm.daily b/scripts/rpm.daily index a3406436c..8a417a944 100755 --- a/scripts/rpm.daily +++ b/scripts/rpm.daily @@ -1,4 +1,9 @@ #!/bin/sh +tmpfile=`/bin/mktemp rpmpkgs.XXXXXXXXX` || exit 1 /bin/rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \ - | /bin/sort > /var/log/rpmpkgs + | /bin/sort > "$tmpfile" + +[ -s "$tmpfile" ] || exit 1 +/bin/mv "$tmpfile" /var/log/rpmpkgs +/bin/chmod 0644 /var/log/rpmpkgs |