64 lines
1.3 KiB
Plaintext
64 lines
1.3 KiB
Plaintext
|
#! /bin/sh
|
||
|
#
|
||
|
# $NetBSD: gcc2gcc.old,v 1.1 2014/02/26 10:50:23 mrg Exp $
|
||
|
|
||
|
# run it like eg:
|
||
|
#
|
||
|
# % ./gcc2gcc.old /usr/src/external/gpl3/gcc /home/import/gcc
|
||
|
|
||
|
doit=echo
|
||
|
doit=
|
||
|
|
||
|
progname="$(basename "$0")"
|
||
|
|
||
|
usage() {
|
||
|
echo "Usage: $progname src/external/gpl3/gcc <copy-to-dir>" 1>&2
|
||
|
edho "Note that copy-to-dir must not exist." 1>&2
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
#set -x
|
||
|
set -e
|
||
|
|
||
|
srcdir="$1"
|
||
|
destdir="$2"
|
||
|
|
||
|
if [ -z "$srcdir" -o -z "$destdir" ]; then
|
||
|
usage
|
||
|
fi
|
||
|
|
||
|
if [ ! -d "$srcdir" ]; then
|
||
|
echo "srcdir '$srcdir' is not a directory" 1>&2
|
||
|
usage
|
||
|
fi
|
||
|
if [ -e "$destdir" ]; then
|
||
|
echo "destdir '$destdir' is something" 1>&2
|
||
|
ls -ld "$destdir"
|
||
|
usage
|
||
|
fi
|
||
|
|
||
|
# Assumes that ../gcc/. == .
|
||
|
cd "$srcdir"/..
|
||
|
if [ ! -d gcc ]; then
|
||
|
echo "$srcdir/../gcc doesn't exist." 1>&2
|
||
|
usage
|
||
|
fi
|
||
|
|
||
|
echo "Copying files to $destdir..."
|
||
|
$doit pax -rwpp gcc "$destdir"
|
||
|
|
||
|
|
||
|
# clean the copy
|
||
|
echo "Cleaning CVS turds and ChangeLogs"
|
||
|
$doit find "$destdir" -name .CVS -exec rm -rf {} +
|
||
|
$doit find "$destdir" -name CVS -exec rm -rf {} +
|
||
|
$doit find "$destdir" -name "ChangeLog*" -exec rm -f {} +
|
||
|
$doit rm -f "$destdir"/gcc2netbsd "$destdir"/gcc2gcc.old
|
||
|
|
||
|
date=$(date +%Y%m%M-%H%M)
|
||
|
echo GCC copied to gcc.old. use these commands to import:
|
||
|
echo cd "$destdir/gcc"
|
||
|
echo cvs import src/external/gpl3/gcc.old NetBSD src-external-gpl3-gcc-$date
|
||
|
|
||
|
exit 0
|