Ignore EEXIST from rmdir since some kernels (such as solaris) return that instead...
[portage.git] / bin / newins
1 #!/bin/bash
2 # Copyright 1999-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Id$
5
6 if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
7         echo "$0: Need two arguments, old file and new file" 1>&2
8         exit 1
9 fi
10
11 rm -rf "${T}/${2}" && \
12 cp -f "${1}" "${T}/${2}" && \
13 exec doins "${T}/${2}"