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 *
RevLine 
[23555]1#!/bin/sh
2
[23837]3# Usage: damove NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE
[23555]4
5# Move the source package from the old suffix to the new suffix, where
[23837]6# a suffix is probably one of "", "-proposed", or "-development"
[23555]7#
8# This moves any source or binary package built from the source
9# package PACKAGE
10
[24379]11set -e
12
[25747]13: ${DA_SCRIPTS_DIR="$(dirname "$0")"}
14. "$DA_SCRIPTS_DIR"/debian-versions.sh
[23555]15
[25677]16if [ "$#" -lt 3 ]; then
[23837]17    echo "Usage: damove NEW_SUFFIX OLD_SUFFIX SOURCE_PACKAGE" >&2
[23555]18    exit 1
19fi
20
[24079]21new_suffix="$1"; shift
22old_suffix="$1"; shift
[23837]23
[25676]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
[25678]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}"
[25694]31    fi
[25676]32done
Note: See TracBrowser for help on using the repository browser.