releng r957 - in trunk/tools: . smoketesting



Author: vuntz
Date: Tue Mar 18 16:35:18 2008
New Revision: 957
URL: http://svn.gnome.org/viewvc/releng?rev=957&view=rev

Log:
2008-03-18  Vincent Untz  <vuntz gnome org>

	* smoketesting/convert-to-tarballs.py:
	* smoketesting/tarball-conversion-stable.config:
	Add a file:// mirror for download.gnome.org so that we can run the
	script on window and have super-fast result! That's very very
	convenient with --versions-only


Modified:
   trunk/tools/ChangeLog
   trunk/tools/smoketesting/convert-to-tarballs.py
   trunk/tools/smoketesting/tarball-conversion-stable.config

Modified: trunk/tools/smoketesting/convert-to-tarballs.py
==============================================================================
--- trunk/tools/smoketesting/convert-to-tarballs.py	(original)
+++ trunk/tools/smoketesting/convert-to-tarballs.py	Tue Mar 18 16:35:18 2008
@@ -169,8 +169,16 @@
             if node.nodeName == 'mirror':
                 old = node.attributes.get('location').nodeValue
                 new = node.attributes.get('alternate').nodeValue
+                if new.startswith('file://'):
+                    if not node.attributes.get('host') or node.attributes.get('host').nodeValue != socket.getfqdn():
+                        continue
+                else:
+                    host = None
                 u = urlparse.urlparse(old)
-                self.mirrors[(u.scheme, u.hostname)] = (old, new)
+                # Only add the mirror if we don't have one or if it's a local
+                # mirror (in which case we replace what we had before)
+                if not self.mirrors.has_key((u.scheme, u.hostname)) or u.scheme == 'file':
+                    self.mirrors[(u.scheme, u.hostname)] = (old, new)
             else:
                 sys.stderr.write('Bad mirror node\n')
                 sys.exit(1)
@@ -450,6 +458,25 @@
         location = urlparse.urlunparse(newloc)
         return location, files
 
+    def _get_files_from_file(self, parsed_url, max_version):
+        path = parsed_url.path
+        good_dir = re.compile('^([0-9]+\.)*[0-9]+$')
+        def hasdirs(x): return good_dir.search(x)
+        while True:
+            files = os.listdir(path)
+
+            newdirs = filter(hasdirs, files)
+            if newdirs:
+                newdir = self._get_latest_version(newdirs, max_version)
+                path = posixjoin(path, newdir)
+            else:
+                break
+
+        newloc = list(parsed_url)
+        newloc[2] = path
+        location = urlparse.urlunparse(newloc)
+        return location, files
+
     def _get_files_from_sftp(self, parsed_url, max_version):
         hostname = parsed_url.hostname
 

Modified: trunk/tools/smoketesting/tarball-conversion-stable.config
==============================================================================
--- trunk/tools/smoketesting/tarball-conversion-stable.config	(original)
+++ trunk/tools/smoketesting/tarball-conversion-stable.config	Tue Mar 18 16:35:18 2008
@@ -88,6 +88,7 @@
           />
   </locations>
   <mirrors>
+    <mirror location="http://download.gnome.org/"; alternate="file:///ftp/pub/GNOME/" host="window.gnome.org" />
     <mirror location="http://download.gnome.org/"; alternate="sftp://master.gnome.org/ftp/pub/GNOME/"; />
   </mirrors>
   <rename>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]