source: trunk/debathena/scripts/dacopy @ 25747

Revision 25747, 1.1 KB checked in by jdreed, 9 years ago (diff)
Get rid of "dirname $0" and replace with DA_SCRIPTS_DIR, which allows overriding at run time. (Trac: #1191)
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3# Usage: dacopy NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE
4
5# Copy the source package from the old suffix to the new suffix, where
6# a suffix is probably one of "", "-proposed", or "-development"
7#
8# This copies any source or binary package built from the source
9# package PACKAGE
10
11: ${DA_SCRIPTS_DIR="$(dirname "$0")"}
12. "$DA_SCRIPTS_DIR"/debian-versions.sh
13
14if [ "$#" -lt 3 ]; then
15    echo "Usage: dacopy NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE" >&2
16    exit 1
17fi
18
19if [ "$1" = "-bleeding" ] || [ "$2" = "-bleeding" ]; then
20    echo "You're not supposed to move or copy things to or from -bleeding."
21    echo "Exiting..."
22    exit 1
23fi
24
25
26case "${1}/${2}" in
27  /-proposed) ;;
28  /-development) ;;
29  -proposed/-development) ;;
30  *)
31    echo "WAIT. You are about to copy $3"
32    echo "  FROM debathena$2 TO debathena$1,"
33    echo -n "which is probably backwards. Is that a good idea [yes/N]? "
34    read yn
35    if [ "$yn" != "yes" ]; then
36      echo "that's what I thought. Exiting."
37      exit 1
38    fi ;;
39esac
40
41for code in $DEBIAN_CODES; do
42    dareprepro copysrc "${code}${1}" "${code}${2}" "$3"
43done
Note: See TracBrowser for help on using the repository browser.