Skip to content

Commit e8daae4

Browse files
committed
[ci] Check for usign binary before package index generation #149
Add check for usign binary existence before running make package/index. If usign is missing from cache, build it using tools/usign/compile. Also ensures output directory exists before writing checksum file and uses improved awk filtering for better multi-package support. Closes #149
1 parent 27c12ab commit e8daae4

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

runbuild

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,21 @@ make -j"$CORES" package/openwisp-config/compile || make -j1 V=s package/openwisp
5454

5555
# Generate package index with checksums
5656
cd "$BUILD_DIR"/openwrt
57-
# Ensure tools are built (usign is needed for package index generation)
58-
make -j1 tools/install V=s
57+
# Check if usign binary exists (needed for package index), build if missing
58+
if [ ! -x staging_dir/host/bin/usign ]; then
59+
echo "usign missing, building tools/usign..."
60+
make tools/usign/compile V=s
61+
fi
5962
make package/index V=s
6063

6164
# Filter Packages file to include only openwisp packages and save as checksum file
62-
awk '/^Package: openwisp/,/^$/' \
63-
"$BUILD_DIR"/openwrt/bin/packages/"$COMPILE_TARGET"/Packages \
64-
>"$BUILD_DIR"/openwrt/bin/packages/"$COMPILE_TARGET"/openwisp/Packages.sha256.checksum
65+
mkdir -p "$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/openwisp"
66+
awk '
67+
/^Package: openwisp/ {flag=1}
68+
flag {print}
69+
/^$/ {flag=0}
70+
' "$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/Packages" \
71+
>"$BUILD_DIR/openwrt/bin/packages/$COMPILE_TARGET/openwisp/Packages.sha256.checksum"
6572

6673
mv "$BUILD_DIR"/openwrt/bin/packages/"$COMPILE_TARGET"/openwisp "$VERSIONED_DIR"
6774

0 commit comments

Comments
 (0)