Re: error: Multiple definitions of the symbol

Michael Haggerty <[email protected]> Sun, 24 Jan 2010 05:30:08 +0100
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
Daniel Dickman wrote:
> I'm running into an issue while trying to convert the OpenBSD repo to
> git using the standard cvs2svn 2.3.0 package on OpenBSD. [...]
> ERROR: Multiple definitions of the symbol 'netbsd_1_1' in
> '/usr/cvs/test/externs.h,v': 1.1.1.1 1.1.1
> Exited due to fatal error(s).
> 
> Looking at the raw ,v file itself, it seems like the problem is due to
> having the symbol "netbsd_1_1" appear twice.

Correct.  This should not usually happen, though I am not sure whether
CVS explicitly prevents it in all cases.

> So I was wondering if there's something I'm doing wrong here that I
> can fix. I've attached the test repo and the options file in case they
> are helpful.

First, decide which of the definitions is unwanted (probably 1.1.1.1).

Then, either hand-edit the RCS file to remove the unwanted definition,
or use a SymbolTransform like the following (untested) to have cvs2svn
ignore it:

class PickyIgnoreSymbolTransform(SymbolTransform):
  def __init__(self, cvs_path, symbol_name, revision):
    self.cvs_path = cvs_path
    self.symbol_name = symbol_name
    self.revision = revision

  def transform(self, cvs_file, symbol_name, revision):
    if cvs_file.cvs_path == self.cvs_path \
          and symbol_name == self.symbol_name \
          and revision == self.revision:
      return None
    else:
      return symbol_name

Then add the following to the symbol transform list in your options file:

    PickyIgnoreSymbolTransform('module/path/externs.h', 'netbsd_1_1',
'1.1.1.1')

As documented in cvs2svn_lib/symbol_transform.py:SymbolTransform,
returning None from the transform() method causes the specified symbol
definition to be silently ignored.  You can probably infer how to
generalize this approach if in fact the same problem occurs in many files.

Michael

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2441483

To unsubscribe from this discussion, e-mail: [[email protected]].