Skip to contentSkip to conversation

sstate.bbclass: remove redundant cd and mkdir commands

PATCH New Andre McCurdy 1 participant 1 message Jul 15, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sstate.bbclass: remove redundant cd and mkdir commands

Update sstate_create_package and sstate_unpack_package to remove redundant initial mkdir and cd commands. The working directory is now setup correctly before the shell functions are called.

---
 meta/classes/sstate.bbclass | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta/classes/sstate.bbclass +2 -4
index 5b64b49..2a050dc 100644
@@ -646,10 +646,9 @@ python sstate_task_postfunc () {
 
 #
 # Shell function to generate a sstate package from a directory
-# set as SSTATE_BUILDDIR
+# set as SSTATE_BUILDDIR. Will be run from within SSTATE_BUILDDIR.
 #
 sstate_create_package () {
-	cd ${SSTATE_BUILDDIR}
 	TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
 	# Need to handle empty directories
 	if [ "$(ls -A)" ]; then
@@ -672,10 +671,9 @@ sstate_create_package () {
 
 #
 # Shell function to decompress and prepare a package for installation
+# Will be run from within SSTATE_INSTDIR.
 #
 sstate_unpack_package () {
-	mkdir -p ${SSTATE_INSTDIR}
-	cd ${SSTATE_INSTDIR}
 	tar -xmvzf ${SSTATE_PKG}
 	# Use "! -w ||" to return true for read only files
 	[ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG}
Signature · 1 line
1.9.1