Update Be ERP RPM to handle upgrade cleanly 87/33387/3
authorDaniel Farrell <dfarrell@redhat.com>
Fri, 22 Jan 2016 21:48:39 +0000 (16:48 -0500)
committerDaniel Farrell <dfarrell@redhat.com>
Mon, 25 Jan 2016 22:46:57 +0000 (17:46 -0500)
OPNFV found a bug where the RPM didn't upgrade properly. The

/opt/opendaylight

directory wasn't being layed down by the newer RPM. This fix,
via Dan Radez, seems to fix it.

Change-Id: I0b871a0723dd1249ccb248622ae0cc3aab1aa369
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
rpm/build_vars.yaml
rpm/specs/opendaylight-4.0.0-2.201601200134.spec [moved from rpm/specs/opendaylight-4.0.0-1.201601200134.spec with 93% similarity]
rpm/specs/opendaylight.spec

index 2bf900b0ee9a9db597ecbbb7d081af4420a2e98a..bb56a469e8340bd5c8e3523b81c9b5252ba0a3d8 100644 (file)
@@ -98,12 +98,12 @@ builds:
   - version_major: "4"
     version_minor: "0"
     version_patch: "0"
-    rpm_release: "1.201601200134"
+    rpm_release: "2.201601200134"
     rpm_disttag: el7
     java_version: ">= 1:1.7.0"
     sysd_commit: c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed
     codename: beryllium-daily-v201601200134
     download_url: "https://nexus.opendaylight.org/content/repositories/autorelease-1025/org/opendaylight/integration/distribution-karaf/0.4.0-beryllium-daily-v201601200134/distribution-karaf-0.4.0-beryllium-daily-v201601200134.tar.gz"
     changelog: |
-      * Wed Jan 20 2016 Daniel Farrell <dfarrell@redhat.com> - 4.0.0-1.201601200134
-      - Create latest Beryllium Experimental Release Preview RPM
+      * Wed Jan 22 2016 Daniel Farrell <dfarrell@redhat.com> - 4.0.0-2.201601200134
+      - Make RPM upgrade properly
similarity index 93%
rename from rpm/specs/opendaylight-4.0.0-1.201601200134.spec
rename to rpm/specs/opendaylight-4.0.0-2.201601200134.spec
index 49ab61f34e1ece894dd5dc381e0e12b785517775..f5d30fa29b9333c6925c71fe9ee4604d0a1d086e 100644 (file)
@@ -8,7 +8,7 @@ Version:    4.0.0
 #   unnecessary and unused in our case, but both the docs and the pros (apevec)
 #   agree that we should include it.
 # See: https://fedoraproject.org/wiki/Packaging:DistTag
-Release:    1.201601200134.el7
+Release:    2.201601200134.el7
 BuildArch:  noarch
 Summary:    OpenDaylight SDN Controller
 Group:      Applications/Communications
@@ -54,7 +54,9 @@ cp ../../BUILD/%name-c6d7ee1f21d62ff8ffb741c7a12c3d8d3aa3d6ed.service/%name-c6d7
 # When the RPM is removed, the subdirs containing new files wouldn't normally
 #   be deleted. Manually clean them up.
 #   Warning: This does assume there's no data there that should be preserved
-rm -rf $RPM_BUILD_ROOT/opt/%name
+if [ $1 -eq 0 ]; then
+    rm -rf $RPM_BUILD_ROOT/opt/%name
+fi
 
 %files
 # ODL will run as odl:odl, set as user:group for ODL dir, don't override mode
@@ -64,5 +66,5 @@ rm -rf $RPM_BUILD_ROOT/opt/%name
 
 
 %changelog
-* Wed Jan 20 2016 Daniel Farrell <dfarrell@redhat.com> - 4.0.0-1.201601200134
-- Create latest Beryllium Experimental Release Preview RPM
+* Wed Jan 22 2016 Daniel Farrell <dfarrell@redhat.com> - 4.0.0-2.201601200134
+- Make RPM upgrade properly
index b8aa555ac031c7b77a5a2d504a1aa9ebb29b6a28..d2c992f37848c63d82e1deeb8ae9742bd049c83d 100644 (file)
@@ -54,7 +54,9 @@ cp ../../BUILD/%name-{{ sysd_commit }}.service/%name-{{ sysd_commit }}.service $
 # When the RPM is removed, the subdirs containing new files wouldn't normally
 #   be deleted. Manually clean them up.
 #   Warning: This does assume there's no data there that should be preserved
-rm -rf $RPM_BUILD_ROOT/opt/%name
+if [ $1 -eq 0 ]; then
+    rm -rf $RPM_BUILD_ROOT/opt/%name
+fi
 
 %files
 # ODL will run as odl:odl, set as user:group for ODL dir, don't override mode