#!/bin/sh # find out if packages listed in our deps file are installed or not # and write installed to our deps-$CATEGORY file. # $CATEGORY found from current directory CATEGORY=$(pwd | rev | cut -d'/' -f1 | rev) DEPS=$CATEGORY.deps BUILT=$CATEGORY-deps.built FAILED=$CATEGORY-deps.failed let found=2 # 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]) } # check if deps are installed cat $DEPS | sed 's/\/$//g; s/^.*\///g' | while read pkg do caps $pkg CAPSINST=$res ls -1 /var/log/packages/$pkg* 2>/dev/null | while read i do caps $(echo $i | cut -d'/' -f5- | rev | cut -d- -f4- | rev) CAPSPKG=$res # test if installed and write file if found if [ "$CAPSPKG" == "$CAPSINST" ]; then cat=$(ls -d /var/lib/sbopkg/slackbuilds/*/$pkg | cut -d'/' -f6) echo $CATEGORY/$pkg dependency built echo $CATEGORY/$pkg >> deps-tmp let found=1 break fi done if [ $found -eq 0 ]; then echo $CATEGORY/$pkg dependency failed echo $CATEGORY/$pkg >> failed-tmp fi done # sort alphabetically if [ -r deps-tmp ]; then sort deps-tmp > $BUILT rm deps-tmp fi if [ -r failed-tmp ]; then sort failed-tmp > $FAILED rm failed-tmp fi