diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2001-10-04 05:22:42 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2001-10-04 05:22:42 +0000 |
commit | a8412dbf39be75b546038c8665bff8f7cbf37553 (patch) | |
tree | a8d4774ed5b7f8763818cacd1e7ad3b720fd1279 | |
parent | fd35de564ea822e7fec620eaf402783946dfbf63 (diff) | |
download | busybox-w32-a8412dbf39be75b546038c8665bff8f7cbf37553.tar.gz busybox-w32-a8412dbf39be75b546038c8665bff8f7cbf37553.tar.bz2 busybox-w32-a8412dbf39be75b546038c8665bff8f7cbf37553.zip |
Fixes with help from Stefan, Typo in prerm script, and when reinstall a package the old packages status was getting overwritten.
-rw-r--r-- | archival/dpkg.c | 12 | ||||
-rw-r--r-- | dpkg.c | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 06d722c9d..9c8fffa9c 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1184,7 +1184,7 @@ void remove_package(const unsigned int package_num) | |||
1184 | printf("Removing %s ...\n", package_name); | 1184 | printf("Removing %s ...\n", package_name); |
1185 | 1185 | ||
1186 | /* run prerm script */ | 1186 | /* run prerm script */ |
1187 | return_value = run_package_script(package_name, "prem"); | 1187 | return_value = run_package_script(package_name, "prerm"); |
1188 | if (return_value == -1) { | 1188 | if (return_value == -1) { |
1189 | error_msg_and_die("script failed, prerm failure"); | 1189 | error_msg_and_die("script failed, prerm failure"); |
1190 | } | 1190 | } |
@@ -1410,11 +1410,15 @@ extern int dpkg_main(int argc, char **argv) | |||
1410 | if ((dpkg_opt & dpkg_opt_unpack) || (dpkg_opt & dpkg_opt_install)) { | 1410 | if ((dpkg_opt & dpkg_opt_unpack) || (dpkg_opt & dpkg_opt_install)) { |
1411 | status_node = (status_node_t *) xmalloc(sizeof(status_node_t)); | 1411 | status_node = (status_node_t *) xmalloc(sizeof(status_node_t)); |
1412 | status_node->package = deb_file[deb_count]->package; | 1412 | status_node->package = deb_file[deb_count]->package; |
1413 | /* use reinstreq isnt changed to "ok" until the package control info | ||
1414 | * is written to the status file*/ | ||
1415 | status_node->status = search_name_hashtable("install reinstreq not-installed"); | ||
1416 | 1413 | ||
1414 | /* Try and find a currently installed version of this package */ | ||
1417 | status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]); | 1415 | status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]); |
1416 | if ((status_hashtable[status_num] == NULL) || | ||
1417 | (status_hashtable[status_num]->status == 0)) { | ||
1418 | /* reinstreq isnt changed to "ok" until the package control info | ||
1419 | * is written to the status file*/ | ||
1420 | status_node->status = search_name_hashtable("install reinstreq not-installed"); | ||
1421 | } | ||
1418 | status_hashtable[status_num] = status_node; | 1422 | status_hashtable[status_num] = status_node; |
1419 | } | 1423 | } |
1420 | } | 1424 | } |
@@ -1184,7 +1184,7 @@ void remove_package(const unsigned int package_num) | |||
1184 | printf("Removing %s ...\n", package_name); | 1184 | printf("Removing %s ...\n", package_name); |
1185 | 1185 | ||
1186 | /* run prerm script */ | 1186 | /* run prerm script */ |
1187 | return_value = run_package_script(package_name, "prem"); | 1187 | return_value = run_package_script(package_name, "prerm"); |
1188 | if (return_value == -1) { | 1188 | if (return_value == -1) { |
1189 | error_msg_and_die("script failed, prerm failure"); | 1189 | error_msg_and_die("script failed, prerm failure"); |
1190 | } | 1190 | } |
@@ -1410,11 +1410,15 @@ extern int dpkg_main(int argc, char **argv) | |||
1410 | if ((dpkg_opt & dpkg_opt_unpack) || (dpkg_opt & dpkg_opt_install)) { | 1410 | if ((dpkg_opt & dpkg_opt_unpack) || (dpkg_opt & dpkg_opt_install)) { |
1411 | status_node = (status_node_t *) xmalloc(sizeof(status_node_t)); | 1411 | status_node = (status_node_t *) xmalloc(sizeof(status_node_t)); |
1412 | status_node->package = deb_file[deb_count]->package; | 1412 | status_node->package = deb_file[deb_count]->package; |
1413 | /* use reinstreq isnt changed to "ok" until the package control info | ||
1414 | * is written to the status file*/ | ||
1415 | status_node->status = search_name_hashtable("install reinstreq not-installed"); | ||
1416 | 1413 | ||
1414 | /* Try and find a currently installed version of this package */ | ||
1417 | status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]); | 1415 | status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]); |
1416 | if ((status_hashtable[status_num] == NULL) || | ||
1417 | (status_hashtable[status_num]->status == 0)) { | ||
1418 | /* reinstreq isnt changed to "ok" until the package control info | ||
1419 | * is written to the status file*/ | ||
1420 | status_node->status = search_name_hashtable("install reinstreq not-installed"); | ||
1421 | } | ||
1418 | status_hashtable[status_num] = status_node; | 1422 | status_hashtable[status_num] = status_node; |
1419 | } | 1423 | } |
1420 | } | 1424 | } |