Browse files

Add new "check-ports" target, to test locally built packages from

poudriere if we are missing any essential PC-BSD related packages
  • Loading branch information...
1 parent c474acc commit fb40abb18a48329f953df78e8e9d9c9144248553 @kmoore134 kmoore134 committed Nov 21, 2013
Showing with 51 additions and 0 deletions.
  1. +2 −0 Makefile
  2. +7 −0 scripts/build-iso.sh
  3. +42 −0 scripts/functions.sh
View
2 Makefile
@@ -10,6 +10,8 @@ image:
@cd ${.CURDIR}/scripts/ && sh build-iso.sh iso
world:
@cd ${.CURDIR}/scripts/ && sh build-iso.sh world
+check-ports:
+ @cd ${.CURDIR}/scripts/ && sh build-iso.sh check-ports
ports:
@cd ${.CURDIR}/scripts/ && sh build-iso.sh ports
ports-update-all:
View
7 scripts/build-iso.sh
@@ -101,6 +101,12 @@ do_ports_pcbsd()
exit $?
}
+do_check_ports()
+{
+ check_essential_pkgs "NO"
+ exit $?
+}
+
echo "Operation started: `date`"
TARGET="$1"
@@ -115,6 +121,7 @@ case $TARGET in
world) do_world ;;
iso) do_iso ;;
ports) do_ports ;;
+check-ports) do_check_ports ;;
ports-update-all) do_ports_all ;;
ports-update-pcbsd) do_ports_pcbsd ;;
clean) do_clean ;;
View
42 scripts/functions.sh
@@ -323,3 +323,45 @@ get_last_rev()
fi
return 1
}
+
+check_essential_pkgs()
+{
+ echo "Checking essential pkgs..."
+ haveWarn=0
+
+ # Check all our PC-BSD meta-pkgs, warn if some of them don't exist
+ # or cannot be determined
+ chkList=`ls -d ${PJPORTSDIR}/sysutils/pcbsd-util* ${PJPORTSDIR}/misc/pcbsd-* ${PJPORTSDIR}/misc/trueos-*`
+ for i in $chkList
+ do
+
+ # Get the pkgname
+ pkgName=""
+ pkgName=`make -C ${i} -V PKGNAME PORTSDIR=${PJPORTSDIR} __MAKE_CONF=/usr/local/etc/poudriere.d/$PBUILD-make.conf`
+ if [ -z "${pkgName}" ] ; then
+ echo "Could not get PKGNAME for ${i}"
+ haveWarn=1
+ fi
+
+ # Check the arch type
+ pArch=`make -C ${i} -V ONLY_FOR_ARCHS PORTSDIR=${PJPORTSDIR}`
+ if [ -n "$pArch" -a "$pArch" != "$ARCH" ] ; then continue; fi
+
+ if [ ! -e "${PPKGDIR}/All/${pkgName}.txz" ] ; then
+ echo "WARNING: Missing package ${pkgName} for port ${i}"
+ haveWarn=1
+ else
+ fi
+ done
+ if [ $haveWarn -ne 0 -a "$1" != "NO" ] ; then
+ echo "Warning: Packages are missing! Continue?"
+ echo -e "(Y/N)\c"
+ read tmp
+ if [ "$tmp" != "y" -a "$tmp" != "Y" ] ; then
+ rtn
+ exit 1
+ fi
+ fi
+
+ return $haveWarn
+}

0 comments on commit fb40abb

Please sign in to comment.