2
0

make-ipkg-dir.sh 741 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. BASE=http://svn.openwrt.org/openwrt/trunk/openwrt
  3. TARGET=$1
  4. CONTROL=$2
  5. VERSION=$3
  6. ARCH=$4
  7. WD=$(pwd)
  8. mkdir -p "$TARGET/CONTROL"
  9. grep '^[^(Version|Architecture)]' "$CONTROL" > "$TARGET/CONTROL/control"
  10. grep '^Maintainer' "$CONTROL" 2>&1 >/dev/null || \
  11. echo "Maintainer: LEDE Community <lede-dev@lists.infradead.org>" >> "$TARGET/CONTROL/control"
  12. grep '^Source' "$CONTROL" 2>&1 >/dev/null || {
  13. pkgbase=$(echo "$WD" | sed -e "s|^$TOPDIR/||g")
  14. [ "$pkgbase" = "$WD" ] && src="N/A" || src="$BASE/$pkgbase"
  15. echo "Source: $src" >> "$TARGET/CONTROL/control"
  16. }
  17. echo "Version: $VERSION" >> "$TARGET/CONTROL/control"
  18. echo "Architecture: $ARCH" >> "$TARGET/CONTROL/control"
  19. chmod 644 "$TARGET/CONTROL/control"