[PATCH] fff-sysupgrade: Remove dependency from fff-hoods

Adrian Schmutzler freifunk at adrianschmutzler.de
Di Nov 21 17:50:35 CET 2017


Sysupgrade implements a lib file from fff-hoods to look for the
hood file and read the upgrade path from it.
If fff-hoods is not desired, this poses a problem. Thus, we
move the lib file to fff-config, as its primary purpose is
actually providing the paths to the hood files (=config).

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../fff-config/files/lib/functions/fff/keyxchange  | 32 ++++++++++++++++++++++
 src/packages/fff/fff-hoods/Makefile                |  2 +-
 .../fff-hoods/files/lib/functions/fff/keyxchange   | 32 ----------------------
 src/packages/fff/fff-sysupgrade/Makefile           |  2 +-
 4 files changed, 34 insertions(+), 34 deletions(-)
 create mode 100644 src/packages/fff/fff-config/files/lib/functions/fff/keyxchange
 delete mode 100644 src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange

diff --git a/src/packages/fff/fff-config/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-config/files/lib/functions/fff/keyxchange
new file mode 100644
index 0000000..30963ae
--- /dev/null
+++ b/src/packages/fff/fff-config/files/lib/functions/fff/keyxchange
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Copyright 2017 Adrian Schmutzler
+# License GPLv3
+
+. /usr/share/libubox/jshn.sh
+
+hoodfile="/tmp/keyxchangev2data"
+hoodfilecopy="/www/hood/keyxchangev2data"
+
+getJsonPath() {
+	jsonfile=""
+	if [ -s "$hoodfilecopy" ] ; then
+		jsonfile="$hoodfilecopy"
+	elif [ -s "$hoodfile" ] ; then
+		jsonfile="$hoodfile"
+	fi
+	echo "$jsonfile"
+}
+
+getUpgradePath() {
+	jsonfile="$(getJsonPath)"
+
+	if [ -n "$jsonfile" ] ; then
+		json_load "$(cat "$jsonfile")"
+		json_select hood
+		json_get_var upath upgrade_path
+		echo "$upath"
+	else
+		return 1
+	fi
+	return 0
+}
diff --git a/src/packages/fff/fff-hoods/Makefile b/src/packages/fff/fff-hoods/Makefile
index 11ab6d1..1a616ff 100644
--- a/src/packages/fff/fff-hoods/Makefile
+++ b/src/packages/fff/fff-hoods/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fff-hoods
-PKG_VERSION:=0.0.1
+PKG_VERSION:=2
 PKG_RELEASE:=1
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
deleted file mode 100644
index 30963ae..0000000
--- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-# Copyright 2017 Adrian Schmutzler
-# License GPLv3
-
-. /usr/share/libubox/jshn.sh
-
-hoodfile="/tmp/keyxchangev2data"
-hoodfilecopy="/www/hood/keyxchangev2data"
-
-getJsonPath() {
-	jsonfile=""
-	if [ -s "$hoodfilecopy" ] ; then
-		jsonfile="$hoodfilecopy"
-	elif [ -s "$hoodfile" ] ; then
-		jsonfile="$hoodfile"
-	fi
-	echo "$jsonfile"
-}
-
-getUpgradePath() {
-	jsonfile="$(getJsonPath)"
-
-	if [ -n "$jsonfile" ] ; then
-		json_load "$(cat "$jsonfile")"
-		json_select hood
-		json_get_var upath upgrade_path
-		echo "$upath"
-	else
-		return 1
-	fi
-	return 0
-}
diff --git a/src/packages/fff/fff-sysupgrade/Makefile b/src/packages/fff/fff-sysupgrade/Makefile
index 4a03652..5bccc65 100644
--- a/src/packages/fff/fff-sysupgrade/Makefile
+++ b/src/packages/fff/fff-sysupgrade/Makefile
@@ -13,7 +13,7 @@ define Package/$(PKG_NAME)
     CATEGORY:=Freifunk
     TITLE:=Freifunk-Franken sysupgrade
     URL:=http://www.freifunk-franken.de
-    DEPENDS:=+fff-boardname +fff-config +fff-hoods + at BUSYBOX_CONFIG_WGET
+    DEPENDS:=+fff-boardname +fff-config + at BUSYBOX_CONFIG_WGET
 endef
 
 define Package/$(PKG_NAME)/description
-- 
2.7.4



Mehr Informationen über die Mailingliste franken-dev