Index: ossp-pkg/cvsfusion/00BRAINSTORM RCS File: /v/ossp/cvs/ossp-pkg/cvsfusion/00BRAINSTORM,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/cvsfusion/00BRAINSTORM,v' | diff -u /dev/null - -L'ossp-pkg/cvsfusion/00BRAINSTORM' 2>/dev/null --- ossp-pkg/cvsfusion/00BRAINSTORM +++ - 2024-05-19 18:17:14.824304253 +0200 @@ -0,0 +1,49 @@ + + +## +## cvsfusion [-R/path/to/rcs/bin] [-D/path/to/diff/bin] [-t /tmp] -rOPENPKG:1.1.42 -dopenpkg-src -dopenpkg-re /path/to/vendor/cvs /path/to/local/cvs +## + +foreach dir in -d { + foreach file in $vendorcvsroot/$dir { + # remove old attachment + if (exists $localcvsroot/$file) { + cp $localcvsroot/$file $localcvsroot/$file.new + rcs -obranch:: $localcvsroot/$file.new + } + else { + create $localcvsroot/Attic/$file.new (dead, 1.1, /dev/null) + } + + # load both into internal structure + load $localcvsroot/$file.new + load $vendorcvsroot/$dir/$file + + # turn trunk into regular branch + $prev = -1; + $curr = admin->head(); + while (no more $curr) { + getrev($curr, /tmp/curr); # co + $prev = $curr->next(); + if (exists $prev) { + getrev($prev, /tmp/prev); # co + } + else { + my $localhead = local->head(); + getrev($localhead, /tmp/prev); # co + } + $newdiff = `diff -n /tmp/prev /tmp/curr`; + store($curr, $newdiff); + system("cp /tmp/prev /tmp/curr"); + $curr = $prev; + } + + # prefix revisions with branch number + + # merge target into local structures + + # store local structures onto filesystem + + } +} + Index: ossp-pkg/cvsfusion/00README RCS File: /v/ossp/cvs/ossp-pkg/cvsfusion/00README,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/cvsfusion/00README,v' | diff -u /dev/null - -L'ossp-pkg/cvsfusion/00README' 2>/dev/null --- ossp-pkg/cvsfusion/00README +++ - 2024-05-19 18:17:14.826921773 +0200 @@ -0,0 +1,2 @@ + + CVSFusion -- Index: ossp-pkg/cvsfusion/RCS.pm RCS File: /v/ossp/cvs/ossp-pkg/cvsfusion/RCS.pm,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/cvsfusion/RCS.pm,v' | diff -u /dev/null - -L'ossp-pkg/cvsfusion/RCS.pm' 2>/dev/null --- ossp-pkg/cvsfusion/RCS.pm +++ - 2024-05-19 18:17:14.829497451 +0200 @@ -0,0 +1,91 @@ +## +## OSSP cvsfusion - CVS Repository Fusion +## Copyright (c) 2004 Ralf S. Engelschall +## Copyright (c) 2004 The OSSP Project +## Copyright (c) 2004 Cable & Wireless +## +## This file is part of OSSP cvsfusion, a CVS repository fusion +## utility which can be found at http://www.ossp.org/pkg/tool/cvsfusion/. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## RCS.pm: RCS file handling +## + +package RCS; + +require 5; +require Exporter; + +@ISA = qw(Exporter); +@EXPORT_OK = qw(new destroy DESTROY dump); + +sub new ($) { + my $proto = shift; + my $class = ref($proto) || $proto; + my $self = {}; + bless ($self, $class); + + $self->{'prog-rcs'} = ""; + $self->{'prog-diff'} = ""; + + return $self; +} + +sub destroy ($) { + my $self = shift; + return; +} + +sub DESTROY ($) { + my $self = shift; + $self->destroy; + return; +} + +sub dump ($;$) { + my $self = shift; + my $name = shift || "xxx"; + eval { + use Data::Dumper; + }; + my $d = new Data::Dumper ([$self], [$name]); + $d->Indent(1); + $d->Purity(1); + $d->Terse(0); + $d->Deepcopy(0); + my $dump = "# " . ref($self) . " object dump:\n"; + $dump .= $d->Dump(); + return $dump; +} + +__END__ + +=pod + +=head1 NAME + +B -- Revision Control System (RCS) File Handling + +=head1 DESCRIPTION + +...FIXME... + +=cut + Index: ossp-pkg/cvsfusion/cvsfusion.pl RCS File: /v/ossp/cvs/ossp-pkg/cvsfusion/cvsfusion.pl,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/cvsfusion/cvsfusion.pl,v' | diff -u /dev/null - -L'ossp-pkg/cvsfusion/cvsfusion.pl' 2>/dev/null --- ossp-pkg/cvsfusion/cvsfusion.pl +++ - 2024-05-19 18:17:14.832444986 +0200 @@ -0,0 +1,150 @@ +#!/bin/sh -- # -*- perl -*- -p +eval 'exec perl -wS $0 ${1+"$@"}' + if $running_under_some_shell; +## +## OSSP cvsfusion - CVS Repository Fusion +## Copyright (c) 2004 Ralf S. Engelschall +## Copyright (c) 2004 The OSSP Project +## Copyright (c) 2004 Cable & Wireless +## +## This file is part of OSSP cvsfusion, a CVS repository fusion +## utility which can be found at http://www.ossp.org/pkg/tool/cvsfusion/. +## +## Permission to use, copy, modify, and distribute this software for +## any purpose with or without fee is hereby granted, provided that +## the above copyright notice and this permission notice appear in all +## copies. +## +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## +## cvsfusion.pl: main program +## + +require 5; +use strict; +use warnings; +use lib "."; +use Getopt::Long; +use IO::File; +use RCS; + +# program information +my $prog = { + 'name' => "cvsfusion", + 'vers' => "0.0.1", + 'date' => "20-Apr-2004" +}; + +# program parameters (defaults) +my $opt = { + 'version' => 0, + 'verbose' => 0, + 'help' => 0, + 'tmpdir' => ($ENV{TMPDIR} || "/tmp") . "/" . $prog->{'name'}, + 'cvsroot-source' => '', + 'cvsroot-target' => '', + 'cvs-branch' => '', + 'cvs-module' => [], + 'prog-rcs' => "rcs", + 'prog-diff' => "diff" +}; + +# exception handling support +$SIG{__DIE__} = sub { + my ($err) = @_; + $err =~ s|\s+at\s+.*||s if (not $opt->{'verbose'}); + print STDERR $prog->{'name'} . ":ERROR: $err ". ($! ? "($!)" : "") . "\n"; + exit(1); +}; + +# command line parsing +Getopt::Long::Configure("bundling"); +my $result = GetOptions( + 'V|version' => \$opt->{'version'}, + 'v|verbose' => \$opt->{'verbose'}, + 'h|help' => \$opt->{'help'}, + 't|tmpdir=s' => \$opt->{'tmpdir'}, + 'f|cvsroot-source=s' => \$opt->{'cvsroot-source'}, + 'l|cvsroot-target=s' => \$opt->{'cvsroot-target'}, + 'b|cvs-branch=s' => \$opt->{'cvs-branch'}, + 'm|cvs-module=s@' => $opt->{'cvs-module'}, + 'R|prog-rcs=s' => \$opt->{'prog-rcs'}, + 'D|prog-diff=s' => \$opt->{'prog-diff'}, +) || die "option parsing failed"; +if ($opt->{-help}) { + print "Usage: ".$prog->{'name'}." [options]\n" . + "Available options:\n" . + " -V,--version print program version\n" . + " -v,--verbose enable verbose run-time mode\n" . + " -h,--help print out this usage page\n" . + " -t,--tmpdir=DIR filesystem path to temporary directory\n" . + " -f,--cvsroot-source=DIR filesystem path to source CVS repository\n" . + " -l,--cvsroot-target=DIR filesystem path to target CVS repository\n" . + " -b,--cvs-branch=TAG:REV selects the CVS branch tag and revision to use\n" . + " -m,--cvs-module=SUBDIR selects the CVS repository module(s)\n" . + " -R,--prog-rcs=FILE filesystem path to rcs(1) program\n" . + " -D,--prog-diff=FILE filesystem path to diff(1) program\n"; + exit(0); +} +if ($opt->{-version}) { + print "OSSP ".$prog->{'name'}." ".$prog->{'vers'}." (".$prog->{'date'}.")\n"; + exit(0); +} + +# verbose message printing +sub msg_verbose { + my ($msg) = @_; + print STDERR "$msg\n" if ($opt->{'verbose'}); +} + +# warning message printing +sub msg_warning { + my ($msg) = @_; + print STDERR $prog->{'name'}.":WARNING: $msg\n"; +} + +# error message printing +sub msg_error { + my ($msg) = @_; + print STDERR $prog->{'name'}.":ERROR: $msg\n"; +} + +__END__ + +=pod + +=head1 NAME + +B - CVS Repository Fusion + +=head1 SYNOPSIS + +B +[B<--verbose>] +[B<--tmpdir=>I] +[B<--cvsroot-source=>I] +[B<--cvsroot-target=>I] +[B<--cvs-branch=>IB<:>I] +[B<--cvs-module=>I] +[B<--prog-rcs=>I] +[B<--prog-diff=>I] + +B +[--version] +[--help] + +=head1 DESCRIPTION + +=cut +