[Debian-NP-Commits] r301 - people/vagrant/simple-cdd

Vagrant Cascadian debian-np-devel@lists.alioth.debian.org
Fri, 03 Dec 2004 15:31:06 -0700


Author: vagrant-guest
Date: Fri Dec  3 15:30:58 2004
New Revision: 301

Added:
   people/vagrant/simple-cdd/checkpackages   (contents, props changed)
Log:
adding script to check if packages are in the mirror


Added: people/vagrant/simple-cdd/checkpackages
==============================================================================
--- (empty file)
+++ people/vagrant/simple-cdd/checkpackages	Fri Dec  3 15:30:58 2004
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# checks if the packages needed for a profile are in the debian mirror
+
+. CONF.sh
+
+status=0
+
+for profile in $profiles ; do
+  missing_packages=""
+  for a in $(egrep -v ^# profiles/$profile.packages ); do 
+    test -z "$(find $MIRROR/pool/main/ -type f -name $a*.deb)" && missing_packages="$missing_packages $a"
+  done
+  if [ -n "$missing_packages" ]; then
+    echo "Packages missing from profile $profile : $missing_packages"
+    status="$(($status + 1))"
+  fi
+  missing_downloads=""
+  for a in $(egrep -v ^# profiles/$profile.downloads ); do 
+    test -z "$(find $MIRROR/pool/main/ -type f -name $a*.deb)" && missing_downloads="$missing_downloads $a"
+  done
+  if [ -n "$missing_downloads" ]; then
+    echo "Extra packages missing from profile $profile : $missing_downloads"
+  fi
+done
+
+exit $status