]> git.stg.codes - stg.git/blobdiff - make_tarball/get_from_cvs
Port to CMake, get rid of os_int.h.
[stg.git] / make_tarball / get_from_cvs
diff --git a/make_tarball/get_from_cvs b/make_tarball/get_from_cvs
new file mode 100755 (executable)
index 0000000..362f402
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/expect
+
+# login_cvs host password
+
+set user    [lindex $argv 0]
+set pass    [lindex $argv 1]
+set host    [lindex $argv 2]
+set cvsroot [lindex $argv 3]
+set module  [lindex $argv 4]
+set dir     [lindex $argv 5]
+
+set timeout 30
+
+send_user "checkout module $module";
+
+spawn ssh $user@$host
+expect {
+    "(yes/no)? " { 
+        send  "yes\r"
+        send_user "Key accepted";
+        }
+    "assword:" {
+        close
+        send_user "Key accepting dont needed";
+        }
+    }
+    
+spawn cvs -d :ext:$user@$host:$cvsroot co -N -d $dir $module 
+expect {
+    "assword:" {
+        send "$pass\r"
+        expect {
+            "assword:" { 
+                send_user "<h3><font color=red>cvs checkout $module failed. Incorrect password</font></h3>";
+                exit 1
+                }
+            "aborted" {
+                 send_user "<h3><font color=red>cvs checkout $module failed.</font></h3>";
+                 exit 1
+                 }
+            expect eof {
+            if {[lindex [wait] 3]} {
+                send_user "<h3><font color=red>cvs checkout $module failed.</font></h3>"
+                exit 1
+                }
+                }
+            }
+        }
+        
+     "aborted" {
+         send_user "<h3><font color=red>cvs checkout $module failed.</font></h3>";
+         exit 1
+         }
+    }
+  
+
+
+