SOURCES: poldek-noutf8.patch (NEW) - do not check for utf-8 version. This i...

witekfl witekfl at pld-linux.org
Wed Dec 10 16:05:20 CET 2008


Author: witekfl                      Date: Wed Dec 10 15:05:20 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- do not check for utf-8 version. This is a rewrite of the langs_forward.patch
- langs must enumerated from the end to the beginning.

---- Files affected:
SOURCES:
   poldek-noutf8.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/poldek-noutf8.patch
diff -u /dev/null SOURCES/poldek-noutf8.patch:1.1
--- /dev/null	Wed Dec 10 16:05:20 2008
+++ SOURCES/poldek-noutf8.patch	Wed Dec 10 16:05:14 2008
@@ -0,0 +1,44 @@
+--- poldek-0.30-cvs20080820.23/pkgdir/pndir/description.c.old	2008-12-10 15:50:49.000000000 +0100
++++ poldek-0.30-cvs20080820.23/pkgdir/pndir/description.c	2008-12-10 15:52:39.000000000 +0100
+@@ -165,9 +165,8 @@ struct pkguinf *pndir_load_pkguinf(tn_al
+         /* start from the end => the last loaded one will be set as
+            pkguinf default (see pkguinf_restore_i18n()) */
+         for (i = n_array_size(langs) - 1; i >= 0; i--) {
+-            const char *lang, *loaded_lang = NULL;
++            const char *lang;
+             struct tndb *db;
+-            char lang_utf8[32];
+             char dkey[512];
+             int  dklen;
+ 
+@@ -178,26 +177,17 @@ struct pkguinf *pndir_load_pkguinf(tn_al
+             if ((db = pndir_db_dscr_h_get(db_dscr_h, lang)) == NULL)
+                 continue;
+ 
+-            n_snprintf(lang_utf8, sizeof(lang_utf8), "%s.UTF-8", lang);
+-            loaded_lang = lang_utf8;
+-
+-            dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang_utf8);
++            dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang);
+             vlen = tndb_get(db, dkey, dklen, val, sizeof(val));
+-            
+-            if (vlen == 0) {     /* not exists */
+-                dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang);
+-                vlen = tndb_get(db, dkey, dklen, val, sizeof(val));
+-                loaded_lang = lang;
+-            }
+-                
+-            DBGF("ld %s: %s (%d)\n", pkg_id(pkg), loaded_lang ? loaded_lang : lang, vlen);
++
++            DBGF("ld %s: %s (%d)\n", pkg_id(pkg), lang, vlen);
+             
+             if (vlen > 0) {
+                 tn_buf_it it;
+                 n_buf_clean(nbuf);
+                 n_buf_init(nbuf, val, vlen);
+                 n_buf_it_init(&it, nbuf);
+-                pkguinf_restore_i18n(pkgu, &it, loaded_lang);
++                pkguinf_restore_i18n(pkgu, &it, lang);
+             }
+         }
+     }
================================================================


More information about the pld-cvs-commit mailing list