root/trunk/freewrt/scripts/ipkg-make-index.sh

Revision 2287, 0.5 kB (checked in by tg, 2 years ago)

why were we still using the python ipkg-make-index even if we
already had a shell one and weren't scan-tools.sh'ing for python
existence any more? right, because it had bugs…

while here, remove the executable bit from the script and call
it with the proper shell, convert to bash, fix output to be
about the same as from the python script

Line 
1 set -e
2
3 pkg_dir=$1
4
5 if [[ -z $pkg_dir || ! -d $pkg_dir ]]; then
6         echo "Usage: ipkg-make-index <package_directory>"
7         exit 1
8 fi
9
10 find "$pkg_dir" -name '*.ipk' | sort | while IFS= read pkg; do
11         dpkg=${pkg##*/}
12         echo "Generating index for package $dpkg" >&2
13         file_size=$(ls -l $pkg | awk '{print $5}')
14         md5sum=$(md5sum $pkg)
15         tar -xzOf "$pkg" ./control.tar.gz | \
16             tar -xzOf - ./control | \
17             sed -e "s^Description:Filename: $dpkg\\
18 Size: $file_size\\
19 MD5Sum: ${md5sum%% *}\\
20 Description:"
21         echo ""
22 done
23 exit 0
Note: See TracBrowser for help on using the browser.