summaryrefslogtreecommitdiffstats
path: root/src/fedora-cvs.py
diff options
context:
space:
mode:
authordennis@bratac.ausil.us <dennis@bratac.ausil.us>2007-12-03 12:58:35 -0600
committerdennis@bratac.ausil.us <dennis@bratac.ausil.us>2007-12-03 12:58:35 -0600
commit9bf3c49ae9b4557ae4948172a16dff195aa2e801 (patch)
tree2c7512703b86c26d74170919a28c47f9f99ea9f8 /src/fedora-cvs.py
parent31c66cf58f809d861ff8737c034e09d6214736f1 (diff)
downloadfedora-packager-9bf3c49ae9b4557ae4948172a16dff195aa2e801.tar.gz
fedora-packager-9bf3c49ae9b4557ae4948172a16dff195aa2e801.tar.xz
fedora-packager-9bf3c49ae9b4557ae4948172a16dff195aa2e801.zip
attempt to autotoolise
Diffstat (limited to 'src/fedora-cvs.py')
-rwxr-xr-xsrc/fedora-cvs.py49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/fedora-cvs.py b/src/fedora-cvs.py
new file mode 100755
index 0000000..eb0a7b4
--- /dev/null
+++ b/src/fedora-cvs.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+
+import os
+import string
+import sys
+import commands
+
+def readUser():
+ ''' samle line "Subject: C=US, ST=North Carolina, O=Fedora Project, OU=Dennis Gilmore, CN=ausil/emailAddress=dennis@ausil.us" '''
+ userCert = ""
+ if os.access(os.path.join(os.path.expanduser('~'),".fedora.cert"), os.R_OK):
+ userCert = open(os.path.join(os.path.expanduser('~'),".fedora.cert"), "r").read()
+ else:
+ print "!!! cannot read your ~/.fedora.cert file !!!"
+ print "!!! Ensure the file is readable and try again !!!"
+ os.exit(1)
+ for certLine in userCert.split("\n"):
+ if not len(certLine):
+ continue
+ stripCertLine = certLine.strip()
+ if stripCertLine.startswith("Subject: "):
+ subjectLine = certLine.split("CN=")
+ name = subjectLine[1].split("/")
+ return name[0]
+
+
+def cvsco(user, module):
+ '''CVSROOT=:ext:ausil@cvs.fedoraproject.org:/cvs/extras/'''
+ (s, o) = commands.getstatusoutput("CVSROOT=:ext:%s@cvs.fedoraproject.org:/cvs/extras/ CVS_RSH=ssh cvs co %s" % (user, module))
+ if s != 0:
+ print "Error: %s" % o
+ else:
+ print o
+
+
+def main(pkg):
+ userName = readUser()
+ cvsco(userName, pkg)
+
+if __name__ == '__main__':
+ if len(sys.argv) < 2:
+ print "you need to specify the module to checkout of cvs"
+ sys.exit(1)
+
+ #the package we want to pull from cvs
+ pkg = sys.argv[1]
+
+ main(pkg)
+