From 5487740b5963196f01beca92651b827c3340a708 Mon Sep 17 00:00:00 2001 From: Segler Date: Mon, 5 Dec 2011 16:55:10 +0000 Subject: [PATCH] initial git-svn-id: svn://svn.compuextreme.de/Viitor/V962/ViitorMake@6288 504e572c-2e33-0410-9681-be2bf7408885 --- Scripts/gen_var_install_contents | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 Scripts/gen_var_install_contents diff --git a/Scripts/gen_var_install_contents b/Scripts/gen_var_install_contents new file mode 100755 index 0000000..9ea18ff --- /dev/null +++ b/Scripts/gen_var_install_contents @@ -0,0 +1,32 @@ +#!/bin/bash + +FTP_PATH=/ftp/pub/ViitorLinux/V962/PIV/BINARY/ +INST_PATH=/mnt/Viitor/DISTRIBUTION/ + +cd /var/install +mv contents contents.`date +%s` +touch contents + +for PACKAGE in `find . -maxdepth 1 -type d -name '??*' | sed -e "s/\.\///g"`; do + echo -e -n $PACKAGE"\t\t\t" + PACKAGEFILE=`find $FTP_PATH $INST_PATH -name $PACKAGE.vpg | head --lines=1` + if [ "x${PACKAGEFILE}x" == "xx" ]; then + echo "NOT FOUND" + else + echo "FOUND" + HEADER=`head --lines=1 $PACKAGEFILE` + + COUNT=0 + SUM=0 + for i in $HEADER; do + if [ $COUNT -lt 4 ]; then + COUNT=$(( $COUNT + 1 )) + SUM=$(( $SUM + $i )) + SIZE=$i + fi + done + + + tail --lines=+2 `find $FTP_PATH $INST_PATH -name $PACKAGE.vpg | head --lines=1` | head --bytes=$SUM | tail --bytes=$SIZE | bunzip2 -c >>contents + fi +done