MANIFEST #60

  • //
  • guest/
  • richard_geiger/
  • utils/
  • cvs2p4/
  • MANIFEST
  • View
  • Commits
  • Open Download .zip Download (8 KB)
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
  & eval 'exec perl -S $0 $argv:q'
  if 0;
#  THE PRECEEDING STUFF EXECS perl via $PATH
# -*-Fundamental-*-
# (I'm a Emacsian Fundamentalist)
 
#   $Id: //guest/richard_geiger/utils/cvs2p4/MANIFEST#60 $

#
#   Copyright (c) 1996 Network Appliance, Inc.
#
#   You may distribute under the terms of the Artistic License, as
#   specified in the README file included in the cvs2p4
#   distribution.
#
#   Original Author: Richard Geiger for Network Appliance, Inc.
#
#   $Id: //guest/richard_geiger/utils/cvs2p4/MANIFEST#60 $

#  Here is the manifest.
#  You can update the checksums with "-gen"
#

require 5.000;
use Carp;
$| = 1;

($Myname = $0) =~ s%^.*/%%;
$Mydirname = &dirname($0);
 
chdir $Mydirname || die;

#path sum1 sum2 opts
$manifest = <<'MANIFEST';
MANIFEST:-:-
README:30847:27:mode=444
NEWS:33175:37:mode=444
config.tmpl:47040:9:mode=444
bin/cvs2p4:24229:1:mode=555
bin/genmetadata:23064:35:mode=555
bin/genchanges:45157:7:mode=555
bin/dochanges:33681:28:mode=555
bin/dolabels:44684:10:mode=555
bin/revmap:58206:2:mode=555
bin/srcdiff:12402:16:mode=555
bin/cvs2p4:24229:1:mode=555
lib/util.pl:39049:7:mode=444
src/rcs-5.7/src/rlog.c.patch:23939:1:mode=444
test/file,v:57384:4:mode=444
test/phone.gif,v:59723:1:mode=444
test/dollar$file,v:32426:1:mode=444
test/space file,v:32426:1:mode=444
test/pound#file,v:32426:1:mode=444
test/percent_%file,v:32426:1:mode=444
test/at@file,v:32426:1:mode=444
test/star*file,v:32426:1:mode=444
test/datefile_readd,v:30938:1:mode=444
test/Attic/datefile,v:02632:1:mode=444
test/config.test:04211:9:mode=444
test/runtest:36429:7:mode=555
test/norm:48454:1:mode=555
test/metadata.good:51804:2:mode=444
test/lines.good:07185:1:mode=444
test/changes.good:61654:3:mode=444
test/p4_changes_-l.good:26500:4:mode=444
test/p4_describe.good:17487:10:mode=444
test/p4_describe-new.good:29344:10:mode=444
test/p4_filesat.good:18838:1:mode=444
test/p4_labels.good:63997:1:mode=444
test/brmap.pl:58666:1:mode=444
test/exclude_branches:07345:1:mode=444
test/exclude_tags:27386:1:mode=444
MANIFEST
@manifest = split(/\n/, $manifest);

$Usage = <<LIT;
$Myname: usage: $Myname [-gen|-tar <vers>] 
LIT


sub x
{
  my ($cmd) = @_;
 
  print "$Myname: $cmd\n";
  if (! $noexec)
    {
      $status = system $cmd;
      if ($status)
        { printf "$Myname: *** exit status %d\n", $status / 256; exit 1; }
    }
}


