Patchwork [core] class/dupdate: add use flag to set run script name

login
register
mail settings
Submitter Jacob Kjaergaard
Date Sept. 30, 2013, 7:51 a.m.
Message ID <1380527472-21475-1-git-send-email-jabk@prevas.dk>
Download mbox | patch
Permalink /patch/278936/
State Accepted
Delegated to: Esben Haabendal
Headers show

Comments

Jacob Kjaergaard - Sept. 30, 2013, 7:51 a.m.
From: Jacob Kjaergaard <jacob@barsoekjaergaard.dk>

Hi,

this adds useflags to set the executable of dupdate which may differ
from recipe to recipe.
Backward compability is maintained through default settings.

-Jacob

---
 classes/dupdate-image.oeclass |    8 +++++---
 conf/dupdate.conf             |    2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)
 create mode 100644 conf/dupdate.conf

\ No newline at end of file
Esben Haabendal - Oct. 14, 2013, 11:40 a.m.
Merged to master, thanks.

/Esben

Patch

diff --git a/classes/dupdate-image.oeclass b/classes/dupdate-image.oeclass
index be47976..0fe8b3a 100644
--- a/classes/dupdate-image.oeclass
+++ b/classes/dupdate-image.oeclass
@@ -19,6 +19,8 @@  CLASS_FLAGS += "dupdate_script dupdate_version"
 DEFAULT_USE_dupdate_script = ""
 DEFAULT_USE_dupdate_version = ""
 
+require conf/dupdate.conf
+
 do_install[postfuncs] += "do_install_dupdate_image"
 do_install_dupdate_image () {
 	install -m 664 ${B}/${IMAGE_BASENAME}${DUPDATE_IMAGE_EXT} ${D}/
@@ -44,9 +46,9 @@  do_rstage_dupdate_version[dirs] = "${RSTAGE_DIR}"
 
 do_rstage_dupdate_script () {
 	script="${USE_dupdate_script}"
-	if [ "$script" != "run_update.sh" ] ; then
-		mv $script run_update.sh
-	fi
+	if [ "$script" != "${USE_dupdate_exefile}" ] ; then
+		mv $script ${USE_dupdate_exefile}
+ 	fi
 }
 do_rstage_dupdate_script[dirs] = "${RSTAGE_DIR}"
 
diff --git a/conf/dupdate.conf b/conf/dupdate.conf
new file mode 100644
index 0000000..c8d4162
--- /dev/null
+++ b/conf/dupdate.conf
@@ -0,0 +1,2 @@ 
+RECIPE_FLAGS += "dupdate_exefile"
+DEFAULT_USE_dupdate_exefile = "run_update.sh"