Skip to content

Commit

Permalink
20150930
Browse files Browse the repository at this point in the history
  • Loading branch information
marinelli committed May 10, 2017
1 parent fecb406 commit 68cb2f4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
45 changes: 45 additions & 0 deletions opt/local/bin/opkg-make-index
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh

set -e

###
_CMD_NAME="${0##*/}"
. /opt/local/lib/exe.sh
###


export_required_commands 'awk find ls md5sum openssl tar'


_PKGS_PATH="$1"

if [ -z "$_PKGS_PATH" ] || [ ! -d "$_PKGS_PATH" ] ; then
printf '!!! %s : %s\n' "$_CMD_NAME" 'you need to pass a directory as argument' 1>&2
exit 1
fi


for _CUR_PKG_PATH in $( "$__ext_find" "$_PKGS_PATH" -type f -name '*.ipk' | sort ) ; do
_CUR_PKG_FILENAME="${_CUR_PKG_PATH##*/}"
_CUR_PKG_NAME="${_CUR_PKG_FILENAME%%_*}"

if [ "$_CUR_PKG_NAME" = 'kernel' ] || [ "$_CUR_PKG_NAME" = 'libc' ] ; then
continue
fi

_CUR_PKG_SIZE=$( "$__ext_ls" -l "$_CUR_PKG_PATH" | "$__ext_awk" '{ print $5 }' )
_CUR_PKG_MD5=$( "$__ext_md5sum" "$_CUR_PKG_PATH" | "$__ext_awk" '{ print $1 }' )
_CUR_PKG_SHA256=$( "$__ext_openssl" dgst -sha256 "$_CUR_PKG_PATH" | "$__ext_awk" '{ print $2 }' )

tar zxOf "$_CUR_PKG_PATH" ./control.tar.gz | \
tar zxOf - ./control | \
sed -e "s/^Description:/\
Filename: ${_CUR_PKG_FILENAME}\\
Size: ${_CUR_PKG_SIZE}\\
MD5Sum: ${_CUR_PKG_MD5}\\
SHA256sum: ${_CUR_PKG_SHA256}\\
Description:/"

printf '\n'
done

4 changes: 4 additions & 0 deletions opt/local/etc/opkg-bootstrap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
1 change: 1 addition & 0 deletions opt/local/etc/opkg/bootstrap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/gz local file:///tmp/bootstrap/packages/

0 comments on commit 68cb2f4

Please sign in to comment.