#!/bin/sh # create two files built-$CATEGORY and failed-$CATEGORY made from testing whether # packages in our sbopkg queue file are installed or not. # $CATEGORY is current directory CATEGORY=$(pwd | rev | cut -d'/' -f1 | rev) BUILT=$CATEGORY.built FAILED=$CATEGORY.failed # zero files echo -n > $BUILT echo -n > $FAILED # function to make package names uppercase for compare, just in case. caps() { res=$(echo $1 | tr [a-z] [A-Z]) } # read the sbopkg queue file, created by mksqf.sh cat ${CATEGORY}.lst | sed 's/\/$//g; s/^.*\///g' | while read pkg do caps $pkg CAPSPKG=$CATEGORY/$(echo $res | sed 's/\/$//g') # test against installed packages ls -1 /var/log/packages/$pkg* 2>/dev/null | while read i do j=$(echo $i | cut -d'/' -f5- | rev | cut -d- -f4- | rev) caps $j CAPSINST=$CATEGORY/$res # test if installed and write to file if found if [ "$CAPSPKG" == "$CAPSINST" ]; then echo $CATEGORY/$pkg | tee -a $BUILT break fi done # not installed, ie failed if [ -z "$(grep -x $CATEGORY/$pkg $BUILT)" ]; then echo $CATEGORY/$pkg not built/installed echo $CATEGORY/$pkg >> $FAILED fi done