[ooo-build-commit] download/download-go-oo.py download/index.html download/index.php

Petr Mladek pmladek at kemper.freedesktop.org
Fri Sep 18 05:09:33 PDT 2009


 download/download-go-oo.py |  141 +++++++++++++++++++++++++++++++++++++++++++++
 download/index.html        |    2 
 download/index.php         |    2 
 3 files changed, 145 insertions(+)

New commits:
commit 75812d2d2a8bcda6725cd924af4035dd1e29a34b
Author: Petr Mladek <pmladek at suse.cz>
Date:   Fri Sep 18 14:07:30 2009 +0200

    Make download-go-oo.py available
    
    * download/download-go-oo.py: script to download the Go-oo linux packages;
      many thanks to Axel Freyn <axel dash freyn at gmx dot de>
    * download/index.html, download/index.php: add link to download-go-oo.py

diff --git a/download/download-go-oo.py b/download/download-go-oo.py
new file mode 100755
index 0000000..d66fd03
--- /dev/null
+++ b/download/download-go-oo.py
@@ -0,0 +1,141 @@
+#!/usr/bin/python
+
+# Copyright (C) 2009 by Axel Freyn <axel dash freyn at gmx dot de>
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import re
+import sys
+import urllib
+system = "linux-i586"
+version = "3.1.1"
+source = "http://go-oo.mirrorbrain.org/stable/linux-i586/3.1.1"
+
+language = "en_US"
+distribution = "freedesktop"
+
+package_list = {}
+# All localizations
+localizations = ["af", "ar", "as", "be", "bg", "bn", "br", "brx", "bs", "by", 
+    "ca", "cs", "cy", "da", "de", "dgo", "dz", "el", "en", "eo", "es", "et", 
+    "eu", "fa", "fi", "fr", "ga", "gd", "gl", "gu", "he", "hi", "hr", "hu", 
+    "it", "ja", "ka", "kk", "km", "kn", "ko", "kok", "ks", "ku", "lo", "lt", 
+    "lv", "mai", "mk", "ml", "mn", "mni", "mr", "ms", "my", "nb", "ne", "nl",
+    "nn", "nr", "ns", "oc", "or", "pa", "pl", "pt", "ro", "ru", "rw", "sa", 
+    "sat", "sc", "sd", "sh", "sk", "sl", "sr", "ss", "st", "sv", "sw", "ta",
+    "te", "tg", "th", "ti", "tn", "tr", "ts", "uk", "ur", "uz", "ve", "vi", 
+    "xh", "zh", "zu"] 
+# All dialects
+sublocalizations = { "bn": [None, "BD", "IN"], "en": ["GB", "US", "ZA"],
+    "pt": [None, "BR"], "sw": [None, "TZ"], "zh": ["CN", "TW"] }
+# analyze parameters
+for arg in sys.argv[1:]:
+  if arg == "--help" or arg == "help":
+    print "Helper script to download Go-oo linux packages\n"
+
+    print "Usage: %s [--localization=<id>] [--distribution=<distro>]" %sys.argv[0]
+    print "       [--system=<sys> version=<ver>]"
+    print ""
+    print "Options:"
+    print "	--localization - language to download (default: %s)" %language
+    print "	--distribution - distribution for which the menus are dowloaded"
+    print "	                 (default: %s)" %distribution
+    print "	--system - architecture to dowloaded (default: %s)" %system
+    print "	--version - version to download (default: %s)\n" %version
+
+    print "Supported languages:"
+    for l in localizations[:-1]:
+      if sublocalizations.has_key(l):
+	for s in sublocalizations[l]:
+	  print "%s_%s,"%(l,s),
+      else:
+	print "%s,"%l,
+    print localizations[-1],"\n"
+
+    print "Supported distributions:"
+    print "freedesktop, mandriva, redhat, suse\n"
+
+    print "Supported systems:"
+    print "linux-i586, linux-x86_64\n"
+    sys.exit(0)
+
+  param, value = arg.split("=")
+  if param == "--localization":
+    language = value
+  if param == "--distribution":
+    distribution = value
+  if param == "--system":
+    system = value
+  if param == "--version":
+    version = value
+source = "http://go-oo.mirrorbrain.org/stable/%s/%s" % (system, version)
+
+print "Downloading localization %s, distribution %s, system %s, version %s" % (language, distribution, system, version)
+
+# Read the list of all packages from the web-page
+for l in localizations:
+  if sublocalizations.has_key(l):
+    for s in sublocalizations[l]:
+      if s != None:
+	package_list[l + "_" + s ] = []
+      else:
+	package_list[l] = []
+  else:
+    package_list[l] = []
+package_list["general"] = []
+package_list["menus"] = {}
+for line in urllib.urlopen(source).readlines():
+  m = re.search(r"<a href=\"([^\"]*\.rpm)\"", line)
+  if m == None:
+    continue
+  package = m.group(1)
+  loc_match = re.match(r"[^-]*-([^-]*)-", package)
+  loc = loc_match.group(1)
+  try:
+    localizations.index(loc)
+    if sublocalizations.has_key(loc):
+      subloc_match = re.match(r"-([^-]*)-", package[loc_match.end(1):] )
+      subloc = subloc_match.group(1)
+      try:
+	sublocalizations[loc].index(subloc)
+	package_list[loc + "_" + subloc].append(package)
+      except ValueError:
+        package_list[loc].append(package)
+    else:
+      package_list[loc].append(package) 
+  except ValueError:
+    m = re.search(r"-([^-]*)-(menus)-",package)
+    if m == None:
+      package_list["general"].append(package)
+    else:
+      package_list[m.group(2)][m.group(1)] = package
+# create download-list
+download = []
+for p in package_list["general"]:
+  download.append(p)
+for p in package_list[language]:
+  download.append(p)
+download.append( package_list["menus"][distribution] )
+for p in download:
+  print "downloading %s/%s"%(source,p)
+  urllib.urlretrieve( source + "/" + p, p)
diff --git a/download/index.html b/download/index.html
index 7722fbf..ad20f49 100644
--- a/download/index.html
+++ b/download/index.html
@@ -50,6 +50,8 @@ The URLs <a href="http://go-oo.mirrorbrain.org/stable/linux-i586/">http://go-oo.
 <a href="http://go-oo.mirrorbrain.org/stable/linux-x86_64/">http://go-oo.mirrorbrain.org/stable/linux-x86_64/</a>
 are YUM repositories. You could add them as extra installation sources into your favourite package manager. The i586 repository
 can be simply added by installing <a href="http://go-oo.mirrorbrain.org/stable/linux-i586/GoOo-release-0.0.3-0.noarch.rpm">this package</a>.