sub dirname
{
  my ($dir) = @_;
 
  $dir =~ s%^$%.%; $dir = "$dir/";
  if ($dir =~ m%^/[^/]*//*$%) { return "/"; }
  if ($dir =~ m%^.*[^/]//*[^/][^/]*//*$%)
    { $dir =~ s%^(.*[^/])//*[^/][^/]*//*$%$1%; { return $dir; } }
  return ".";
}


sub usage
{
  print STDERR $Usage;
  exit 1;
}


sub help
{
  print STDERR <<LIT;
$Usage
$Myname is used to help verify the completeness of the cvs2p4
distribution kit.
LIT
  exit 1;
}

$uname = `/bin/uname -a`; chop $uname;
($u_os, $u_host, $u_osrel) = split(/\s+/, $uname);

if    ($u_os eq "SunOS" && $u_osrel =~ /^5\./)
  { $sum = "/usr/ucb/sum"; }
elsif ($u_os eq "SunOS" && $u_osrel =~ /^4\./)
  { $sum = "/bin/sum"; }
elsif ($u_os eq "OSF1" && $u_osrel =~ /^V[34]\./)
  { $sum = "/bin/sum" }
elsif ($u_os eq "FreeBSD" && $u_osrel =~ /^2\.\./)
  { $sum = "NONE" }
elsif ($u_os eq "Linux" && $u_osrel =~ /^2\./)
  { $sum = "/usr/bin/sum" }
else
  { print STDERR "\n$Myname: warning: not tested for \"$u_os $u_osrel\".\n\n"; }

#  Take our chances with $PATH
#
if (! defined($sum)) { $sum = "sum"; }
if (! defined($tar)) { $tar = "tar"; }

$op = "check";

while ($#ARGV >= 0)
  {
    if    ($ARGV[0] eq "-gen")  { $op = "gen"; shift; next; }
    elsif ($ARGV[0] eq "-tar")
      {
        $op = "tar"; shift;
        if ($#ARGV < 0) { usage; }
        $vers = $ARGV[0]; shift;
        next;
      }
    elsif ($ARGV[0] eq "-help") { &help; }
    elsif ($ARGV[0] =~ /^-/)    { &usage; }
    if ($Args ne "") { $Args .= " "; }
    push(@Args, $ARGV[0]);
    shift;
  }

if ($#Args != -1) { &usage; }

if ($op eq "gen")
  {
    @mestat = stat($Myname);

    if (! open(ME, "<$Myname"))
      {
        print "Can't open myself for modification: $!\n";
        exit 1;
      }
    if (! open(NEWME, ">$Myname.gen"))
      {
        print "Can't open myself for modification: $!\n";
        exit 1;
      }
    while (<ME>) { print NEWME; if (/^\$manifest = <<'MANIFEST';$/) { last; } }
  }
elsif ($op eq "tar")
  { $tarcmd = "$tar cvf cvs2p4-$vers.tar"; }


if ($op eq "check" && $sum eq "NONE")
  { print "\n[Checksums will not be checked on this $u_os system.]\n\n"; }

$status = 0;
foreach $ent (@manifest)
  {
    ($path, $sum1, $sum2, $opts) = split(/:/, $ent);

    if ($op eq "check" || $op eq "gen")
      {
        if (! lstat($path))
          { print "? $path... not found (couldn't stat)\n"; $status |= 1; }
        else
          {
            $linktarg = "";
            if ($opts =~ /\bsymlink=([^,\s]+)\b/)
              { $linktarg = $1; }
            else
              {
                if ($sum ne "NONE")
                  {
                    $sums = `$sum '$path'`; chop $sums;
                    ($csum1, $csum2) = split(/\s+/, $sums);
                  }
              }

            if ($op eq "check")
              {
                if ($linktarg ne "")
                  {
		    if (! -l $path)
                      { print "? $path... symlink not found\n"; $status |= 1; }
                    else
                      {
  		        $link = readlink $path;
                        if ($link ne $linktarg)
                          { print "? $path... symlink should be \"$linktarg\"\n"; $status |= 2; }
                        else
                          { print "  $path\n"; }
                      }
                  }
                else
                  {
  		    if ($path =~ /(\/){0,1}$Myname$/)
                      { print "  $path\n"; next; }
                    if ($sum ne "NONE" && ($csum1 != $sum1 || $csum2 != $sum2))
                      { print "M $path... modified (checksums mismatch)\n"; $status |= 2; }
                    else
                      { print "  $path\n"; }
                  }
              }
            elsif ($op eq "gen")
              {
   	        if ($path =~ /(\/){0,1}$Myname$/)
                  {
                    print NEWME "$path:-:-\n";
                    print "$path\n"; next;
                  }
                if ($linktarg ne "")
	          {
                    $_ = "$path:-:-:$opts\n";                    
                    print NEWME;
                    print "$path\n";
                  }               
                else
                  {
                    $_ = "$path:$csum1:$csum2:$opts\n";
                    print NEWME;
                    print "$path - checksum generated\n";
                  }
              }
          }
        next;
      }
    elsif ($op eq "tar")
      {
        if ($opts =~ /\bmode=([0-9]+)\b/)
          {
            $mode = $1;
            &x("/bin/chmod $mode '$path'");
          }
        @modes = lstat("$path");
	$owners{$path} = $modes[4];
	$groups{$path} = $modes[5];
	chown(0, 0, "$path")
          || print STDERR "WARNING: can't \"chown 0, 0, cvs2p4-$vers/$path\": $!\n";
        $tarcmd .= " 'cvs2p4-$vers/$path'";
      }
  }

if ($op eq "gen")
  {
    while (<ME>) { if (/^MANIFEST$/) { print NEWME; last; }}
    while (<ME>) { print NEWME; } close NEWME;
    unlink "$Myname.old";
    rename "$Myname", "$Myname.old" || die;
    rename "$Myname.gen", "$Myname" || die;
    chmod $mestat[2], "$Myname" || die;
  }
elsif ($op eq "tar")
  {
    $Here = `/bin/pwd`; chop $Here;
    ($Herename = $Here) =~ s%^.*/%%;
    $Parent = &dirname($Here);
    &x("/bin/mv $Parent/$Herename $Parent/cvs2p4-$vers");
    chdir $Parent || die;
    &x("$tarcmd")
    &x("/bin/mv $Parent/cvs2p4-$vers $Parent/$Herename");
    &x("/bin/mv $Parent/cvs2p4-$vers.tar $Parent/$Herename/cvs2p4-$vers.tar");

    chdir $Here || die;
    foreach $path (keys(%owners))
      {
	$own = $owners{$path}; $grp = $groups{$path};
	chown ($own, $grp, "$path") || 
          print STDERR "WARNING: can't \"chown $own, $grp, $path\": $!\n";
      }
  }

print "\n";
if ($status == 0) { print "All ok\n"; }
if ($status & 1) { print "*** some files are missing\n"; }
if ($status & 2) { print "*** some files have been modified\n"; }

exit $status;

# Change User Description Committed
#60 7273 Richard Geiger Update for 3.1 release
#59 5612 Richard Geiger Package 3.0b2
#58 5604 Richard Geiger Add exclude lists.
#57 5603 Richard Geiger Edits were done in the //public version...
#56 5599 Richard Geiger About to unleash 3.0 upon an unsuspecting world...
#55 5532 Richard Geiger get these in...
#54 5449 Richard Geiger gearing up for 2.6.0 release...
#53 5143 Richard Geiger prep for 2.5.5
#52 4983 Richard Geiger Package 2.5.4 - add srcdiff.
Clears the integration air.
#51 4927 Richard Geiger Take back changes inadvertantly done in the //public dir.
#50 4922 Richard Geiger 2.5.3 packaging.
#49 4919 Richard Geiger 2.5.2 for the Ottawa Adobefolk...
#48 4915 Richard Geiger Construct the 2.5.1 tarball
#47 4733 Richard Geiger Update manifest.
#46 4732 Richard Geiger Changes to support special characters # @ % * (for release 2.5)
#45 4353 Richard Geiger For 2.4
#44 4273 Richard Geiger Package 2.3.8.
#43 3710 Richard Geiger 2.3.7 packaging.
#42 3599 Richard Geiger Pick up the new p4_describe-new.good file in the MANIFEST
(hence in the tar archive!)
#41 3598 Richard Geiger Hopefully, the final 2.3.5 packaging.
#40 3597 Richard Geiger The diff output change actually happened with 2002.2.
This reflects that.
#39 3595 Richard Geiger 2.3.5 packaging.
#38 2447 Richard Geiger Set up to package 2.3.4
#37 2284 Richard Geiger Package 2.3.3.
Changes to begin handling MKS Source Integrity repositories.
Today MKS; Tomorrow... ClearCase! (well).
#36 2062 Richard Geiger Packaging for 2.3.2
#35 1988 Richard Geiger Package 2.3.1
#34 1970 Richard Geiger Oops, forgot phone,gif,v!
#33 1968 Richard Geiger Make it 2.2.
#32 1944 Richard Geiger Update expected text output files.
#31 1943 Richard Geiger update MANIFEST.
#30 1942 Richard Geiger Change to handle RCS branch tags (so this tools can work with
RCS (vs CVS) repositories, too!) RCS branch tags are those
with an even number of "."s.
#29 1783 Richard Geiger Package 2.0
#28 1781 Richard Geiger This change reintegrates cvs2p4 2.0 developement work (through
2.0b6) back into my mainline development.
#27 1437 Richard Geiger Fix for 1.3.3 - labels on revived Attic files.
#26 1408 Richard Geiger Put the date on the release in NEWS.
#25 1407 Richard Geiger === Release 1.3.2

- Reduce the memory footprint of bin/genmetadata. Previously, it was
  holding and sorting a complete copy of the metadata file "in-core"
  (as well as a copy of all of the RCS revision tags data!). This adds
  up quick, and some users saw genmetadata gobbling memory voraciously
  (and in some cases being running out, causing thrashing and/or process
  termination by the OS).

  genmetadata now keeps the metadata in a temp file, (sorting it in
  primary-key-sized chunks), and the revision tag information in a
  db-backed hash.

- Fix the label handling so that _all_ perforce revisions based on the
  labeled cvs revision are included in the generated
  labels. Previously, one of the N "correct" Perforce revisions were
  being tagged (effectively, at random). This stems from the fact that
  lazy copying and branching are explicit in Perforce, but implicit in
  CVS. I.e., the "#1" revision in a new Perforce branch _appears_ to
  be a separate entity (identical to the revision from which it was
  branched. This means that to use the converted labels, it will be up
  to _you_ to remember what labels go with what branches: but that's
  the way it is in CVS, too.

- A minor change in revmap to have a meaningful usage message, and
  properly handle the new rrevmap format.

- dochanges correctly deletes revmap database files for either
  *.db or *.pag/*.dat style databases.
#24 1204 Richard Geiger Package 1.3.1
#23 1185 Richard Geiger Changes for 1.3
(Labels!)
#22 1032 Richard Geiger Publish 1.2.17
#21 795 Richard Geiger 1.2.16 update
#20 791 Richard Geiger Update for a new release; my change-of-venue noted;
desensitized to conflicting P4CONFIG.
#19 475 Richard Geiger Package cvs2p4 1.2.15
#18 460 Richard Geiger Publish 1.2.14
#17 422 Richard Geiger Package 1.2.13
#16 417 Richard Geiger Packaging for 1.2.12
#15 399 Richard Geiger 1.2.11
#14 393 Richard Geiger 1.2.10
#13 392 Richard Geiger CHanges for 1.2.10 (tolerate empty RCS file)
#12 343 Richard Geiger 1.2.9
#11 331 Richard Geiger 1.2.8 - handle cr/lf in ,v's ...
Yuck
#10 305 Richard Geiger Changes for 1.2.7
#9 283 Richard Geiger MANIFEST includes itself once more.
#8 253 Richard Geiger "MANIFEST" itself must handle shell metacharacters in filenames,
since we added a couple to the tests!
#7 252 Richard Geiger MANIFEST checksums for 1.2.6
#6 251 Richard Geiger Changes for 1.2.6 - metacharacters in filenames.
#5 247 Richard Geiger Just correct the version number at the top of the README, so
this doesn't rool the version number!
#4 240 Richard Geiger Version 1.2.5, to account for post-1999 RCS behavior.
(Courtesy of David Simon, Goldman Sachs)
#3 229 Richard Geiger Packaging for 1.2.4 release.
#2 180 Richard Geiger 1.2.3 release.
#1 130 Richard Geiger CVS-to-Perforce converter.
This is release 1.2.2
(first submit to the Perforce Public Depot)