aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2001-09-22 04:16:55 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2001-09-22 04:16:55 +0000
commitdece3c5684bf32239f84540be8e4359b1ee26672 (patch)
treedb4d69f3ecd7b7bd12959cad7d33b7e9fa27ddd3
parentb8f5adb64f1a9af77c463eef7e31d80def13ef4b (diff)
downloadbusybox-dece3c5684bf32239f84540be8e4359b1ee26672.tar.gz
The <package>.list file was prepending "./" to the files, fixed that.
Also fixed a very silly error by me when running postinst (remember to use the variable BEFORE its freed)
-rw-r--r--archival/dpkg.c11
-rw-r--r--dpkg.c11
2 files changed, 12 insertions, 10 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index a97a5a29f..6d3b06a89 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1098,18 +1098,19 @@ int run_package_script(const char *package_name, const char *script_type)
{
struct stat path_stat;
char *script_path;
+ int result;
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
/* If the file doesnt exist is isnt a fatal */
if (lstat(script_path, &path_stat) < 0) {
- free(script_path);
- return(EXIT_SUCCESS);
+ result = EXIT_SUCCESS;
} else {
- free(script_path);
- return(system(script_path));
+ result = system(script_path);
}
+ free(script_path);
+ return(result);
}
void all_control_list(char **remove_files, const char *package_name)
@@ -1298,7 +1299,7 @@ void unpack_package(deb_file_t *deb_file)
/* Create the list file */
strcat(info_prefix, "list");
out_stream = xfopen(info_prefix, "w");
- deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), NULL, NULL);
+ deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), "/", NULL);
fclose(out_stream);
/* change status */
diff --git a/dpkg.c b/dpkg.c
index a97a5a29f..6d3b06a89 100644
--- a/dpkg.c
+++ b/dpkg.c
@@ -1098,18 +1098,19 @@ int run_package_script(const char *package_name, const char *script_type)
{
struct stat path_stat;
char *script_path;
+ int result;
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
/* If the file doesnt exist is isnt a fatal */
if (lstat(script_path, &path_stat) < 0) {
- free(script_path);
- return(EXIT_SUCCESS);
+ result = EXIT_SUCCESS;
} else {
- free(script_path);
- return(system(script_path));
+ result = system(script_path);
}
+ free(script_path);
+ return(result);
}
void all_control_list(char **remove_files, const char *package_name)
@@ -1298,7 +1299,7 @@ void unpack_package(deb_file_t *deb_file)
/* Create the list file */
strcat(info_prefix, "list");
out_stream = xfopen(info_prefix, "w");
- deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), NULL, NULL);
+ deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), "/", NULL);
fclose(out_stream);
/* change status */