2014-02-26 14:50:23 +04:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2014-02-27 13:08:49 +04:00
|
|
|
# $NetBSD: gcc2gcc.old,v 1.4 2014/02/27 09:08:49 mrg Exp $
|
2014-02-26 14:50:23 +04:00
|
|
|
|
|
|
|
# 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
|
2014-02-27 01:18:14 +04:00
|
|
|
echo "Note that copy-to-dir must not exist." 1>&2
|
2014-02-26 14:50:23 +04:00
|
|
|
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 {} +
|
2014-02-27 13:08:49 +04:00
|
|
|
$doit rm -f "$destdir"/gcc/gcc2netbsd "$destdir"/gcc/gcc2gcc.old "$destdir"/gcc/difz
|
2014-02-26 14:50:23 +04:00
|
|
|
|
2014-02-27 01:18:14 +04:00
|
|
|
date=$(date +%Y%m%d-%H%M)
|
2014-02-26 14:50:23 +04:00
|
|
|
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
|