aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2003-10-13 19:27:19 +0000
committerJason Woodward2003-10-13 19:27:19 +0000
commit21cc8e3dac7b66e58f13584dc2c3d3ebbc41f7be (patch)
tree572cee7baea2a524a768988731bbe47889efcc6c
parentf0b667d1d263726719a007c77dab0c5db3ea1098 (diff)
downloadslapt-get-21cc8e3dac7b66e58f13584dc2c3d3ebbc41f7be.tar.gz
download errors should look better now
-rw-r--r--src/action.c18
-rw-r--r--src/curl.c4
2 files changed, 10 insertions, 12 deletions
diff --git a/src/action.c b/src/action.c
index 829575c..aee23f6 100644
--- a/src/action.c
+++ b/src/action.c
@@ -243,12 +243,11 @@ void pkg_action_update(const rc_config *global_config){
#endif
patches_list_fh = open_file(PATCHES_LIST_L,"w+");
for(i = 0; i < global_config->sources.count; i++){
- if( get_mirror_data_from_source(patches_list_fh,global_config->sources.url[i],PATCHES_LIST) == 0 ){
- #if USE_CURL_PROGRESS == 0
- printf("Done\n");
- #endif
- }
+ get_mirror_data_from_source(patches_list_fh,global_config->sources.url[i],PATCHES_LIST);
}
+ #if USE_CURL_PROGRESS == 0
+ printf("Done\n");
+ #endif
fclose(patches_list_fh);
/* download checksum file */
@@ -259,12 +258,11 @@ void pkg_action_update(const rc_config *global_config){
#endif
checksum_list_fh = open_file(CHECKSUM_FILE,"w+");
for(i = 0; i < global_config->sources.count; i++){
- if( get_mirror_data_from_source(checksum_list_fh,global_config->sources.url[i],CHECKSUM_FILE) == 0 ){
- #if USE_CURL_PROGRESS == 0
- printf("Done\n");
- #endif
- }
+ get_mirror_data_from_source(checksum_list_fh,global_config->sources.url[i],CHECKSUM_FILE);
}
+ #if USE_CURL_PROGRESS == 0
+ printf("Done\n");
+ #endif
fclose(checksum_list_fh);
/* source listing to go here */
diff --git a/src/curl.c b/src/curl.c
index c9244e7..29dabe5 100644
--- a/src/curl.c
+++ b/src/curl.c
@@ -37,7 +37,7 @@ int download_data(FILE *fh,const char *url){
curl_easy_setopt(ch, CURLOPT_ERRORBUFFER, curl_err_buff );
if( (response = curl_easy_perform(ch)) != 0 ){
- fprintf(stderr,"failed to download: %s\n",curl_err_buff);
+ fprintf(stderr,"Failed to download: %s",curl_err_buff);
return_code = -1;
}
/*
@@ -53,7 +53,7 @@ int download_data(FILE *fh,const char *url){
}
int get_mirror_data_from_source(FILE *fh,const char *base_url,const char *filename){
- int return_code;
+ int return_code = 0;
char *url = NULL;
url = calloc(