--- /dev/null
+#!/bin/bash
+
+usage() {
+ cat <<-EOF
+ backup-dvd [options]
+
+ Options:
+ -i <input dev> Defaults to ${dev}
+ -o <output dir> Defaults to ${out}
+ EOF
+ exit ${1:-0}
+}
+
+dev=/dev/cdrom
+out=${PWD}
+
+eval set -- `getopt -- hi:o: "$@"`
+while [[ -n $1 ]] ; do
+ case $1 in
+ -h) usage;;
+ -i) dev=$2; shift 2;;
+ -o) out=$2; shift 2;;
+ --) shift; break;;
+ -*) usage 1;;
+ *) usage 2; break;;
+ esac
+done
+
+# iso-info mkisofs
+Application= # -A
+Preparer= # -p
+Publisher= # -publisher
+System= # -sysid
+Volume= # -V
+Volume_Set= # -volset
+
+info=$(iso-info ${dev}) || exit 1
+
+eval $(echo "${info}" | awk -F: '
+ (NF > 1 && $1 !~ /image/) {
+ sub(/ *$/, "", $1);
+ sub(/ /, "_", $1);
+ sub(/^ */, "", $2);
+ print $1 "=\"" $2 "\"";
+}')
+
+if [[ -z ${Volume} ]] ; then
+ echo "Unable to parse Volume out of ISO"
+ iso-info ${dev}
+fi
+
+echo "Backing up: ${Volume}"
+
+e() {
+ for a ; do
+ [[ ${a} == *" "* || ${#a} == 0 ]] && fmt='"%s"' || fmt='%s'
+ printf "${fmt} " "${a}"
+ done
+ echo
+ "$@"
+}
+e dvdbackup -M -i ${dev} -o "${out}"
+e mkisofs -quiet -dvd-video \
+ -A "${Application}" \
+ -p "${Preparer}" \
+ -publisher "${Publisher}" \
+ -sysid "${System}" \
+ -V "${Volume}" \
+ -volset "${Volume_Set}" \
+ -o "${out}/${Volume}.iso" "${Volume}"
+du -h "${out}/${Volume}.iso"
+
+exec eject
--- /dev/null
+#!/bin/bash
+
+err() { echo "$*" 1>&2; exit 1; }
+
+if [[ $# -eq 0 ]] ; then
+ cat <<-EOF
+ Usage: $0 <files to post>
+ EOF
+ exit 1
+fi
+
+for pkg in "$@" ; do
+ if [[ ! -e ${pkg} ]] ; then
+ case ${pkg} in
+ */*) err "${pkg}: does not exist" ;;
+ *)
+ pkg="/usr/portage/distfiles/${pkg}"
+ if [[ ! -e ${pkg} ]] ; then
+ err "${pkg}: does not exist"
+ fi
+ ;;
+ esac
+ fi
+
+ p=${pkg##*/}
+ echo "${p}: posting"
+ scp "${pkg}" dev:~/
+ ssh dev "cp ${p} public_html/dist/ && mv ${p} /space/distfiles-local/"
+done
--- /dev/null
+GNULIB_SRCDIR=/usr/local/src/gnu/gnulib
+[[ ! -d ${GNULIB_SRCDIR} ]] && GNULIB_SRCDIR=/usr/local/src/gnulib
+if [[ -d ${GNULIB_SRCDIR} ]] ; then
+ export GNULIB_SRCDIR
+else
+ unset GNULIB_SRCDIR
+fi