unity/scripts/respin.sh | 69 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 8 deletions(-)
New commits: commit 5a069d46418a2eb65e517238870886e8cdd99f3a Author: Jeroen van Meeuwen (Fedora Unity) <kana...@fedoraunity.org> Date: Mon Feb 23 15:13:48 2009 +0100 Update respin.sh diff --git a/unity/scripts/respin.sh b/unity/scripts/respin.sh index 53d374e..0e16203 100755 --- a/unity/scripts/respin.sh +++ b/unity/scripts/respin.sh @@ -1,5 +1,35 @@ #!/bin/bash +# +# Copyright 2008-2009 Jeroen van Meeuwen <kana...@fedoraunity.org> +# +# This is a script to automate respins for both installation and live media. +# +# The script makes the following assumptions: +# +# - you have sudo configured for the user you are executing the script with, for +# at least the following commands: +# +# 1) sudo make install (in /tmp/spin-kickstarts) +# 2) sudo ./revisor.py (if running from source) +# 3) sudo revisor (if running from installed RPMs) +# 4) sudo mkdir -p +# 5) sudo mv +# +# - you have all the required packages installed (see $revisor_deps) +# - you have enough disk space (haha, no estimate here) +# +# And, last but not least, you have configured the following in +# /etc/mock/site-defaults.cfg: +# +# # bind mount plugin is enabled by default but has no configured directories to mount +# # config_opts['plugin_conf']['bind_mount_enable'] = True +# config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/selinux/', '/selinux/' )) +# config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/srv/revisor/', '/srv/revisor/' )) +# # (optional) +# config_opts['plugin_conf']['bind_mount_opts']['dirs'].append(('/var/tmp/revisor-yumcache/', '/var/tmp/revisor-yumcache/' )) +# + function usage() { echo "$0 [options]" } @@ -8,6 +38,13 @@ if [ $# -eq 0 ]; then usage fi +revisor_deps="comps-extras createrepo rhpl pykickstart livecd-tools + anaconda-runtime squashfs-tools busybox-anaconda notify-python usermode + pam python automake intltool gettext desktop-file-utils glib2-devel gcc + cobbler koan deltarpm pygtk pygtk2-libglade gnome-python2-gconf + system-config-kickstart jigdo livecd-tools python-virtinst git sudo + spin-kickstarts mock" + while [ $# -gt 0 ]; do case $1 in --version) @@ -21,6 +58,17 @@ while [ $# -gt 0 ]; do esac done +# Thanks. Now, before we do anything, let's check if the packages we depend +# on are actually installed + +for pkg in $revisor_deps; do + if [ -z "`rpm -qv $pkg`" ]; then + pkg_error="$pkg_error\nPackage $pkg not installed" + fi +done + +[ ! -z "$pkg_error" ] && echo -en "ERROR:\n$pkg_error" && exit 1 + if [ -d ~/devel/revisor/master ]; then cd ~/devel/revisor/master @@ -64,13 +112,18 @@ for version in $VERSIONS; do sudo mv revisor-$spin.log /srv/revisor/$datestamp/$spin/log/ done - mock -r fedora-$version-$arch clean && \ - mock -r fedora-$version-$arch init && \ - mock -r fedora-$version-$arch install $revisor_deps && \ - echo -en "git clone git://git.fedorahosted.org/revisor\n" | mock -r fedora-$version-$arch shell - echo -en "cd /revisor; ./switchhere --yes\n" | mock -r fedora-$version-$arch shell - echo -en "cd /revisor; autoreconf && ./configure\n" | mock -r fedora-$version-$arch shell - echo -en "find /var/lib/rpm/ -name '__db.*' -delete\n" | mock -r fedora-$version-$arch shell - echo -en "cd /revisor; ./revisor.py --cli --config /etc/revisor-unity/f$version-install-respin.conf --model f$version-$arch-respin --debug 9\n" | mock -r fedora-$version-$arch shell; + mock -r fedora-$version-$arch clean | tee revisor-f$version-$arch-respin.log && \ + mock -r fedora-$version-$arch init | tee -a revisor-f$version-$arch-respin.log && \ + mock -r fedora-$version-$arch install $revisor_deps | tee -a revisor-f$version-$arch-respin.log && \ + echo -en "git clone git://git.fedorahosted.org/revisor\n" | mock -r fedora-$version-$arch shell | tee -a revisor-f$version-$arch-respin.log && \ + echo -en "cd /revisor; ./switchhere --yes\n" | mock -r fedora-$version-$arch shell | tee -a revisor-f$version-$arch-respin.log && \ + echo -en "cd /revisor; autoreconf && ./configure\n" | mock -r fedora-$version-$arch shell | tee -a revisor-f$version-$arch-respin.log && \ + echo -en "find /var/lib/rpm/ -name '__db.*' -delete\n" | mock -r fedora-$version-$arch shell | tee -a revisor-f$version-$arch-respin.log && \ + echo -en "cd /revisor; ./revisor.py --cli --config /etc/revisor-unity/f$version-install-respin.conf --destination-directory /srv/revisor/$datestamp/ --model f$version-$arch-respin --debug 9\n" | mock -r fedora-$version-$arch shell | tee -a revisor-f$version-$arch-respin.log + + [ $? -gt 0 ] && echo "Spin f$version-$arch-respin failed, log file attached" | mail -s "f$version-$arch-respin failed" -a revisor-f$version-$arch-respin.log "kana...@kanarip.com" + + sudo mkdir -p /srv/revisor/$datestamp/f$version-$arch-respin/log/ + sudo mv revisor-f$version-$arch-respin.log /srv/revisor/$datestamp/f$version-$arch-respin/log/ done done \ No newline at end of file _______________________________________________ revisor-devel mailing list revisor-devel@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/revisor-devel