[backfire] merge r23029, r23030, r23031 and r23032
[openwrt-10.03/.git] / target / imagebuilder / files / opkg-generate-config.sh
index a385d9fa9b93b988c7407622aa444a36b8435848..b2047a0d45aa96cd4475018d70d9ec1f9dc26f54 100755 (executable)
@@ -12,7 +12,8 @@ TARGETDIR="${1}"
 PKGARCH=
 for pkg in $TOPDIR/packages/*.ipk; do
        if [ -f "$pkg" ]; then
-               PKGARCH="${pkg##*_}"
+               PKGARCH="${pkg##*/}"
+               PKGARCH="${PKGARCH#*_*_}"
                PKGARCH="${PKGARCH%.ipk}"
                [ "$PKGARCH" = all ] || break
        fi
@@ -31,7 +32,7 @@ rm -f $TOPDIR/tmp/opkg.conf
 
 [ -f $TOPDIR/repositories.conf ] && \
        $TOPDIR/staging_dir/host/bin/sed \
-               -n -e "s/\$A/$PKGARCH/g" -e "/^[[:space:]*]src/p" \
+               -n -e "s/\$A/$PKGARCH/g" -e "/^[[:space:]]*src/p" \
                $TOPDIR/repositories.conf > $TOPDIR/tmp/opkg.conf
 
 cat <<EOT >> $TOPDIR/tmp/opkg.conf