cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hack to check SCCS files for Cons


From: Wayne Scott
Subject: Hack to check SCCS files for Cons
Date: Mon, 07 May 2001 23:22:11 -0700

For those people who are not worried about ugly hacks but want to use
CONS with SCCS-based revision control systems.  Here is a quick patch
to make cons automaticly checkout missing source files.

-Wayne

$ diff -u cons~ cons
--- cons~       Fri Apr 13 10:39:06 2001
+++ cons        Mon May  7 23:05:13 2001
@@ -387,6 +387,15 @@
     exit(1);
 };
 
+sub check_sccs {
+    my($path) = @_;
+    my($sccs) = $path;
+    $sccs =~ s-([^/]+)$-SCCS/s.$1-;
+    if (!-f $path && -f $sccs) {
+       system "get $path";
+    }
+}
+
 if ($param::depfile) {
   open (main::DEPFILE, ">".$param::depfile) ||
     die ("$0: couldn't open $param::depfile ($!)\n");
@@ -671,6 +680,7 @@
     my(@scripts) = pop(@priv::scripts);
     while ($priv::self = shift(@scripts)) {
        my($path) = $priv::self->{script}->rsrcpath;
+       main::check_sccs($path);
        if (-f $path) {
            $dir::cwd = $priv::self->{script}->{dir};
            # Handle chdir to the Conscript file directory, if necessary.
@@ -2690,6 +2700,8 @@
     return $_[0]->{source_exists} if defined $_[0]->{source_exists};
     my($self) = @_;
     my($path) = $self->path;
+  main::check_sccs($path);
+
     my($time) = (stat($path))[9];
     if ($self->is_linked) {
        # Linked directory, local logic.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]