langupdate.cc File Reference


Detailed Description

Parse the cache output.

Author:
Neil Williams <codehelp@debian.org>

Definition in file langupdate.cc.

#include "config.h"
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <locale.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <apt-pkg/configuration.h>
#include "langupdate.h"
#include "aptcache.h"

Go to the source code of this file.
#define GNU_WARRANTY
#define DPKG_II   "^Package: (.*)$"
#define GREX_EMPTY   GRegexMatchFlags(0)
#define LOCALEGEN   "/etc/locale.gen"
#define STATUS_CHK   "Status"
#define APTARCHSTR   " -o APT::Architecture="
 debug handling
#define APTCONFIGSTR
 Configuration string for apt.
static guint c = 0
static const gchar * sourceslist = "/var/lib/"PACKAGE"/sources.list"
static GList * installed = NULL
static GList * targets = NULL
static GHashTable * choices = NULL
static GList * not_ours = NULL
 List of packages that are not from Emdebian.
static GHashTable * orphans = NULL
static gchar * suite_codename = NULL
static gchar * user_suite = NULL
static gchar * mirror = NULL
static gint verbose = 0
static gboolean dry_run = false
static gboolean show_version = false
static gboolean purge_mode = false
static gchar * purge_names = NULL
static GOptionEntry entries []
gchar * lu_get_aptstring (void)
 Collate the various apt options into a string.
static void output (gpointer key, gpointer data)
static gchar * parse_installed (const gchar *pkg, const gchar *locale)
 Parses list of all installed packages.
static gboolean append_sourceslist (const gchar *lang)
 write the sources list
static void lu_check_supported_suites (gchar *user_suite)
 checks the user specified suite against the supported list
static void remove_cache (const gchar *file, const gchar *user_suite)
static void run_apt_clean (const gchar *user_suite)
static void remove_lists (gchar *suite)
static gboolean lu_strip_components (gchar *line, gchar **code, gchar **root)
 strip extra components from a language variable
static void lu_purge_orphans (gpointer key, gpointer value, gpointer data)
static gboolean lu_skip_not_ours (gpointer key, gpointer value, gpointer data)
gint main (gint argc, gchar *argv[])
 Read the apt-cache to know what is available. then compare dpkg_list with apt_list.


Define Documentation

#define APTARCHSTR   " -o APT::Architecture="

debug handling

Bug:
TDebs are not architecture-independent anymore.
In theory, apt should not care about the architecture because the translations are Architecture: all. In practice, it appears that apt is not expecting an entire repository of architecture-independent packages. The langupdate cache needs to force apt to look for architecture-dependent packages or the langupdate cache is likely to be empty.

Definition at line 113 of file langupdate.cc.

#define APTCONFIGSTR

Value:

"-o APT::Get::List-Cleanup=off " \
 "-o Apt::Install-Recommends=false " \
 "-o Dir=/var/lib/"PACKAGE" " \
 "-o Dir::Etc=/var/lib/"PACKAGE" " \
 "-o Dir::Etc::SourceList=sources.list " \
 "-o Dir::State::Status=/var/lib/"PACKAGE"/status "
Configuration string for apt.

Provides the main mechanism to separate the tdeb cache from the apt cache.

Note:
options that specify the suite are deliberately omitted.

Definition at line 122 of file langupdate.cc.

#define GNU_WARRANTY

Value:

"Copyright (C) 2006-2009 Neil Williams <codehelp@debian.org>\n" \
"This is free software; see the source for copying conditions.  There is NO\n" \
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"

Definition at line 40 of file langupdate.cc.


Function Documentation

static void lu_check_supported_suites ( gchar *  user_suite  )  [static]

checks the user specified suite against the supported list

Sets the user specified suite if supported, otherwise sets the Emdebian default (unstable). If the user also specifies a particular mirror, allow whatever value the user specifies for the suite.

Definition at line 320 of file langupdate.cc.

