Hi,
 This patch maintains path of each compiled package (both application and 
kernel module) in a file called ".package-builddir-info" under tmp directory to 
provide a ready reference to the PKG_BUILD_DIR for each package. It may also be 
convenient in referring binaries through that path. 
I have used latest trunk code (revision number 31050) to create this patch.

Signed-off-by: Tathagata Das <[email protected]>

---

diff -Naur a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk
--- a/include/package-dumpinfo.mk       2012-03-20 13:12:11.000000000 +0530
+++ b/include/package-dumpinfo.mk       2012-03-20 13:08:36.000000000 +0530
@@ -5,6 +5,16 @@
 # See /LICENSE for more information.
 #
 
+PKG_BUILDDIR_INFO:=$(TMP_DIR)/.package-builddir-info
+
+define DumpBuildDirInfo
+       $(shell if [ -f $(PKG_BUILDDIR_INFO) ]; then \
+               sed -i 's|^$(PKG_NAME):.*|$(PKG_NAME): $(PKG_BUILD_DIR)|g' 
$(PKG_BUILDDIR_INFO); \
+               if [ -z "`grep -w ^$(PKG_NAME): $(PKG_BUILDDIR_INFO)`" ]; then \
+               echo "$(PKG_NAME): $(PKG_BUILD_DIR)" >> $(PKG_BUILDDIR_INFO); 
fi; \
+       else echo "$(PKG_NAME): $(PKG_BUILD_DIR)" >> $(PKG_BUILDDIR_INFO); fi)
+endef
+
 ifneq ($(DUMP),)
 
 dumpinfo: FORCE
diff -Naur a/include/package.mk b/include/package.mk
--- a/include/package.mk        2012-03-20 13:09:38.000000000 +0530
+++ b/include/package.mk        2012-03-20 13:17:19.000000000 +0530
@@ -122,6 +122,7 @@
   $(STAMP_PREPARED):
        @-rm -rf $(PKG_BUILD_DIR)
        @mkdir -p $(PKG_BUILD_DIR)
+       $(call DumpBuildDirInfo)
        $(foreach hook,$(Hooks/Prepare/Pre),$(call $(hook))$(sep))
        $(Build/Prepare)
        $(foreach hook,$(Hooks/Prepare/Post),$(call $(hook))$(sep))


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to