+Alternatively, you might download the packages by <a href="http://go-oo.org/download/download-go-oo.py">this script</a>.
+You need to set executive permissions or call it: <code>python download-go-oo.py</code>.
 </p>
 
 <h3><a href="http://go-oo.mirrorbrain.org/stable/mac/">MAC OSX Intel</a></h3>
diff --git a/download/index.php b/download/index.php
index c76598e..d9e1bbc 100644
--- a/download/index.php
+++ b/download/index.php
@@ -21,6 +21,8 @@ The URLs <a href="http://go-oo.mirrorbrain.org/stable/linux-i586/">http://go-oo.
 <a href="http://go-oo.mirrorbrain.org/stable/linux-x86_64/">http://go-oo.mirrorbrain.org/stable/linux-x86_64/</a>
 are YUM repositories. You could add them as extra installation sources into your favourite package manager. The i586 repository
 can be simply added by installing <a href="http://go-oo.mirrorbrain.org/stable/linux-i586/GoOo-release-0.0.3-0.noarch.rpm">this package</a>.
+Alternatively, you might download the packages by <a href="http://go-oo.org/download/download-go-oo.py">this script</a>.
+You need to set executive permissions or call it: <code>python download-go-oo.py</code>.
 </p>
 
 <h3><a href="http://go-oo.mirrorbrain.org/stable/mac/">MAC OSX Intel</a></h3>


More information about the ooo-build-commit mailing list