00321 {
00322     gchar * allowed, * match;
00323 
00324     /* if user specifies a mirror, all bets are off. */
00325     if (mirror)
00326         return;
00327     match = NULL;
00328     /* Translators: used with the --suite option to confirm
00329     the suite codename entered by the user. */
00330     g_print ("%s: %s %s\n", PACKAGE, _("checking Emdebian support for: "), user_suite);
00331     allowed = g_strdup("unstable sid testing lenny stable squeeze experimental");
00332     match = g_strrstr_len (allowed, strlen(allowed), user_suite);
00333     if (match)
00334         suite_codename = g_strdup(user_suite);
00335     else
00336     {
00337         /* Translators - the %s strings are the same value. */
00338         g_warning (_("Suite '%s' is not supported by Emdebian.\n"
00339             "Use the mirror option to specify a repository that can\n"
00340             "provide the '%s', suite"), user_suite, user_suite);
00341         g_print ("\n%s: %s", PACKAGE, _("Using the default Emdebian suite: unstable.\n"));
00342         suite_codename = g_strdup("unstable");
00343     }
00344     g_free (user_suite);
00345     g_free (allowed);
00346 }

gchar* lu_get_aptstring ( void   ) 

Collate the various apt options into a string.

Depending on various settings, the apt configuration list needs to be adjusted so it cannot be completely defined as a macro. This function adds the customisations, creates a newly allocated string and returns it. The caller is responsible for freeing the string.

Also sets the langupdate cache data to the same configuration if this has not been done already.

Returns:
newly allocated string of apt options or NULL on error.

Definition at line 130 of file langupdate.cc.

00131 {
00132     return g_strconcat (APTARCHSTR, HOST_CPU, " ", APTCONFIGSTR, "-o Dir::State=",
00133         suite_codename, " -o Dir::Cache=", suite_codename, NULL);
00134 }

gint main ( gint  argc,
gchar *  argv[] 
)

Read the apt-cache to know what is available. then compare dpkg_list with apt_list.

Todo:
put the variables into a context struct for easier initialisation.

Definition at line 494 of file langupdate.cc.

