[kernel] r9083 - in dists/trunk/firmware-nonfree: . qlogic

Bastian Blank waldi at alioth.debian.org
Fri Jul 6 19:46:39 UTC 2007


Author: waldi
Date: Fri Jul  6 19:46:39 2007
New Revision: 9083

Log:
* qlogic/update.py: Add.
* update-firmware.sh: Remove.


Added:
   dists/trunk/firmware-nonfree/qlogic/update.py   (contents, props changed)
Removed:
   dists/trunk/firmware-nonfree/update-firmware.sh

Added: dists/trunk/firmware-nonfree/qlogic/update.py
==============================================================================
--- (empty file)
+++ dists/trunk/firmware-nonfree/qlogic/update.py	Fri Jul  6 19:46:39 2007
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import os, re
+from ftplib import FTP
+
+ftp = FTP('ftp.qlogic.com')
+ftp.login()
+ftp.cwd('/outgoing/linux/firmware')
+
+files = {}
+
+def check(line):
+    match = re.match(r'^(?P<file>ql\d{4}_fw.bin) -- (?P<version>\d\.\d\d\.\d\d)', line)
+    if match is None:
+        return
+    files[match.group('file')] = match.group('version')
+
+ftp.retrlines('RETR CURRENT_VERSIONS', check)
+
+new_files = []
+
+for f, version in files.iteritems():
+    f_out = '%s-%s' % (f, version)
+    if not os.path.exists(f_out):
+        fd = file(f_out, 'w')
+        ftp.retrbinary('RETR %s' % f, fd.write)
+        fd.close()
+        del fd
+        print "Retrieved %s" % f_out
+        new_files.append(f_out)
+
+if new_files:
+    print "New files:", ' '.join(new_files)
+else:
+    print "Nothing done."



More information about the Kernel-svn-changes mailing list