Changeset 4704 for current/host/trunk/langupdate/trunk
- Timestamp:
- 08/07/08 21:40:18 (5 months ago)
- Location:
- current/host/trunk/langupdate/trunk
- Files:
-
- 3 modified
-
debian/changelog (modified) (1 diff)
-
src/aptcache.cc (modified) (2 diffs)
-
src/langupdate.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
current/host/trunk/langupdate/trunk/debian/changelog
r4703 r4704 2 2 3 3 * 0.0.5 Cleanup temporary files after each run 4 * clean up the downloaded packages and the arch-specific lists too 4 5 5 -- Neil Williams <codehelp@debian.org> Thu, 07 Aug 2008 1 7:53:58-03006 -- Neil Williams <codehelp@debian.org> Thu, 07 Aug 2008 18:38:22 -0300 6 7 7 8 langupdate (0.0.4) unstable; urgency=low -
current/host/trunk/langupdate/trunk/src/aptcache.cc
r4629 r4704 80 80 // gboolean All = _config->FindB("APT::Cache::AllNames","false"); 81 81 82 path = g_strconcat ("/var/lib/ langupdate/", suite_codename, "/lists/partial", NULL);82 path = g_strconcat ("/var/lib/"PACKAGE"/", suite_codename, "/lists/partial", NULL); 83 83 g_mkdir_with_parents (path, 0755); 84 84 g_free (path); 85 path = g_strconcat ("/var/lib/ langupdate/", suite_codename, "/archives/partial", NULL);85 path = g_strconcat ("/var/lib/"PACKAGE"/", suite_codename, "/archives/partial", NULL); 86 86 g_mkdir_with_parents (path, 0755); 87 87 g_free (path); 88 fout = fopen ("/var/lib/ langupdate/status", "a");88 fout = fopen ("/var/lib/"PACKAGE"/status", "a"); 89 89 fclose (fout); 90 path = g_strconcat ("/var/lib/ langupdate/", suite_codename, "/lists/lock", NULL);90 path = g_strconcat ("/var/lib/"PACKAGE"/", suite_codename, "/lists/lock", NULL); 91 91 fout = fopen (path, "a"); 92 92 fclose (fout); … … 103 103 _config->Set("Apt::Architecture", HOST_CPU); 104 104 _config->Set("help", true); 105 _config->Set("APT::Get::List-Cleanup", "o ff");105 _config->Set("APT::Get::List-Cleanup", "on"); 106 106 _config->Set("Apt::Install-Recommends","false"); 107 _config->Set("Dir", "/var/lib/ langupdate");108 _config->Set("Dir::Etc", "/var/lib/ langupdate");109 _config->Set("Dir::Etc::SourceList", "/var/lib/ langupdate/sources.list");107 _config->Set("Dir", "/var/lib/"PACKAGE); 108 _config->Set("Dir::Etc", "/var/lib/"PACKAGE); 109 _config->Set("Dir::Etc::SourceList", "/var/lib/"PACKAGE"/sources.list"); 110 110 _config->Set("Dir::State", suite_codename); 111 _config->Set("Dir::State::Status", "/var/lib/ langupdate/status");111 _config->Set("Dir::State::Status", "/var/lib/"PACKAGE"/status"); 112 112 _config->Set("Dir::Cache", suite_codename); 113 113 if (_config->FindB("APT::Cache::Generate",true) == false) -
current/host/trunk/langupdate/trunk/src/langupdate.cc
r4703 r4704 128 128 name = g_strdup_printf ( "%s %s %s %s", cmd, config_str, func, (gchar*)value); 129 129 g_spawn_command_line_sync (name, &hdl, &hdl_err, &err_status, &gerr); 130 g_free (name); 130 131 if (gerr) 131 132 { … … 134 135 fprintf (stdout, _("status code:%d\n"), err_status); 135 136 fprintf (stdout, "%s\n", gerr->message); 137 g_clear_error (&gerr); 138 g_free (hdl_err); 136 139 return; 137 140 } 138 141 if (dry_run) 142 { 139 143 fprintf (stdout, "%s\n", hdl); 144 g_free (hdl); 145 } 146 g_free (cmd); 147 g_free (func); 140 148 } 141 149 … … 255 263 g_unlink (path); 256 264 g_free (path); 265 } 266 267 static void 268 run_apt_clean (const gchar * user_suite) 269 { 270 gchar * config_str, * hdl, * hdl_err, * name; 271 GError * gerr = NULL; 272 gint err_status = 0; 273 274 config_str = lu_get_aptstring(); 275 name = g_strdup_printf ( "%s %s %s", "apt-get", config_str, "clean"); 276 g_spawn_command_line_sync (name, &hdl, &hdl_err, &err_status, &gerr); 277 if (gerr) 278 { 279 /// \todo rationalise error output. 280 fprintf (stdout, _("apt returned an error:%s\n"), hdl_err); 281 fprintf (stdout, _("status code:%d\n"), err_status); 282 fprintf (stdout, "%s\n", gerr->message); 283 g_clear_error (&gerr); 284 g_free (hdl_err); 285 return; 286 } 287 } 288 289 static void 290 remove_binlists (gpointer value, gpointer data) 291 { 292 gchar * code, * path, *suite; 293 suite = (gchar*) data; 294 code = (gchar*) value; 295 if ((code) && (strcmp (code, ""))) 296 { 297 path = g_strconcat ("/var/lib/",PACKAGE,"/", suite, 298 "/lists/buildd.emdebian.org_locale_dists_", suite, "_", 299 code, "_binary-",HOST_CPU,"_Packages", NULL); 300 g_unlink (path); 301 g_free (path); 302 } 257 303 } 258 304 … … 368 414 g_list_foreach (choices, output, NULL); 369 415 g_hash_table_destroy (tbl); 370 g_list_free (locales);371 416 g_list_free (choices); 417 run_apt_clean (suite_codename); 372 418 remove_cache ("lists/lock", suite_codename); 373 419 remove_cache ("lock", suite_codename); … … 375 421 remove_cache ("pkgcache.bin", suite_codename); 376 422 remove_lists (suite_codename); 423 g_list_foreach (locales, remove_binlists, suite_codename); 424 g_list_free (locales); 377 425 g_unlink (sourceslist); 378 426 return 0;