00495 {
00496     GError * em_gerr;
00497     gchar * dpkg, *code, *lgen, * log, * root, * name, *src;
00498     const gchar * const * locale_v;
00499     GList * dpkg_list, * p, *locales;
00500     GHashTable * tbl;
00501     gchar ** status_list, ** gen_list;
00502     guint mcount, c, l;
00503     gboolean pkg_changed;
00504     GOptionContext *context;
00505 
00508     code = root = NULL;
00509     em_gerr = NULL;
00510     locales = dpkg_list = NULL;
00511     orphans = g_hash_table_new (g_str_hash, g_str_equal);
00512     tbl = g_hash_table_new (g_str_hash, g_str_equal);
00513     choices = g_hash_table_new (g_str_hash, g_str_equal);
00514     l = mcount = 0;
00515 #ifdef ENABLE_NLS
00516     setlocale (LC_ALL, "");
00517     bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
00518     bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
00519     textdomain (GETTEXT_PACKAGE);
00520 #endif
00521     context = g_option_context_new (_("- updates language support for emdebian"));
00522     g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
00523     g_option_context_set_summary (context,
00524         _("Apt frontend to match the Emdebian TDeb support with the installed\n"
00525         "packages and supported locales."));
00526     g_option_context_set_description (context, 
00527         /* Translators: the line endings need to be in roughly the same place in
00528         your own language, counting by characters and allowing for all breaks to
00529         be between words. */
00530         _("Emdebian TDebs provide a method for splitting all translation files out of\n"
00531         "packages and into separate TDeb packages, organised by the locale root and\n"
00532         "source package. This allows individual users to only install translations\n"
00533         "files for the locales supported on their own machine and only for the\n"
00534         "packages installed at the time.\n\n"
00535         "Note that this functionality is not available for Debian TDebs.\n"));
00536     g_option_context_parse (context, &argc, &argv, &em_gerr);
00537     if (show_version)
00538     {
00539         g_print ("%s (%s)\n", PACKAGE, VERSION);
00540         g_print ("%s", GNU_WARRANTY);
00541         return (0);
00542     }
00543     if (!user_suite)
00544         suite_codename = g_strdup("unstable");
00545     else
00546         lu_check_supported_suites(user_suite);
00547     if (dry_run && !purge_mode)
00548         g_print ("%s: %s\n", PACKAGE,
00549             _("Dry run, just showing cache data for installable packages."));
00550     locale_v = g_get_language_names ();
00551     if (0 == strcmp (locale_v[l], "C"))
00552         return 0;
00553     while (strcmp (locale_v[l], "C") != 0)
00554     {
00555         gchar * line;
00556 
00557         line = g_strdup (locale_v[l]);
00558         if (!lu_strip_components (line, &code, &root))
00559             continue;
00560         if (!code || !root)
00561             continue;
00562         g_free (line);
00563         locales = g_list_append (locales, code);
00564         if (!g_hash_table_lookup(tbl, root))
00565         {
00566             if (verbose >= 1)
00567                 g_print ("%s: %s %s\n", PACKAGE, 
00568                     _("Environment needs support for:"), code);
00569             if (!append_sourceslist (root)) 
00570                 return -1;
00571             if (verbose >= 1)
00572                 g_print ("%s: %s %s\n", PACKAGE, 
00573                     _("Adding support for:"), root);
00574             g_hash_table_insert (tbl, root, code);
00575         }
00576         else
00577         {
00578             g_free (code);
00579             g_free (root);
00580             code = NULL;
00581             root = NULL;
00582         }
00583         l++;
00584     }
00585     // parse /etc/locale.gen here
00586     if (!g_file_get_contents (LOCALEGEN, &lgen, NULL, &em_gerr))
00587     {
00588         g_critical (em_gerr->message);
00589         g_message (_("Unable to open the locale.gen configuration file."));
00590         g_clear_error (&em_gerr);
00591         return -1;
00592     }
00593     gen_list = g_strsplit (lgen, "\n", -1);
00594     for (mcount = 0; mcount <= g_strv_length(gen_list); mcount++)
00595     {
00596         gchar * line;
00597 
00598         if (!gen_list[mcount])
00599             continue;
00600         if (g_str_has_prefix (gen_list[mcount], "#"))
00601             continue;
00602         if (!g_strcmp0 ("", gen_list[mcount]))
00603             continue;
00604         line = g_strdup (gen_list[mcount]);
00605         if (!lu_strip_components (line, &code, &root))
00606             continue;
00607         if (!code || !root)
00608             continue;
00609         g_free (line);
00610         if (!g_hash_table_lookup(tbl, root))
00611         {
00612             locales = g_list_append (locales, root);
00613             if (verbose >= 1)
00614                 g_print ("%s: %s %s\n", PACKAGE, 
00615                     _("/etc/locale.gen requires adding support for:"), code);
00616             if (!append_sourceslist (root)) 
00617                 return -1;
00618             g_hash_table_insert (tbl, root, code);
00619             if (verbose >= 1)
00620                 g_print ("%s: %s %s\n", PACKAGE, 
00621                     _("Adding support for:"), root);
00622         }
00623         g_free (code);
00624     }
00625     g_strfreev (gen_list);
00626     
00627     g_return_val_if_fail (apt_init (sourceslist, suite_codename, verbose), -1);
00628     if (!g_file_get_contents (DPKG_FILE, &dpkg, NULL, &em_gerr))
00629     {
00630         g_critical (em_gerr->message);
00631         g_message (_("Unable to open the dpkg status file."));
00632         g_clear_error (&em_gerr);
00633         return -1;
00634     }
00635     status_list = g_strsplit (dpkg, "\n", -1);
00636     name = NULL;
00637     for (mcount = 0; mcount <= g_strv_length(status_list); mcount++)
00638     {
00639         gchar * pkg;
00640 
00641         if (!status_list[mcount])
00642             continue;
00643         if (!g_strcmp0 (status_list[mcount], ""))
00644         {
00645             pkg_changed = TRUE;
00646             if (name)
00647             {
00648                 g_free (name);
00649                 name = NULL;
00650             }
00651         }
00652         else
00653             pkg_changed = FALSE;
00654         if (status_list[mcount+1] && g_str_has_prefix (status_list[mcount+1], STATUS_CHK))
00655         {
00656             gchar ** pos;
00657 
00658             pos = g_strsplit (status_list[mcount], ": ", -1);
00659             if (g_str_has_suffix (status_list[mcount+1], "not-installed"))
00660             {
00661                 g_strfreev (pos);
00662                 continue;
00663             }
00664             g_strfreev (pos);
00665         }
00666         if ((!pkg_changed) && (g_str_has_prefix (status_list[mcount], "Version: ")))
00667         {
00668             gchar * em_chunk;
00669 
00670             /* -1 to allow for em1, em2, em3 etc. */
00671             em_chunk = g_strndup (status_list[mcount], strlen (status_list[mcount]) -1);
00672             if (!g_str_has_suffix (em_chunk, "em"))
00673             {
00674                 gchar ** pkg_name;
00675 
00676                 // need to add to a list that can be subtracted later.
00677                 // but existing TDebs also show up here due to problems in
00678                 // the repository.
00679                 pkg_name = g_strsplit (name, ":", -1);
00680                 if (g_strv_length(pkg_name) == 2)
00681                 {
00682                     gchar * chunk;
00683 
00684                     chunk = g_strdup (pkg_name[1]);
00685                     chunk = g_strstrip (chunk);
00686                     if (verbose >= 2)
00687                     {
00688                         g_print ("%s: %s: %s (%s)\n", PACKAGE,
00689                         _("Not an Emdebian package"), chunk, status_list[mcount]);
00690                     }
00691                     /* swap the binary package name for the source */
00692                     {
00693                         src = lu_get_sourcepkg(chunk);
00694                         if (src)
00695                             not_ours = g_list_prepend (not_ours, g_strdup(src));
00696                     }
00697                     not_ours = g_list_prepend (not_ours, g_strdup(chunk));
00698                     g_free (chunk);
00699                 }
00700                 g_strfreev (pkg_name);
00701                 g_free (em_chunk);
00702                 continue;
00703             }
00704         }
00705         if (g_str_has_prefix (status_list[mcount], PACKAGE_CHK))
00706         {
00707             if (!name)
00708                 name = g_strdup (status_list[mcount]);
00709             name = g_strstrip (name);
00710             for (p = locales; p != NULL; p = p->next)
00711             {
00712                 gchar * chunk;
00713 
00714                 chunk = g_strdup ((gchar*)p->data);
00715                 chunk = g_strstrip (chunk);
00716                 /* pkg is the binary package name */
00717                 src = lu_get_sourcepkg (chunk);
00718                 if (src)
00719                     pkg = parse_installed (status_list[mcount], src);
00720                 else
00721                     pkg = parse_installed (status_list[mcount], chunk);
00722                 if (pkg)
00723                 {
00724                     dpkg_list = g_list_prepend (dpkg_list, pkg);
00725                 }
00726                 g_free (src);
00727                 src = NULL;
00728             }
00729         }
00730     }
00731     g_strfreev (status_list);
00732     for (p = dpkg_list; p != NULL; p = p->next)
00733     {
00734         gboolean exists;
00735         gchar * pkg = g_strdup((gchar*)p->data);
00736         pkg = g_strstrip (pkg);
00737         src = lu_get_sourcepkg (pkg);
00738         if (src)
00739             exists= aptcache_lookup (src);
00740         else
00741             exists = aptcache_lookup (pkg);
00742         if (exists)
00743         {
00744             GList  * done = NULL;
00745             done = g_list_find_custom (installed, pkg, check_pkg_name);
00746             if (done)
00747             {
00748                 if ((verbose >= 1) && (!purge_mode))
00749                     g_print ("%s: %s - %s\n", PACKAGE, pkg, 
00750                         _("TDeb is already installed."));
00751                 continue;
00752             }
00753             /* this looks strange - adding and then removing
00754              but removing is done by prefix so all possible matches
00755              need to exist first. */
00756             g_printerr ("DEBUG: adding %s\n", pkg);
00757             if (src)
00758                 g_printerr ("DEBUG: from %s\n", src);
00759             g_hash_table_insert (choices, pkg, pkg);
00760         }
00761     }
00762     for (p = not_ours; p != NULL; p = p->next)
00763     {
00764         g_hash_table_foreach_remove (choices, lu_skip_not_ours, p->data);
00765     }
00766     c = g_hash_table_size (choices);
00767     if (!purge_mode)
00768     {
00769         GList * sorted = NULL;
00770 
00771         if (c == 0)
00772             g_print ("%s: %s\n", PACKAGE, _("Nothing to do."));
00773         else
00774         {
00775             g_print ("%s: ", PACKAGE);
00776             g_print (ngettext("%d package to be installed\n",
00777                 "%d packages to be installed\n", c), c);
00778             sorted = g_list_sort (g_hash_table_get_keys (choices), check_pkg_name);
00779             g_list_foreach (sorted, output, NULL);
00780         }
00781     }
00782     g_hash_table_destroy (tbl);
00783     g_hash_table_destroy (choices);
00784     run_apt_clean (suite_codename);
00785     remove_cache ("lists/lock", suite_codename);
00786     remove_cache ("lock", suite_codename);
00787     remove_cache ("srcpkgcache.bin", suite_codename);
00788     remove_cache ("pkgcache.bin", suite_codename);
00789     remove_lists (suite_codename);
00790     log = g_strconcat ("/var/lib/"PACKAGE"/var/log/apt/term.log", NULL);
00791     g_unlink (log);
00792     g_free (log);
00793     g_list_free (locales);
00794     g_unlink (sourceslist);
00795     if (purge_mode)
00796     {
00797         gchar * command;
00798 
00799         /* to convert to a "remove all TDebs" option, whether the
00800          package is installed or not, switch these
00801          from g_hash_table_remove to g_hash_table_insert */
00802         for (p = targets; p != NULL; p = p->next)
00803         {
00804             g_hash_table_remove (orphans, (gchar*)p->data);
00805         }
00806         for (p = installed; p != NULL; p = p->next)
00807         {
00808             g_hash_table_remove (orphans, (gchar*)p->data);
00809         }
00810         purge_names = g_strdup("");
00811         g_hash_table_foreach (orphans, lu_purge_orphans, NULL);
00812         if (g_strcmp0(purge_names, ""))
00813         {
00814             command = g_strconcat ("apt-get -y --purge remove ", purge_names, NULL);
00815             if (dry_run)
00816                 g_print ("%s: %s '%s'\n", PACKAGE, _("Dry-run only."), command);
00817             else
00818                 g_spawn_command_line_sync (command, NULL, NULL, NULL, &em_gerr);
00819             if (em_gerr)
00820             {
00821                 g_critical (em_gerr->message);
00822                 g_message (_("Unable to execute command: %s."), command);
00823                 g_clear_error (&em_gerr);
00824             }
00825             g_free (command);
00826         }
00827         else
00828             g_print ("%s: %s\n", PACKAGE, _("No TDeb packages to remove."));
00829     }
00830     g_print ("\n");
00831     g_free (suite_codename);
00832     lu_clear_caches ();
00833     return 0;
00834 }

