Hi all,

Here a quick patch to abstract the opkg repository used in a build as
a configuration option, with the default pointing to
downloads.openwrt.org as usual. Useful for hosting different OpenWrt
trees.

If applied, a minor note that the repository location for future
releases should be updated in packages/opkg/Makefile and not in
packages/opkg/files/opkg.conf. Also, _ARCH_ is now used as the
architecture instead of $S.

Best,
Dave Cooper

Signed-off-by: David Cooper <d...@kupesoft.com>

(attached as GMail loves chomping my patches)
Index: package/opkg/files/opkg.conf
===================================================================
--- package/opkg/files/opkg.conf	(revision 17153)
+++ package/opkg/files/opkg.conf	(working copy)
@@ -1,4 +1,4 @@
-src/gz snapshots http://downloads.openwrt.org/snapshots/trunk/$S/packages
+src/gz snapshots $SOURCE
 dest root /
 dest ram /tmp
 lists_dir ext /var/opkg-lists
Index: package/opkg/Makefile
===================================================================
--- package/opkg/Makefile	(revision 17153)
+++ package/opkg/Makefile	(working copy)
@@ -6,10 +6,13 @@
 
 include $(TOPDIR)/rules.mk
 
+# Change this URL for a release, use _ARCH_ for architecture
+OPKG_PACKAGE_SRC=http://downloads.openwrt.org/snapshots/trunk/_ARCH_/packages
+
 PKG_NAME:=opkg
 PKG_REV:=215
 PKG_VERSION:=$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=svn
 PKG_SOURCE_VERSION:=$(PKG_REV)
@@ -69,7 +72,8 @@
 	$(INSTALL_DIR) $(1)/etc
 	$(INSTALL_DIR) $(1)/etc/opkg
 	$(INSTALL_DATA) ./files/opkg.conf $(1)/etc/opkg/
-	$(SED) 's,$$$$S,$(PKGARCH),g' $(1)/etc/opkg/opkg.conf
+	$(SED) 's#$$$$SOURCE#$(if $(call qstrip,$(CONFIG_OPKG_CUSTOM_SRC)),$(call qstrip,$(CONFIG_OPKG_CUSTOM_SRC)),$(OPKG_PACKAGE_SRC))#g' $(1)/etc/opkg/opkg.conf
+	$(SED) 's#_ARCH_#$(PKGARCH)#g' $(1)/etc/opkg/opkg.conf
 	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
 	$(INSTALL_DIR) $(1)/usr/lib
 	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libopkg.so.* $(1)/usr/lib/
Index: Config.in
===================================================================
--- Config.in	(revision 17153)
+++ Config.in	(working copy)
@@ -97,6 +97,16 @@
 	help
 		This removes all ipkg data from the target directory before building the root fs
 
+config OPKG_CUSTOM_SRC
+	string
+	prompt "Custom opkg package source"
+	default ""
+	help
+		Use this URL as a custom opkg package source. Leave blank for the
+		default (ie openwrt.org). Use _ARCH_ as short for the current
+		architecture.
+		Example: http://www.example.com/openwrt/_ARCH_/packages
+
 choice
 	prompt "Binary stripping method"
 	default USE_STRIP   if USE_GLIBC || USE_EGLIBC
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to