aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2003-10-09 04:00:45 +0000
committerJason Woodward2003-10-09 04:00:45 +0000
commite54edbef33d9a8a18d2e4c2b8c25b3cf6f622306 (patch)
tree80f66efdd5f5fea718c02c8e462fc15360e595c4
parent7fec824436b8949cfe09d928a5e2f66e5207b884 (diff)
downloadslapt-get-e54edbef33d9a8a18d2e4c2b8c25b3cf6f622306.tar.gz
introduced a DO_NOT_UNLINK_BAD_FILES macro within include/main.h
-rw-r--r--ChangeLog1
-rw-r--r--src/curl.c4
-rw-r--r--src/main.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ce16ab..e20164b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
* added extra error checking
* formatting updates
* actually call regfree() for all regex_t
+ * introduced a DO_NOT_UNLINK_BAD_FILES macro within include/main.h
0.9.5c Oct 04, 2003
* removed bad free() in get_installed_pkgs()
diff --git a/src/curl.c b/src/curl.c
index 694ff98..eb14d9e 100644
--- a/src/curl.c
+++ b/src/curl.c
@@ -223,6 +223,7 @@ char *download_pkg(const rc_config *global_config,pkg_info_t *pkg){
#endif
}else{
fclose(fh);
+#if DO_NOT_UNLINK_BAD_FILES == 0
/* if the d/l fails, unlink the empty file */
if( unlink(file_name) == -1 ){
fprintf(stderr,"Failed to unlink %s\n",file_name);
@@ -230,6 +231,7 @@ char *download_pkg(const rc_config *global_config,pkg_info_t *pkg){
perror("unlink");
}
}
+#endif
return NULL;
}
@@ -247,6 +249,7 @@ char *download_pkg(const rc_config *global_config,pkg_info_t *pkg){
fprintf(stderr,"MD5 expected: [%s]\n",md5_sum);
fprintf(stderr,"File: %s/%s\n",global_config->working_dir,file_name);
#endif
+#if DO_NOT_UNLINK_BAD_FILES == 0
/* if the checksum fails, unlink the bogus file */
if( unlink(file_name) == -1 ){
fprintf(stderr,"Failed to unlink %s\n",file_name);
@@ -254,6 +257,7 @@ char *download_pkg(const rc_config *global_config,pkg_info_t *pkg){
perror("unlink");
}
}
+#endif
return NULL;
}else{
printf("Done\n");
diff --git a/src/main.h b/src/main.h
index 0135f1b..cae1451 100644
--- a/src/main.h
+++ b/src/main.h
@@ -59,6 +59,7 @@ typedef struct _sg_regex sg_regex;
/* */
#define DEBUG 0
+#define DO_NOT_UNLINK_BAD_FILES 1
#define PKG_LIST "PACKAGES.TXT"
#define PKG_LIST_L "package_data_list"
#define PATCHES_LIST "FILE_LIST"