static void output ( gpointer  key,
gpointer  data 
) [static]

install each available package name

Todo:
run all install operations in one call.

Todo:
rationalise error output.

Definition at line 141 of file langupdate.cc.

00142 {
00143     gchar * name, * hdl, * hdl_err, * config_str, * cmd, * func;
00144     gint err_status = 0;
00145     GError * gerr = NULL;
00146 
00147     c++;
00148     g_print ("%s: %s %s\n", PACKAGE, _("installing:"), (gchar*)key);
00149     name = NULL;
00150     config_str = lu_get_aptstring();
00151     if (dry_run)
00152     {
00153         cmd = g_strdup("apt-cache");
00154         func = g_strdup("show");
00155     }
00156     else
00157     {
00158         cmd = g_strdup ("apt-get");
00159         func = g_strdup("install -y");
00160     }
00161     if ((key) && (strcmp ((gchar*)key, "")))
00162         name = g_strdup_printf ( "%s %s %s %s", cmd, config_str, func, (gchar*)key);
00163     g_free (config_str);
00164     if (verbose >= 4)
00165         g_print ("%s: %s %s\n", PACKAGE, _("running apt command: "), name);
00166     g_spawn_command_line_sync (name, &hdl, &hdl_err, &err_status, &gerr);
00167     g_free (name);
00168     g_free (cmd);
00169     g_free (func);
00170     if (gerr) 
00171     {
00173         fprintf (stdout, _("apt returned an error:%s\n"), hdl_err);
00174         fprintf (stdout, _("status code:%d\n"), err_status);
00175         fprintf (stdout, "%s\n", gerr->message);
00176         fprintf (stdout, "%s\n", hdl);
00177         g_clear_error (&gerr);
00178         g_free (hdl_err);
00179         return;
00180     }
00181     if (dry_run)
00182     {
00183         fprintf (stdout, "%s\n", hdl);
00184         g_free (hdl);
00185     }
00186 }

