[OpenWrt-Devel] Remove requirement of an absolute path to the perl interpreter

Thomas Strobel ts468 at cam.ac.uk
Sat May 9 10:50:58 EDT 2015


Hi,

I'm using OpenWRT on NixOS, a Linux operating system that uses a
sophisticated hash mechanism instead of the Filesystem Hierarchy
Standard. A consequence of the hashing mechanism is that files like,
e.g., /usr/bin/perl don't exist under NixOS.

I've tried to create a patch that replaces two occurrences where
"/usr/bin/perl" would be needed with a more general calling scheme that
"shouldn't" break OpenWRT on any other platform, but allows to build it
on NixOS.

Could you please comment on the changes suggested, e.g., if they break
anything, and whether there is an interest in merging the patch upstream?


Many thanks!

Thomas



diff --git a/include/feeds.mk b/include/feeds.mk
index 695b03b..27f3e8f 100644
--- a/include/feeds.mk
+++ b/include/feeds.mk
@@ -7,7 +7,7 @@
 
 -include $(TMP_DIR)/.packagefeeds
 
-FEEDS_AVAILABLE:=$(shell $(SCRIPT_DIR)/feeds list -n)
+FEEDS_AVAILABLE:=$(perl $(SCRIPT_DIR)/feeds list -n)
 FEEDS_INSTALLED:=$(notdir $(wildcard $(TOPDIR)/package/feeds/*))
 FEEDS_ENABLED:=$(foreach feed,$(FEEDS_INSTALLED),$(if
$(CONFIG_FEED_$(feed)),$(feed)))
 FEEDS_DISABLED:=$(filter-out $(FEEDS_ENABLED),$(FEEDS_AVAILABLE))
diff --git a/include/toplevel.mk b/include/toplevel.mk
index d8651d9..1a0bc2e 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -74,7 +74,7 @@ prepare-tmpinfo: FORCE
         f=tmp/.$${type}info; t=tmp/.config-$${type}.in; \
         [ "$$t" -nt "$$f" ] || ./scripts/metadata.pl $${type}_config
"$$f" > "$$t" || { rm -f "$$t"; echo "Failed to build $$t"; false;
break; }; \
     done
-    [ tmp/.config-feeds.in -nt tmp/.packagefeeds ] || ./scripts/feeds
feed_config > tmp/.config-feeds.in
+    [ tmp/.config-feeds.in -nt tmp/.packagefeeds ] || perl
scripts/feeds feed_config > tmp/.config-feeds.in
     ./scripts/metadata.pl package_mk tmp/.packageinfo >
tmp/.packagedeps || { rm -f tmp/.packagedeps; false; }
     ./scripts/metadata.pl package_feeds tmp/.packageinfo >
tmp/.packagefeeds || { rm -f tmp/.packagefeeds; false; }
     touch $(TOPDIR)/tmp/.build
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list