[puppet] Use localstatedir macro for upgrade file

Sam Kottler skottler at fedoraproject.org
Thu Jan 23 17:43:33 UTC 2014


commit dc3f6cc0ce4a775e8a63f69ffffcc9e59bc70abd
Author: Sam Kottler <shk at redhat.com>
Date:   Thu Jan 23 17:30:14 2014 +0000

    Use localstatedir macro for upgrade file

 puppet.spec |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/puppet.spec b/puppet.spec
index 38a1feb..0cc7056 100644
--- a/puppet.spec
+++ b/puppet.spec
@@ -13,7 +13,8 @@
 
 %global _with_systemd 1
 %global confdir         ext/redhat
-%global pending_upgrade_file /tmp/puppet_pending_upgrade
+%global pending_upgrade_path %{_localstatedir}/lib/rpm-state/puppet
+%global pending_upgrade_file %{pending_upgrade_path}/upgrade_pending
 
 Name:           puppet
 Version:        3.4.2
@@ -319,6 +320,9 @@ if [ "$1" == "1" ]; then
     /bin/systemctl stop puppetagent.service > /dev/null 2>&1 ||:
     /bin/systemctl daemon-reload >/dev/null 2>&1 ||:
     if [ ! -e %{pending_upgrade_file} ]; then
+      if [ ! -d %{pending_upgrade_path} ]; then
+        mkdir %{pending_upgrade_path}
+      end
       touch %{pending_upgrade_file}
     fi
   fi


More information about the scm-commits mailing list