OSSP CVS Repository

ossp - Check-in [4509]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4509
Date: 2004-Apr-22 08:56:28 (local)
2004-Apr-22 06:56:28 (UTC)
User:rse
Branch:
Comment: start OSSP cvsfusion
Tickets:
Inspections:
Files:
ossp-pkg/cvsfusion/00BRAINSTORM      added-> 1.1
ossp-pkg/cvsfusion/00README      added-> 1.1
ossp-pkg/cvsfusion/RCS.pm      added-> 1.1
ossp-pkg/cvsfusion/cvsfusion.pl      added-> 1.1

ossp-pkg/cvsfusion/00BRAINSTORM -> 1.1

*** /dev/null    Sat Nov 23 00:53:10 2024
--- -    Sat Nov 23 00:53:37 2024
***************
*** 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
+ 
+     }
+ }
+ 


ossp-pkg/cvsfusion/00README -> 1.1

*** /dev/null    Sat Nov 23 00:53:10 2024
--- -    Sat Nov 23 00:53:37 2024
***************
*** 0 ****
--- 1,2 ----
+ 
+   CVSFusion --


ossp-pkg/cvsfusion/RCS.pm -> 1.1

*** /dev/null    Sat Nov 23 00:53:10 2024
--- -    Sat Nov 23 00:53:37 2024
***************
*** 0 ****
--- 1,91 ----
+ ##
+ ##  OSSP cvsfusion - CVS Repository Fusion
+ ##  Copyright (c) 2004 Ralf S. Engelschall <rse@engelschall.com>
+ ##  Copyright (c) 2004 The OSSP Project <http://www.ossp.org/>
+ ##  Copyright (c) 2004 Cable & Wireless <http://www.cw.com/>
+ ##
+ ##  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<RCS> -- Revision Control System (RCS) File Handling
+ 
+ =head1 DESCRIPTION
+ 
+ ...FIXME...
+ 
+ =cut
+ 


ossp-pkg/cvsfusion/cvsfusion.pl -> 1.1

*** /dev/null    Sat Nov 23 00:53:10 2024
--- -    Sat Nov 23 00:53:37 2024
***************
*** 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 <rse@engelschall.com>
+ ##  Copyright (c) 2004 The OSSP Project <http://www.ossp.org/>
+ ##  Copyright (c) 2004 Cable & Wireless <http://www.cw.com/>
+ ##
+ ##  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<cvsfusion> - CVS Repository Fusion
+ 
+ =head1 SYNOPSIS
+ 
+ B<cvsfusion>
+ [B<--verbose>]
+ [B<--tmpdir=>I<dir>]
+ [B<--cvsroot-source=>I<dir>]
+ [B<--cvsroot-target=>I<dir>]
+ [B<--cvs-branch=>I<tag>B<:>I<rev>]
+ [B<--cvs-module=>I<subdir>]
+ [B<--prog-rcs=>I<file>]
+ [B<--prog-diff=>I<file>]
+ 
+ B<cvsfusion>
+ [--version]
+ [--help]
+ 
+ =head1 DESCRIPTION
+ 
+ =cut
+ 

CVSTrac 2.0.1