diff options
-rw-r--r-- | fedora-packager.spec | 6 | ||||
-rwxr-xr-x | scripts/fedora-cvs | 49 |
2 files changed, 52 insertions, 3 deletions
diff --git a/fedora-packager.spec b/fedora-packager.spec index e61381b..a8a06a0 100644 --- a/fedora-packager.spec +++ b/fedora-packager.spec @@ -9,11 +9,10 @@ URL: https://hosted.fedoraproject.org/projects/fedora-packager/ Source0: %{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: Requires: koji bodhi-client plague-client -Requires: rpm-build rpmdevtools +Requires: rpm-build rpmdevtools rpmlint Requires: cvs mercurial git bzr -Requires: +Requires: gcc gcc-c++ mock %description Set of utilities useful for a fedora packager in setting up thier environment. @@ -39,6 +38,7 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc +%{_bindir}/fedora-packager-setup.sh diff --git a/scripts/fedora-cvs b/scripts/fedora-cvs new file mode 100755 index 0000000..eb0a7b4 --- /dev/null +++ b/scripts/fedora-cvs @@ -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) + |