[Pkg-mailman-hackers] Pkg-mailman commit - rev 162 - branches/pkg-split/core/debian/patches

Bernd S. Brentrup bsb@haydn.debian.org
Sun, 30 May 2004 10:03:00 -0600


Author: bsb
Date: 2004-05-30 10:02:51 -0600 (Sun, 30 May 2004)
New Revision: 162

Modified:
   branches/pkg-split/core/debian/patches/80_disable_langs.dpatch
   branches/pkg-split/core/debian/patches/81_templates_default.dpatch
Log:
Make bin/update work with templates/default.
Fix oversight in add_language().

Modified: branches/pkg-split/core/debian/patches/80_disable_langs.dpatch
===================================================================
--- branches/pkg-split/core/debian/patches/80_disable_langs.dpatch	2004-05-29 13:24:36 UTC (rev 161)
+++ branches/pkg-split/core/debian/patches/80_disable_langs.dpatch	2004-05-30 16:02:51 UTC (rev 162)
@@ -25,8 +25,8 @@
 
 @DPATCH@
 diff -urNad /debuild/mine/mailman/build-area/mailman-2.1.5/Mailman/Defaults.py.in mailman-2.1.5/Mailman/Defaults.py.in
---- /debuild/mine/mailman/build-area/mailman-2.1.5/Mailman/Defaults.py.in	2004-05-24 12:51:15.000000000 +0200
-+++ mailman-2.1.5/Mailman/Defaults.py.in	2004-05-24 13:10:02.000000000 +0200
+--- /debuild/mine/mailman/build-area/mailman-2.1.5/Mailman/Defaults.py.in	2004-05-26 11:10:05.000000000 +0200
++++ mailman-2.1.5/Mailman/Defaults.py.in	2004-05-26 11:10:08.000000000 +0200
 @@ -1244,7 +1244,10 @@
  LC_DESCRIPTIONS = {}
  
@@ -34,7 +34,7 @@
 -    LC_DESCRIPTIONS[code] = (description, charset)
 +    # Add only languages installed by mailman-i18n
 +    if os.path.exists(os.path.join('/usr/share/mailman/templates',
-+                                   lang, 'listinfo.html')):
++                                   code, 'listinfo.html')):
 +        LC_DESCRIPTIONS[code] = (description, charset)
  
  add_language('ca',    _('Catalan'),             'iso-8859-1')

Modified: branches/pkg-split/core/debian/patches/81_templates_default.dpatch
===================================================================
--- branches/pkg-split/core/debian/patches/81_templates_default.dpatch	2004-05-29 13:24:36 UTC (rev 161)
+++ branches/pkg-split/core/debian/patches/81_templates_default.dpatch	2004-05-30 16:02:51 UTC (rev 162)
@@ -55,3 +55,50 @@
              fp = open(filename)
          except IOError, e:
              if e.errno <> errno.ENOENT: raise
+diff -urNad /debuild/mine/mailman/build-area/mailman-2.1.5/bin/update mailman-2.1.5/bin/update
+--- /debuild/mine/mailman/build-area/mailman-2.1.5/bin/update	2004-05-26 11:10:05.000000000 +0200
++++ mailman-2.1.5/bin/update	2004-05-26 11:16:11.000000000 +0200
+@@ -121,11 +121,12 @@
+     #
+     # First, get rid of any lists/<list> template or lists/<list>/en template
+     # that is identical to the global templates/* default.
+-    for gtemplate in os.listdir(os.path.join(mm_cfg.TEMPLATE_DIR, 'en')):
++    dist_template_dir = os.path.join(mm_cfg.TEMPLATE_DIR, 'default')
++    for gtemplate in os.listdir(os.path.join(dist_template_dir, 'en')):
+         # BAW: get rid of old templates, e.g. admlogin.txt and
+         # handle_opts.html
+         try:
+-            fp = open(os.path.join(mm_cfg.TEMPLATE_DIR, gtemplate))
++            fp = open(os.path.join(dist_template_dir, gtemplate))
+         except IOError, e:
+             if e.errno <> errno.ENOENT: raise
+             # No global template
+@@ -165,24 +166,24 @@
+                 os.unlink(os.path.join(mlist.fullpath(), 'en', gtemplate))
+         # Match against the templates/* template
+         try:
+-            fp = open(os.path.join(mm_cfg.TEMPLATE_DIR, gtemplate))
++            fp = open(os.path.join(dist_template_dir, gtemplate))
+         except IOError, e:
+             if e.errno <> errno.ENOENT: raise
+         else:
+             tcksum = md5.new(fp.read()).digest()
+             fp.close()
+             if gcksum == tcksum:
+-                os.unlink(os.path.join(mm_cfg.TEMPLATE_DIR, gtemplate))
++                os.unlink(os.path.join(dist_template_dir, gtemplate))
+         # Match against the templates/*.prev template
+         try:
+-            fp = open(os.path.join(mm_cfg.TEMPLATE_DIR, gtemplate + '.prev'))
++            fp = open(os.path.join(dist_template_dir, gtemplate + '.prev'))
+         except IOError, e:
+             if e.errno <> errno.ENOENT: raise
+         else:
+             tcksum = md5.new(fp.read()).digest()
+             fp.close()
+             if gcksum == tcksum:
+-                os.unlink(os.path.join(mm_cfg.TEMPLATE_DIR,
++                os.unlink(os.path.join(dist_template_dir,
+                                        gtemplate + '.prev'))
+ 
+