diff mbox series

rpm: fix redudant slash remove and add lacking dependency

Message ID 20250313091557.4153150-1-artemiy.romanov@yadro.com
State New
Headers show
Series rpm: fix redudant slash remove and add lacking dependency | expand

Commit Message

Artemiy Romanov March 13, 2025, 9:15 a.m. UTC
do_install:append() formats paths using sed in macro files incorrectly
causing resulting paths to have format 'usr/*' instead of  '/usr/*'.

Absence of debugedit-native recipe in DEPEDS variable results in
incorrect expansion of '%__find_debuginfo' in usr/lib/rpm/macro file
which looks like this:

%__find_debuginfo	__FIND_DEBUGINFO-NOTFOUND

Adding debugedit-native in DEPENDS:append:class-native is not fixing
the problem while adding it in DEPENDS fixes that:

%__find_debuginfo	/usr/bin/find-debuginfo

Signed-off-by: Artemiy Romanov <artemiy.romanov@yadro.com>
---
 meta/recipes-devtools/rpm/rpm_4.20.0.bb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Richard Purdie March 13, 2025, 1:44 p.m. UTC | #1
On Thu, 2025-03-13 at 12:15 +0300, Artemiy Romanov via lists.openembedded.org wrote:
> do_install:append() formats paths using sed in macro files incorrectly
> causing resulting paths to have format 'usr/*' instead of  '/usr/*'.
> 
> Absence of debugedit-native recipe in DEPEDS variable results in
> incorrect expansion of '%__find_debuginfo' in usr/lib/rpm/macro file
> which looks like this:
> 
> %__find_debuginfo	__FIND_DEBUGINFO-NOTFOUND
> 
> Adding debugedit-native in DEPENDS:append:class-native is not fixing
> the problem while adding it in DEPENDS fixes that:
> 
> %__find_debuginfo	/usr/bin/find-debuginfo
> 
> Signed-off-by: Artemiy Romanov <artemiy.romanov@yadro.com>
> ---
>  meta/recipes-devtools/rpm/rpm_4.20.0.bb | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/meta/recipes-devtools/rpm/rpm_4.20.0.bb b/meta/recipes-devtools/rpm/rpm_4.20.0.bb
> index 281fde1c82..004c847fb8 100644
> --- a/meta/recipes-devtools/rpm/rpm_4.20.0.bb
> +++ b/meta/recipes-devtools/rpm/rpm_4.20.0.bb
> @@ -46,7 +46,7 @@ SRCREV = "b3323786668cf99bc9aed7e60ccdab0bc25e19da"
>  
>  S = "${WORKDIR}/git"
>  
> -DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd"
> +DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd debugedit-native"
>  DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"

Adding a build time dependency just to set a path correctly seems a bit
heavy. Can we configure the path instead?

The reason is we don't want to slow down builds unnecessarily and this
kind of addition will affect performance.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rpm/rpm_4.20.0.bb b/meta/recipes-devtools/rpm/rpm_4.20.0.bb
index 281fde1c82..004c847fb8 100644
--- a/meta/recipes-devtools/rpm/rpm_4.20.0.bb
+++ b/meta/recipes-devtools/rpm/rpm_4.20.0.bb
@@ -46,7 +46,7 @@  SRCREV = "b3323786668cf99bc9aed7e60ccdab0bc25e19da"
 
 S = "${WORKDIR}/git"
 
-DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd"
+DEPENDS = "lua libgcrypt file popt xz bzip2 elfutils python3 sqlite3 zstd debugedit-native"
 DEPENDS:append:class-native = " file-replacement-native bzip2-replacement-native"
 
 EXTRA_OECMAKE:append = " -D__CURL:FILEPATH=curl"
@@ -131,10 +131,10 @@  do_install:append:class-nativesdk() {
 }
 
 do_install:append () {
-	sed -i -e 's:${HOSTTOOLS_DIR}/::g' \
-            -e 's:${STAGING_DIR_NATIVE}/::g' \
+	sed -i -e 's:${HOSTTOOLS_DIR}::g' \
+            -e 's:${STAGING_DIR_NATIVE}::g' \
 	    ${D}/${libdir}/rpm/macros
-	sed -i -e 's:${RECIPE_SYSROOT}/::g' \
+	sed -i -e 's:${RECIPE_SYSROOT}::g' \
 	    ${D}/${libdir}/cmake/rpm/rpm-targets.cmake
 
 }