incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r612996 [3/3] - in /incubator/public/trunk: audit/ audit/incubator-2008-01-17.xml audit/incubator-2008-01-17.xml.asc connect.py scanner.py
Date Thu, 17 Jan 2008 22:41:40 GMT
Added: incubator/public/trunk/audit/incubator-2008-01-17.xml.asc
URL: http://svn.apache.org/viewvc/incubator/public/trunk/audit/incubator-2008-01-17.xml.asc?rev=612996&view=auto
==============================================================================
--- incubator/public/trunk/audit/incubator-2008-01-17.xml.asc (added)
+++ incubator/public/trunk/audit/incubator-2008-01-17.xml.asc Thu Jan 17 14:41:38 2008
@@ -0,0 +1,7 @@
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.7 (GNU/Linux)
+
+iD8DBQBHj9lBl6Otx30NTe0RAgOGAKCS4U5MSZ/0+M70vHuakMgXGicVqACfXJ4p
+FBr42IfKCYGJgW6C3jRmDqk=
+=ufgn
+-----END PGP SIGNATURE-----

Modified: incubator/public/trunk/connect.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/connect.py?rev=612996&r1=612995&r2=612996&view=diff
==============================================================================
--- incubator/public/trunk/connect.py (original)
+++ incubator/public/trunk/connect.py Thu Jan 17 14:41:38 2008
@@ -24,16 +24,61 @@
 '''
 
 import subprocess
+import datetime
 
+def outputPath(subject):
+    return "audit/" + subject + '-' + datetime.datetime.utcnow().date().isoformat() + ".xml"
+
+def save(subject, document):
+
+    path = outputPath(subject)
+    f = open(path, 'w')
+    try:
+        f.write(document)
+    finally:
+        f.close()
+    return path
+
+print 'Apache Incubator - Distribution Scanner'
+print '---------------------------------------'
+print 'ssh-agent MUST loaded with an appropriate'
+print 'key for people.apache.org.'
+print 'Alias host apache to people.apache.org'
+print 'in the ssh client configuration.'
+print ''
+print 'Reading scanning script from local disc...'
 file = open('scanner.py', 'r')
 script = file.read()
 file.close()
-
+print 'Ok'
+print ''
+print 'Opening connection to people.apache.org...'
 process = subprocess.Popen('ssh -T -t apache', shell=True, 
                            stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-
+print 'Ok'
+print ''
+print 'About to run scanning script:'
+print 'Time for tea...'
 stdout_value, stderr_value = process.communicate("python <<TillEndOfScript234875823947592345988223\n"

                                                  + script + "\nTillEndOfScript234875823947592345988223\n")
 if not stderr_value == '':
     print 'ERROR: ' + stderr_value
-print stdout_value
+print 'Ok'
+
+xml = ''
+for document in stdout_value.split("<?xml version='1.0'?>"):
+    if document.lstrip().startswith("<documents basedir='/www/www.apache.org/dist/incubator'"):
+        xml = xml + document
+    elif document.lstrip().startswith("<documents basedir='/www/archive.apache.org/dist/incubator'"):
+        xml = xml + document
+    else:
+        print "OUTPUT (probably nothing to worry about):"
+        print document
+        
+if xml == "":
+    print "No results returned"
+else:
+    xml = "<?xml version='1.0'?><audit>" + xml + "</audit>"
+    path = save('incubator', xml)
+    subprocess.Popen('gpg --armor --detach-sig ' + path, shell=True).wait()
+    
\ No newline at end of file

Modified: incubator/public/trunk/scanner.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/scanner.py?rev=612996&r1=612995&r2=612996&view=diff
==============================================================================
--- incubator/public/trunk/scanner.py (original)
+++ incubator/public/trunk/scanner.py Thu Jan 17 14:41:38 2008
@@ -55,14 +55,17 @@
                     result = result + " <document dir='" + root + "' name='" + name +
"' >\n"
                     result = result + "  <md5>" + md5.hexdigest() + "</md5>\n"
                     result = result + "  <sha512>" + sha.hexdigest() + "</sha512>\n"
-                    result = result + "  <ripemd160>" + ripe.hexdigest() + "</ripemd180>\n"
+                    result = result + "  <ripemd160>" + ripe.hexdigest() + "</ripemd160>\n"
                     result = result + " </document>\n"
             if '.svn' in dirs:
                 dirs.remove('.svn')
         result = result + "</documents>"
         return result
 
-scanner = Scanner('/www/www.apache.org/dist/incubator')
-print scanner.scan()
-#scanner = Scanner('/www/archive.apache.org/dist/incubator')
-#print scanner.scan()
\ No newline at end of file
+def scanIncubatorReleases():
+    scanner = Scanner('/www/www.apache.org/dist/incubator')
+    print scanner.scan()
+    scanner = Scanner('/www/archive.apache.org/dist/incubator')
+    print scanner.scan()
+    
+scanIncubatorReleases()
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message