From 63a744559f5dca4bfc64581b0c23fcfb7988861e Mon Sep 17 00:00:00 2001 From: Antoine Lambert Date: Thu, 21 Apr 2022 16:08:06 +0200 Subject: [PATCH] sourceforge: Do not consider Attic as a valid CVS module The Attic folder that can sometimes be found in a CVS respository is a special one used by CVS to store RCS files and should not be considered as a valid module name when listing CVS projects. --- swh/lister/sourceforge/lister.py | 15 ++++++++------- swh/lister/sourceforge/tests/data/aaron.html | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/swh/lister/sourceforge/lister.py b/swh/lister/sourceforge/lister.py index c95a089..9b5fc20 100644 --- a/swh/lister/sourceforge/lister.py +++ b/swh/lister/sourceforge/lister.py @@ -386,14 +386,15 @@ class SourceForgeLister(Lister[SourceForgeListerState, SourceForgeListerPage]): match = re.search(rf".*/cvsroot/{project} co -P (.+)", text) if match is not None: module = match.group(1) - url = f"{cvs_base_url}/{project}/{module}" - hits.append( - SourceForgeListerEntry( - vcs=VcsNames(tool_name), - url=url, - last_modified=last_modified, + if module != "Attic": + url = f"{cvs_base_url}/{project}/{module}" + hits.append( + SourceForgeListerEntry( + vcs=VcsNames(tool_name), + url=url, + last_modified=last_modified, + ) ) - ) continue url = CLONE_URL_FORMAT.format( vcs=tool_name, diff --git a/swh/lister/sourceforge/tests/data/aaron.html b/swh/lister/sourceforge/tests/data/aaron.html index 5b1c226..7b9d5f4 100644 --- a/swh/lister/sourceforge/tests/data/aaron.html +++ b/swh/lister/sourceforge/tests/data/aaron.html @@ -16,6 +16,7 @@ You can run a per-module CVS checkout via pserver protocol:
  • cvs -z3 -d:pserver:anonymous@a.cvs.sourceforge.net:/cvsroot/aaron co -P aaron
  • cvs -z3 -d:pserver:anonymous@a.cvs.sourceforge.net:/cvsroot/aaron co -P www
  • +
  • cvs -z3 -d:pserver:anonymous@a.cvs.sourceforge.net:/cvsroot/aaron co -P Attic
  • You can view a list of files or copy all the CVS repository data via rsync (the 1st command lists the files, the 2nd copies):

  • rsync -a a.cvs.sourceforge.net::cvsroot/aaron/
  • rsync -ai a.cvs.sourceforge.net::cvsroot/aaron/ /my/local/dest/dir/