This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Moving C to its own directory (was Re: ObjC tree inlining)


On Mon, Nov 19, 2001 at 12:27:45PM -0500, Phil Edwards wrote:
> On Sun, Nov 18, 2001 at 04:59:53PM +0000, Neil Booth wrote:
> > c-lang.c is C only.  I think it would be good to create a C directory
> > for the C front end to dispel confusion like this.  It might also help
> > towards making C just another front end, rather than the somewhat
> > special status it currently has.  What do you think Joseph?
> 
> The usual objection to this is that it makes CVS history browsing more
> difficult,e.g., the problems discussed in
> 
>     http://www.cvshome.org/docs/manual/cvs_7.html#SEC66
> 
> No matter which of the two or three methods of moving files we use, at
> least one CVS operation will be much harder.

It is trival.  Do a repository copy.
    cd /cvs/gcc/gcc
    mkdir c
    cd c
    cp ../foo.c,v .
    #run script to prefix tags with "old_"
    cd /tmp
    cvs co gcc
    cd gcc/gcc/
    cvs rm -f foo.c
    cvs ci foo.c
    cd c
    cvs ci -f -m 'repo copied from gcc/gcc/' *


#! /bin/sh

# Recursive function so that the tags are done in reverse order.  That
# makes them come out in the same order in the final file.
fix() {
    local file tag

    if [ $# -le 1 ]; then
	return
    fi
    file=$1
    tag=$2
    shift 2
    fix $file $* || exit
    new=old_$tag
    echo "  $tag ==> $new"
    rcs -q -n${new}:${tag} $file || exit
    rcs -q -n${tag} $file || exit
}

ecmd=cat
icmd=cat

while getopts "e:i:" opt; do
    case $opt in
    e) ecmd="fgrep -f $OPTARG -x -v";;
    i) icmd="fgrep -f $OPTARG -x";;
    *) echo "Usage: $(basename $0) [-e excludefrom] [-i includefrom] file..."
       exit 1;;
    esac
done
shift $(($OPTIND-1))

for file; do
    echo $file:
    tags=$(rlog -h $file | grep '^	' | grep -v '^	old' |\
	sed -e 's/^	\([^:]*\):.*$/\1/' | $ecmd | $icmd)
    fix $file $tags
done


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]