Whamcloud - gitweb
LU-8377 build: clean up .rpmmacros 99/21199/3
authorMinh Diep <minh.diep@intel.com>
Thu, 7 Jul 2016 22:53:21 +0000 (15:53 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 11 Jul 2016 15:19:30 +0000 (15:19 +0000)
Landing LU-5614 causing ~/.rpmmacros to fill up on every build

Test-Parameters: trivial

Change-Id: Iecf6cc01e90ae951b878d9f0b99b0a3f4ae9ad31
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: http://review.whamcloud.com/21199
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
contrib/lbuild/lbuild-rhel7

index ea339a0..e7c1766 100644 (file)
@@ -15,7 +15,7 @@ USE_KABI=true
 # in kernel version and rpm names
 #
 RMAC=$HOME/.rpmmacros
-grep '%dist' $RMAC &> /dev/null || echo '%dist .el7' >> $RMAC
+grep '^%dist' $RMAC &> /dev/null || echo '%dist .el7' >> $RMAC
 
 # We modify the RHEL7 kmodtool script, because it expects
 # the kernel source to be in the correct packaged RHEL location.
@@ -29,6 +29,8 @@ chmod 755 kmodtool
 popd
 # Next we replace %kernel_module_package with one that is nearly
 # identical, but calls lbuild's modified kmodtool script.
+# We need to cleanout the previous entry
+sed -i "/^%kernel_module_package/,/^)}$/d" $RMAC
 sed -e "s|REPLACE_ME|$LBUILD_KMODTOOL|" \
     ${LBUILD_DIR}/rhel7/rpmmacros.template > ${LBUILD_DIR}/rhel7/rpmmacros
 cat ${LBUILD_DIR}/rhel7/rpmmacros >> $RMAC