[llvm-commits] CVS: llvm-www/releases/download.html register.cgi
John Criswell
criswell at cs.uiuc.edu
Fri Dec 12 16:12:01 PST 2003
Changes in directory llvm-www/releases:
download.html updated: 1.4 -> 1.5
register.cgi updated: 1.3 -> 1.4
---
Log message:
Moved download page and CGI registration script up a directory so that
they serve all LLVM public downloads.
---
Diffs of the changes: (+234 -0)
Index: llvm-www/releases/download.html
diff -u /dev/null llvm-www/releases/download.html:1.5
--- /dev/null Fri Dec 12 16:11:51 2003
+++ llvm-www/releases/download.html Fri Dec 12 16:11:41 2003
@@ -0,0 +1,51 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css" href="../../llvm.css">
+ <title>LLVM 1.0 Download Page</title>
+</head>
+<body>
+
+<div class="rel_title">
+ LLVM 1.0 Download Page
+</div>
+
+<div class="rel_container">
+
+<div class="rel_intro">
+If you signed up for the LLVM Announcements list, you should receive a
+confirmation email. If you don't, you can register for the mailing list at
+<a href="http://mail.cs.uiuc.edu/mailman/listinfo/llvm-announce">
+http://mail.cs.uiuc.edu/mailman/listinfo/llvm-announce
+</a>.
+</div>
+
+<table class="rel_section">
+<tr><td>Download</td></tr>
+</table>
+
+<div class="rel_boxtext">
+Please read the <a href="docs/ReleaseNotes.html">Release Notes</a> before
+downloading:
+
+<ul>
+ <li><a href="llvm-1.0.tar.gz">LLVM source code</a> (6.2M)</li>
+
+ <li><a href="cfrontend-1.0.i686-redhat-linux-gnu.tar.gz">GCC Front End
+ Binaries for Linux/x86</a> (15.3M)</li>
+
+ <li><a href="cfrontend-1.0.i686-unknown-freebsd5.1.tar.gz">GCC Front End
+ Binaries for FreeBSD/x86</a> (14.4M)</li>
+
+ <li><a href="cfrontend-1.0.sparc-sun-solaris2.8.tar.gz">GCC Front End Binaries
+ for Solaris/Sparc</a> (43.3M)</li>
+
+ <li><a href="cfrontend-1.0.source.tar.gz">GCC Front End Source Code</a> (36.1M)</li>
+</ul>
+
+</div>
+
+</div>
+
+</body>
+</html>
+
Index: llvm-www/releases/register.cgi
diff -u /dev/null llvm-www/releases/register.cgi:1.4
--- /dev/null Fri Dec 12 16:11:51 2003
+++ llvm-www/releases/register.cgi Fri Dec 12 16:11:41 2003
@@ -0,0 +1,183 @@
+#!/usr/dcs/software/supported/bin/python
+
+import cgi
+import urllib
+import smtplib
+import os
+import sys
+
+# List of email addresses that want to know when people download
+notifylist=['vadve at cs.uiuc.edu', 'criswell at uiuc.edu', 'sabre at nondot.org']
+
+#
+# Function: Subscribe()
+#
+# Description:
+# This function subscribes the specified user to the LLVM announce mailing
+# list.
+#
+def Subscribe (form):
+ # Name of the LLVM subscription CGI script
+ scriptURL='http://mail.cs.uiuc.edu/mailman/subscribe/llvm-announce'
+
+ #
+ # Extract from the form any information that we need
+ #
+ email = form.getfirst ('email', '')
+ pw1 = email
+ pw2 = email
+ announce = form.getfirst ('announce','yes')
+
+ #
+ # Exit now if we do not need to subscribe.
+ #
+ if (announce != 'yes'):
+ return
+
+ #
+ # Create a POST request with all of the information that the CGI
+ # script will require.
+ #
+ options = {'email': email, 'pw': pw1, 'pw-conf': pw2, 'digest': '0'}
+
+ #
+ # Convert the POST options into a string that we can send to the
+ # subscription CGI script.
+ #
+ postdata = urllib.urlencode (options)
+
+ #
+ # Subscribe the user.
+ #
+ urllib.urlopen (scriptURL, postdata)
+
+ return
+
+#
+# Function: ValidateForm ()
+#
+# Description:
+# Make sure that the input to the CGI script is valid.
+#
+def ValidateForm (form):
+ #
+ # Verify if the required fields have been supplied.
+ #
+ firstname = form.getfirst ('firstname', '')
+ lastname = form.getfirst ('lastname', '')
+ email = form.getfirst ('email', '')
+ announce = form.getfirst ('announce','yes')
+
+ #
+ # Verify that the name and email fields have been filled in.
+ #
+ if (firstname == ''):
+ return 'First name is empty.'
+
+ if (lastname == ''):
+ return 'Last name is empty.'
+
+ if (email == ''):
+ return 'Email address is empty.'
+
+ #
+ # Verify that the email address has an at sign and some periods.
+ #
+ length = len (email) - 1
+ while (length != 0):
+ if (email[length] == '@'):
+ break
+ length=length - 1
+ else:
+ return 'Email address has no at sign'
+
+ length = len (email) - 1
+ while (length != 0):
+ if (email[length] == '.'):
+ break
+ length=length - 1
+ else:
+ return 'Email address has no periods'
+
+ return ''
+
+#
+# Function: LogForm ()
+#
+# Description:
+# Append a log record to the logfile that another users has registered to
+# download LLVM.
+#
+def LogForm (form):
+ #
+ # Extract the information from the form that we want.
+ #
+ firstname = form.getfirst ('firstname', '')
+ lastname = form.getfirst ('lastname', '')
+ title = form.getfirst ('title','')
+ organization = form.getfirst ('organization', '')
+ email = form.getfirst ('email','')
+ plans = form.getfirst ('plans','')
+ if (plans == ''):
+ plans = 'No plans.'
+
+ #
+ # Construct an email message describing the user who is downloading
+ # LLVM.
+ #
+ msg = 'Subject: [LLVM DOWNLOAD]\r\n\r\n'
+ msg = msg + 'Name: ' + firstname + ' ' + lastname + '\n'
+ msg = msg + 'Email: ' + email + '\n'
+ msg = msg + 'Title: ' + title + '\n'
+ msg = msg + 'Organization: ' + organization + '\n'
+ msg = msg + 'Plans with LLVM:\n' + plans + '\n'
+
+ #
+ # Send email to notify that someone has downloaded LLVM yet again!
+ #
+ mailer = smtplib.SMTP ('localhost')
+ for receiver in notifylist:
+ header = 'From: ' + email + '\r\nTo: ' + receiver + '\r\n'
+ try:
+ mailer.sendmail (email, receiver, msg)
+ except:
+ pass
+ mailer.quit ()
+ return
+
+#
+# Parse the CGI input
+#
+form = cgi.FieldStorage ()
+
+#
+# Verify that everything in the form is correct.
+#
+error = ValidateForm (form)
+if (error != ''):
+ print ('Content-type: text/html')
+ print ('Status: 400 Bad Request')
+ print ('')
+ print ('<h2>')
+ print ('Error in form:' + error)
+ print ('</h2>')
+ sys.exit (0)
+
+#
+# Log the information provided by the form.
+#
+LogForm (form)
+
+#
+# Subscribe the user the LLVM Announcements list (if they so desire)
+#
+Subscribe (form)
+
+#
+# Everything so far has worked. Send the user to the download page.
+#
+print ('Location: /releases/download.html')
+print ('')
+
+sys.exit (0)
+
More information about the llvm-commits
mailing list