source: trunk/debathena/scripts/damove @ 25747

Revision 25747, 818 bytes checked in by jdreed, 12 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: damove NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE
4
5# Move 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 moves any source or binary package built from the source
9# package PACKAGE
10
11set -e
12
13: ${DA_SCRIPTS_DIR="$(dirname "$0")"}
14. "$DA_SCRIPTS_DIR"/debian-versions.sh
15
16if [ "$#" -lt 3 ]; then
17    echo "Usage: damove NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE" >&2
18    exit 1
19fi
20
21new_suffix="$1"; shift
22old_suffix="$1"; shift
23
24for pkg in "$@"; do
25    dacopy "$new_suffix" "$old_suffix" "$pkg"
26    if [ "$new_suffix" != "$old_suffix" ]; then
27        daremove "$old_suffix" "$pkg"
28    fi
29    if hash zwrite 2>/dev/null; then
30        zwrite -d -c debathena -i apt -m "Moved $pkg from $old_suffix to ${new_suffix:-production}"
31    fi
32done
Note: See TracBrowser for help on using the repository browser.