build: allow creating empty package feeds
authorFelix Fietkau <nbd@openwrt.org>
Tue, 26 May 2015 09:09:07 +0000 (09:09 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 26 May 2015 09:09:07 +0000 (09:09 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 45757

package/Makefile
scripts/ipkg-make-index.sh

index d5212f09a84fd0867fc2498439b2b9de93bec59f..94b807f5d54757c63f60d26fbb626ef894282058 100644 (file)
@@ -138,8 +138,8 @@ endif
 $(curdir)/index: FORCE
        @echo Generating package index...
        @for d in $(PACKAGE_SUBDIRS); do ( \
-               [ -d $(PACKAGE_DIR)/$$d ] && \
-                       cd $(PACKAGE_DIR)/$$d || continue; \
+               mkdir -p $(PACKAGE_DIR)/$$d; \
+               cd $(PACKAGE_DIR)/$$d || continue; \
                $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages && \
                        gzip -9c Packages > Packages.gz; \
        ); done
index a398559bd8c7da3423b16cde4e26aeeeb99b7b58..12d143a04458f7273684f2c012ab013790f1f7f5 100755 (executable)
@@ -9,8 +9,10 @@ if [ -z $pkg_dir ] || [ ! -d $pkg_dir ]; then
 fi
 
 which md5sum >/dev/null 2>&1 || alias md5sum=md5
+empty=1
 
 for pkg in `find $pkg_dir -name '*.ipk' | sort`; do
+       empty=
        name="${pkg##*/}"
        name="${name%%_*}"
        [[ "$name" = "kernel" ]] && continue
@@ -28,3 +30,4 @@ SHA256sum: $sha256sum\\
 Description:/"
        echo ""
 done
+[ -n "$empty" ] && echo