[24236] in Source-Commits
/svn/athena r23837 - trunk/debathena/scripts
daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Sun Jun 7 18:09:07 2009
Date: Sun, 7 Jun 2009 18:08:55 -0400
From: Geoffrey Thomas <geofft@MIT.EDU>
Message-Id: <200906072208.n57M8toQ019326@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: geofft
Date: 2009-06-07 18:08:54 -0400 (Sun, 07 Jun 2009)
New Revision: 23837
Modified:
trunk/debathena/scripts/damove
Log:
Make it impossible to make the mistake I just made.
(Well, you can still do so, but you'll be told that you're making a
mistake.)
Modified: trunk/debathena/scripts/damove
===================================================================
--- trunk/debathena/scripts/damove 2009-06-04 00:17:54 UTC (rev 23836)
+++ trunk/debathena/scripts/damove 2009-06-07 22:08:54 UTC (rev 23837)
@@ -1,9 +1,9 @@
#!/bin/sh
-# Usage: damove NEW_SUFFIX OLD_SUFFIX PACKAGE
+# Usage: damove NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE
# Move the source package from the old suffix to the new suffix, where
-# a suffix is probably one of "", "-proposed", or "-dev"
+# a suffix is probably one of "", "-proposed", or "-development"
#
# This moves any source or binary package built from the source
# package PACKAGE
@@ -11,12 +11,29 @@
: ${DEBATHENA_APT=/mit/debathena/apt}
. $(dirname "$0")/debian-versions.sh
-if [ "$#" -lt 3 ]; then
- echo "Usage: damove NEW_SUFFIX OLD_SUFFIX PACKAGE" >&2
+if [ "$#" -ne 3 ]; then
+ echo "Usage: damove NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE" >&2
exit 1
fi
+case "${1}/${2}" in
+ /-proposed) ;;
+ /-development) ;;
+ -proposed/-development) ;;
+ *)
+ echo "WAIT. You are about to move $3"
+ echo " FROM debathena$2 TO debathena$1,"
+ echo -n "which is probably backwards. Is that a good idea [yes/N]? "
+ read yn
+ if [ "$yn" != "yes" ]; then
+ echo "that's what I thought. Exiting."
+ return 1
+ fi ;;
+esac
+
for code in $DEBIAN_CODES; do
reprepro -Vb $DEBATHENA_APT copysrc "${code}${1}" "${code}${2}" "$3"
- reprepro -Vb $DEBATHENA_APT removesrc "${code}${2}" "$3"
+ if [ "$1" != "$2" ]; then
+ reprepro -Vb $DEBATHENA_APT removesrc "${code}${2}" "$3"
+ fi
done