55 lines
2.1 KiB
Diff
55 lines
2.1 KiB
Diff
From 407ceacb5f5b987db692b48be9adc97d41f7544a Mon Sep 17 00:00:00 2001
|
|
From: lirui <lirui130@huawei.com>
|
|
Date: Mon, 26 Apr 2021 09:36:10 +0800
|
|
Subject: [PATCH] Use backups of rpmbuild and rpmspec to avoid conflicts
|
|
|
|
Because the rpmrebuild package contains the rpmbuild and rpmspec commands,
|
|
when you install the rpmrebuild and RPM -build packages at the same time,
|
|
the upgrade of one of the packages will fail due to the same name file conflict.
|
|
So rename the rpmbuild and rpmspec commands and package them.
|
|
---
|
|
rpmrebuild.sh | 18 +++++++++++++++---
|
|
1 file changed, 15 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/rpmrebuild.sh b/rpmrebuild.sh
|
|
index 545b348..efa6074 100755
|
|
--- a/rpmrebuild.sh
|
|
+++ b/rpmrebuild.sh
|
|
@@ -202,6 +202,9 @@ function RpmBuild
|
|
if [ -x /usr/bin/rpmbuild ]
|
|
then
|
|
BUILDCMD=/usr/bin/rpmbuild
|
|
+ elif [ -x /usr/bin/rpmbuild-rebuild ]
|
|
+ then
|
|
+ BUILDCMD=/usr/bin/rpmbuild-rebuild
|
|
else
|
|
|
|
BUILDCMD=rpm
|
|
@@ -251,11 +254,20 @@ function RpmFileName
|
|
QF_RPMFILENAME=$(eval "$change_arch" rpm "$RPMREBUILD_rpm_defines" --eval %_rpmfilename) || return
|
|
#Debug " QF_RPMFILENAME=$QF_RPMFILENAME"
|
|
# from generated specfile
|
|
- RPMFILENAME=$(eval "$change_arch" rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "${QF_RPMFILENAME}" "${FIC_SPEC}") || return
|
|
-
|
|
+ if [ -x /usr/bin/rpmspec ]
|
|
+ then
|
|
+ RPMFILENAME=$(eval $change_arch rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "${QF_RPMFILENAME}" "${FIC_SPEC}") || return
|
|
+ else
|
|
+ RPMFILENAME=$(eval $change_arch rpmspec-rebuild "$RPMREBUILD_rpm_defines" --query --queryformat "${QF_RPMFILENAME}" "${FIC_SPEC}") || return
|
|
+ fi
|
|
# workaround for redhat 6.x / rpm 3.x
|
|
local arch
|
|
- arch=$(eval "$change_arch" rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "%{ARCH}" "${FIC_SPEC}")
|
|
+ if [ -x /usr/bin/rpmspec ]
|
|
+ then
|
|
+ arch=$(eval $change_arch rpm "$RPMREBUILD_rpm_defines" --specfile --query --queryformat "%{ARCH}" "${FIC_SPEC}")
|
|
+ else
|
|
+ arch=$(eval $change_arch rpmspec-rebuild "$RPMREBUILD_rpm_defines" --query --queryformat "%{ARCH}" "${FIC_SPEC}")
|
|
+ fi
|
|
if [ "$arch" = "(none)" ]
|
|
then
|
|
Debug ' workaround for rpm 3.x'
|
|
--
|
|
2.33.0
|
|
|