build,IB: reload packages/ only if existing
authorPaul Spooren <mail@aparcar.org>
Sat, 17 Oct 2020 20:06:03 +0000 (10:06 -1000)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 30 Oct 2020 00:39:09 +0000 (00:39 +0000)
With the fix of external kmod feeds it is possible to ship the
ImageBuilder without any packages except the pseudo packages kernel and
libc. Therefore the local package feeds becomes optional.

This commit adds a check to the package_reload function to only run if
the local feed is existing.

Signed-off-by: Paul Spooren <mail@aparcar.org>
target/imagebuilder/files/Makefile

index 03a95dbf6ef14fdddb2fb9ca1752e31661984dee..0ce5f8b39be52062aeafa4fed06df6d1fc443699 100644 (file)
@@ -138,7 +138,10 @@ package_index: FORCE
        $(OPKG) update >&2 || true
 
 package_reload:
-       if [ ! -f "$(PACKAGE_DIR)/Packages" ] || [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ]; then \
+       if [ -d "$(PACKAGE_DIR)" ] && ( \
+                       [ ! -f "$(PACKAGE_DIR)/Packages" ] || \
+                       [ ! -f "$(PACKAGE_DIR)/Packages.gz" ] || \
+                       [ "`find $(PACKAGE_DIR) -cnewer $(PACKAGE_DIR)/Packages.gz`" ] ); then \
                echo "Package list missing or not up-to-date, generating it." >&2 ;\
                $(MAKE) package_index; \
        else \