static gchar* parse_installed ( const gchar *  pkg,
const gchar *  locale 
) [static]

Parses list of all installed packages.

Store a list of existing target packages by skipping those already installed.

Bug:
called once per locale - needs to use a GHashTable instead of a GList to avoid repetition.

Definition at line 198 of file langupdate.cc.

00199 {
00200     GList * match;
00201     gchar ** pos;
00202     gchar * r, *target, * lang, *src;
00203 
00204     pos = g_strsplit (pkg, ": ", -1);
00205     if (!pos[0])
00206         return NULL;
00207     r = NULL;
00208     match = NULL;
00209     lang = g_strconcat ("-", LOCALE_SUFFIX, "-", locale, NULL);
00210     if (g_str_has_prefix(PACKAGE_CHK, pos[0]))
00211     {
00212         if (verbose >= 4)
00213             g_print ("Parsing %s\n", pos[1]);
00214         r = g_strdup (pos[1]);
00215         if (g_str_has_suffix (r, lang))
00216         {
00217             if (verbose >= 2)
00218                 g_print ("Skipping %s\n", r);
00219             installed = g_list_prepend (installed, r);
00220             /* in case the target occurs later in the list */
00221             targets = g_list_remove (targets, r);
00222             return NULL;
00223         }
00224         else
00225         {
00226             gchar * orphaned, * l;
00227 
00228             orphaned = l = NULL;
00229             l = g_strconcat ("-", LOCALE_SUFFIX, "-", NULL);
00230             orphaned = g_strrstr_len (r, strlen(r), l);
00231             if (orphaned)
00232                 g_hash_table_insert (orphans, g_strdup(r), g_strdup(""));
00233             orphaned = NULL;
00234             g_free (l);
00235         }
00236         /* generate a target name. */
00237         src = lu_get_sourcepkg (r);
00238         if (src)
00239             target = g_strconcat (src, lang, NULL);
00240         else
00241             target = g_strconcat (r, lang, NULL);
00242         match = g_list_find_custom (installed, target, check_pkg_name);
00243         if (g_list_length (match) != 0)
00244             targets = g_list_prepend (targets, target);
00245         g_strfreev (pos);
00246         g_free (r);
00247         return target;
00248     }
00249     g_free (lang);
00250     g_strfreev (pos);
00251     return NULL;
00252 }

