summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2005-04-30 03:17:21 +0000
committerJason Woodward2005-04-30 03:17:21 +0000
commitac923e8abc0265f93811ecefd9bc80e5afb9628c (patch)
tree80d741a56c82e4ffc3159d4939b822bd5ca7df1a /src
parente478eff540b509114686e324581cc32d61aa4f29 (diff)
downloadslapt-get-ac923e8abc0265f93811ecefd9bc80e5afb9628c.tar.gz
give more notification when package sources fail to download, added missing strings to translations, updated translations
Diffstat (limited to 'src')
-rw-r--r--src/package.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/package.c b/src/package.c
index f57a249..41ca574 100644
--- a/src/package.c
+++ b/src/package.c
@@ -1715,6 +1715,7 @@ int update_pkg_cache(const rc_config *global_config){
printf(_("Cached\n"));
if( (tmp_pkg_f = open_file(pkg_filename,"r")) == NULL ) exit(1);
available_pkgs = parse_packages_txt(tmp_pkg_f);
+ fclose(tmp_pkg_f);
}else{
if( global_config->dl_stats == TRUE ) printf("\n");
if( (tmp_pkg_f = open_file(pkg_filename,"w+b")) == NULL ) exit(1);
@@ -1726,17 +1727,23 @@ int update_pkg_cache(const rc_config *global_config){
source_dl_failed = 1;
clear_head_cache(pkg_filename);
}
+ fclose(tmp_pkg_f);
}
+ free(pkg_local_head);
if( available_pkgs == NULL || available_pkgs->pkg_count < 1 ){
- source_dl_failed = 1;
clear_head_cache(pkg_filename);
+ fprintf(stderr,_("Failed to parse package data from %s\n"),
+ global_config->sources->url[i]
+ );
+ free(pkg_head);
+ free(pkg_filename);
+ if ( available_pkgs ) free_pkg_list(available_pkgs);
+ continue;
}
/* if all is good, write it */
if( source_dl_failed != 1 && pkg_head != NULL ) write_head_cache(pkg_head,pkg_filename);
free(pkg_head);
- free(pkg_local_head);
free(pkg_filename);
- fclose(tmp_pkg_f);
/* download PATCHES_LIST */