Skip to contentSkip to conversation

scripts: make createrepo_c run

PATCH New brian avery 1 participant 2 messages Jun 29, 2017

lore
Share & tools
lore
#0 lore raw

cover scripts: make createrepo_c run

This uses oe-run-native to run the createrepo_c native binary. RSS means we need additional steps to run native binaries, so it is better to consolidate the logic.

-brian avery

The following changes since commit 98099349e358a9caaec8ec81f0d4abe588909cfe:

bitbake: npm fetcher: fix unknown variable name. (2017-06-29 14:33:42 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib bavery/core/11706
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=bavery/core/11706

brian avery (1):
scripts/oe-setup-rpmrepo: leverage oe-run-native

 scripts/oe-setup-rpmrepo | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

--
1.9.1

#1 lore raw

PATCH 1/1 scripts/oe-setup-rpmrepo: leverage oe-run-native

RSS means we no longer have a large native sysroot to run binaries from. oe-run-native deals with this already, so this patch uses oe-run-native to call the createrepo_c native binary that we need to make the package feed indices.

[YOCTO #11706]
---
 scripts/oe-setup-rpmrepo | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)
scripts/oe-setup-rpmrepo +9 -12
index df1c614..4e3d89e 100755
@@ -72,7 +72,7 @@ setup_sysroot() {
 		BUILD_SYS="$BUILD_ARCH-$BUILD_OS"
 
 		OECORE_NATIVE_SYSROOT=$TMPDIR/sysroots/$BUILD_SYS
-	fi 
+	fi
 }
 
 setup_sysroot
@@ -88,16 +88,13 @@ if [ ! -d "$RPM_DIR" ]; then
    	echo "Error: rpm dir $RPM_DIR doesn't exist"
 	exit 1
 fi
-
-CREATEREPO=$OECORE_NATIVE_SYSROOT/usr/bin/createrepo_c
-if [ ! -e "$CREATEREPO" ]; then
-   	echo "Error: can't find createrepo binary"
-	echo "please run bitbake createrepo-native first"
-	exit 1
+if ! oe-run-native createrepo-c-native createrepo_c "$RPM_DIR"&>/dev/null; then
+    echo "Could not run createrepo_c, using bitbake to add to"
+    echo "native sysroot and trying again..."
+    bitbake createrepo-c-native -caddto_recipe_sysroot
+    # this time show the error mesage in case it's helpful
+    if ! oe-run-native createrepo-c-native createrepo_c "$RPM_DIR"; then
+        exit 1
+    fi
 fi
-
-export PATH=${PATH}:${OECORE_NATIVE_SYSROOT}/usr/bin
-
-$CREATEREPO "$RPM_DIR"
-
 exit 0
Signature · 1 line
1.9.1