From 31c66cf58f809d861ff8737c034e09d6214736f1 Mon Sep 17 00:00:00 2001 From: "dennis@bratac.ausil.us" Date: Mon, 3 Dec 2007 12:26:12 -0600 Subject: put .py on fedora-cvs --- Makefile | 6 ++++++ TODO | 1 + scripts/fedora-cvs | 49 ------------------------------------------------- scripts/fedora-cvs.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 49 deletions(-) delete mode 100755 scripts/fedora-cvs create mode 100755 scripts/fedora-cvs.py diff --git a/Makefile b/Makefile index 8b13789..5b39435 100644 --- a/Makefile +++ b/Makefile @@ -1 +1,7 @@ +tarball: + tar -cjvf fedora-packager.tar.bz2 + +install: + install -p -m 755 scripts/fedora-packager-setup.sh /usr/bin/fedora-packager-setup.sh + install -p -m 755 scripts/fedora-cvs.py /usr/bin/fedora-cvs diff --git a/TODO b/TODO index d98dabc..2048b6c 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,3 @@ * Make Makefile work * add SPEC file, we will require rpmdevtools, koji, plague, ?? +* add extra scripts to do cool useful things diff --git a/scripts/fedora-cvs b/scripts/fedora-cvs deleted file mode 100755 index eb0a7b4..0000000 --- a/scripts/fedora-cvs +++ /dev/null @@ -1,49 +0,0 @@ -#!/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) - diff --git a/scripts/fedora-cvs.py b/scripts/fedora-cvs.py new file mode 100755 index 0000000..eb0a7b4 --- /dev/null +++ b/scripts/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) + -- cgit