static void run_apt_clean ( const gchar *  user_suite  )  [static]

Todo:
rationalise error output.

Definition at line 361 of file langupdate.cc.

00362 {
00363     gchar * config_str, * hdl, * hdl_err, * name;
00364     GError * gerr = NULL;
00365     gint err_status = 0;
00366 
00367     g_return_if_fail (user_suite);
00368     config_str = lu_get_aptstring();
00369     name = g_strdup_printf ( "%s %s %s", "apt-get", config_str, "clean");
00370     g_spawn_command_line_sync (name, &hdl, &hdl_err, &err_status, &gerr);
00371     if (gerr) 
00372     {
00374         g_printerr (_("apt returned an error:%s\n"), hdl_err);
00375         g_printerr (_("status code:%d\n"), err_status);
00376         g_printerr ("%s\n", gerr->message);
00377         g_clear_error (&gerr);
00378         g_free (hdl_err);
00379         return;
00380     }
00381 }


Variable Documentation

guint c = 0 [static]

Todo:
put the static variables into a context struct?

Definition at line 49 of file langupdate.cc.

GOptionEntry entries[] [static]

Initial value:

 
{
    { "dry-run", 'n', 0, G_OPTION_ARG_NONE, &dry_run, 
        _("Only show the cache data, do not install"), 0 },
    { "mirror", 'm', 0, G_OPTION_ARG_STRING, &mirror,
        _("Use the specified TDeb mirror instead of the Emdebian default."), 
        _("mirror_name")},
    { "autoremove", 'r', 0, G_OPTION_ARG_NONE, &purge_mode,
        _("Remove TDebs for unsupported locales."), 0},
    { "verbose", 'v', 0, G_OPTION_ARG_INT, &verbose, _("Specify verbose level [0-4]"),
        _("integer") },
    { "suite", 0, 0, G_OPTION_ARG_STRING, &user_suite, 
        _("Specify the apt suite name [default unstable]"), _("codename") },
    { "version", 0, 0, G_OPTION_ARG_NONE, &show_version, _("Show version information "
        "and exit."), 0},
    { NULL }
}

Definition at line 83 of file langupdate.cc.

GList* not_ours = NULL [static]

List of packages that are not from Emdebian.

In order for langupdate to be safe in use in Debian, langupdate must not attempt to install an Emdebian TDeb when the package installed is from Debian as a file conflict will occur. (Emdebian TDebs do not have "Replaces:" for the corresponding binary packages.)

Even though the sysadmin can manually delete files from /usr/share/locale, it is not safe to assume that this has happened for the specific files in the TDeb. Calculating the conflict would require looking up the Source: package in the installed package check.

Currently, langupdate takes the safer option that if the relevant binary package is not from Emdebian (with an Emdebian version string), then the TDeb should not be considered.

The list of packages that fall into this category is held in not_ours.

Definition at line 73 of file langupdate.cc.


Generated on Sun Jan 18 17:25:32 2009 for langupdate by  doxygen 1.5.6