summaryrefslogtreecommitdiff
path: root/Master/Tools/tpm-delete
blob: 50ecab33e2098c4bd7c0e6a7f7034964d88b46d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# $Id: //depot/Master/Tools/tpm-delete#1 $
# Public domain.  Originally written 2005, Karl Berry.
# 
# Delete a tpm and the files it references from the repository.
# Takes just the package name, no .tpm suffix, no type, no subdirs.

mydir=`dirname $0`  # Master/Tools

Master=`cd $mydir/.. && pwd`
cd $Master || exit 1

for arg in "$@"; do
  file="$arg.tpm"
  
  if test -r texmf-dist/tpm/$arg.tpm; then
    type=Package
  elif test -r texmf/tpm/$arg.tpm; then
    type=TLCore
  elif test -r texmf-doc/tpm/$arg.tpm; then  
    type=Documentation
  else
    echo "$0: cannot find $file, goodbye." >&1
    exit 1
  fi
  
  files=`./Tools/tpm-factory.pl \
    --master_dir=$Master --dest_dir=/tmp --ftp_dir=/tmp \
    --dry --remove --name=$type/$arg \
  | sed 's/^would unlink //'`
  
  p4 delete $files
done