[sysadmin-bin] TEST COMMIT: Updated Norwegian bokmål translation



commit 8ed50e931c908f41b3075598421319e146c51987
Author: Olav Vitters <olav vitters nl>
Date:   Wed Sep 7 00:40:25 2011 +0200

    TEST COMMIT: Updated Norwegian bokmÃl translation

 README   |    1 +
 ftpadmin |   33 ++++++++++++++++++++++++++++++++-
 2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/README b/README
index 433388c..f2fd683 100644
--- a/README
+++ b/README
@@ -13,3 +13,4 @@ These scripts all live in /home/admin/bin.
 Please remember to add a brief ChangeLog entry and commit any changes, so we
 get auto-notification and an audit history of the change sent to the sysadmin
 list.
+
diff --git a/ftpadmin b/ftpadmin
index 136bbdd..7227283 100755
--- a/ftpadmin
+++ b/ftpadmin
@@ -40,7 +40,7 @@ sys.path.insert(0, script_dir)
 # Lives inside gitadmin-bin
 import semi_rdf
 
-DEBUG=False
+DEBUG=True
 # Protection, only ovitters should be using debug mode:
 if os.environ['USER'] != 'ovitters':
     DEBUG=False
@@ -1403,6 +1403,32 @@ def cmd_show_info(options, parser):
 
         print "\t".join((module, version, changed, ", ".join(moduleinfo.maintainers)))
 
+def cmd_check_latest_is(options, parser):
+
+    if not options.module:
+        options.module = sorted([os.path.basename(path) for path in glob.glob(os.path.join(BasicInfo.FTPROOT, options.section, '*')) if os.path.isdir(path)])
+    for module in options.module:
+        moduleinfo = ModuleInfo(module, options.section)
+        latest_dirs = set()
+        for dir, files in moduleinfo.ignored.iteritems():
+            for name in files:
+                if name.startswith('LATEST-IS-'):
+                    latest_dirs.add(dir)
+                    break
+        majmins = {}
+        for version in moduleinfo.versions:
+            majmin = re_majmin.sub(r'\1', version)
+            if majmin not in majmins:
+                majmins[majmin] = []
+            majmins[majmin].append(version)
+        for majmin in sorted(majmins.keys(), version_cmp):
+            max_version = get_latest_version(majmins[majmin])
+            latest_is = 'LATEST-IS-%s' % max_version
+            has_other_latest = "WRONG" if majmin in latest_dirs else ""
+            if majmin not in moduleinfo.ignored or latest_is not in moduleinfo.ignored[majmin]:
+                print "\t".join((module, majmin, latest_is, has_other_latest))
+
+
 def cmd_sudo(options, parser):
     print >>sys.stderr, "ERROR: Not yet implemented!"
     print ""
@@ -1571,6 +1597,11 @@ def main():
     subparser.add_argument("-s", "--section", choices=SECTIONS)
     subparser.add_argument('module', nargs='*', help='Module(s) to show info for')
     subparser.set_defaults(func=cmd_show_info, section=DEFAULT_SECTION)
+    # check-latest-is
+    subparser = subparsers.add_parser('check-latest-is', help='check and correct LATEST-IS files')
+    subparser.add_argument("-s", "--section", choices=SECTIONS)
+    subparser.add_argument('module', nargs='*', help='Module(s) to show info for')
+    subparser.set_defaults(func=cmd_check_latest_is, section=DEFAULT_SECTION)
     #   sudo
     subparser = subparsers.add_parser('sudo', help='install tarballs uploaded using rsync')
     subparser.set_defaults(func=cmd_sudo)



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