From c22881bfb7bab82760f137d276da52ca91d9f0d7 Mon Sep 17 00:00:00 2001 From: Lingchaox Xin Date: Tue, 28 May 2013 11:23:56 +0800 Subject: [PATCH] Fix spec file logic We must ensure /etc/sysconfig/jenkins existing, then come next; And also update it from obs. Change-Id: Ibb7757fbdf61f5a4860208fb1a7646b07b6bb780 --- packaging/jenkins-scripts.spec | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/packaging/jenkins-scripts.spec b/packaging/jenkins-scripts.spec index 609491b..7d2069a 100644 --- a/packaging/jenkins-scripts.spec +++ b/packaging/jenkins-scripts.spec @@ -1,5 +1,5 @@ Name: jenkins-scripts -Version: 0.11 +Version: 0.12 Release: 1 License: Intel Proprietary Summary: An extendable backend scripts for jenkins @@ -32,26 +32,21 @@ cp -rf jenkins-scripts %{buildroot}%{_localstatedir}/lib/jenkins/ %clean rm -rf %{buildroot} -%pre -rm -rf /var/lib/jenkins/jenkins-scripts - %post if [ -s /etc/sysconfig/jenkins ]; then source /etc/sysconfig/jenkins -fi -if [ -n $JENKINS_HOME -a x$JENKINS_HOME != "x/var/lib/jenkins" ]; then - rm -rf $JENKINS_HOME/jenkins-scripts - cp -rf /var/lib/jenkins/jenkins-scripts $JENKINS_HOME/ - chown -R jenkins:jenkins $JENKINS_HOME/jenkins-scripts + if [ -n $JENKINS_HOME -a x$JENKINS_HOME != "x/var/lib/jenkins" ]; then + ln -sf /var/lib/jenkins/jenkins-scripts $JENKINS_HOME/jenkins-scripts + fi fi %postun if [ $1 = 0 ]; then if [ -s /etc/sysconfig/jenkins ]; then source /etc/sysconfig/jenkins - fi - if [ -n $JENKINS_HOME -a x$JENKINS_HOME != "x/var/lib/jenkins" ]; then - rm -rf $JENKINS_HOME/jenkins-scripts + if [ -L $JENKINS_HOME/jenkins-scripts ]; then + rm $JENKINS_HOME/jenkins-scripts + fi fi fi @@ -59,4 +54,3 @@ fi %defattr(-,jenkins,jenkins) %{_localstatedir}/lib/jenkins -%changelog -- 2.7.4