summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath2001-10-06 02:27:36 +0000
committerGlenn L McGrath2001-10-06 02:27:36 +0000
commitf28d8195540cad33b455e4b2bce385003a40eb04 (patch)
treef2ae1ac791bf60eded1d6298161b81efb925e110
parent3550753445939316b00d5dde8e94137ef9c44a71 (diff)
downloadbusybox-f28d8195540cad33b455e4b2bce385003a40eb04.zip
busybox-f28d8195540cad33b455e4b2bce385003a40eb04.tar.gz
status_package_num should refer to package not status.
Only initialise a new entry in the status hashtable if it really is a new entry.
-rw-r--r--archival/dpkg.c5
-rw-r--r--dpkg.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 9c8fffa..845cfa6 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -1262,7 +1262,7 @@ void unpack_package(deb_file_t *deb_file)
{
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
const unsigned int status_num = search_status_hashtable(package_name);
- const unsigned int status_package_num = status_hashtable[status_num]->status;
+ const unsigned int status_package_num = status_hashtable[status_num]->package;
FILE *out_stream;
char *info_prefix;
@@ -1413,13 +1413,14 @@ extern int dpkg_main(int argc, char **argv)
/* Try and find a currently installed version of this package */
status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
+ /* If no previous entry was found initialise a new entry */
if ((status_hashtable[status_num] == NULL) ||
(status_hashtable[status_num]->status == 0)) {
/* reinstreq isnt changed to "ok" until the package control info
* is written to the status file*/
status_node->status = search_name_hashtable("install reinstreq not-installed");
+ status_hashtable[status_num] = status_node;
}
- status_hashtable[status_num] = status_node;
}
}
else if (dpkg_opt & dpkg_opt_package_name) {
diff --git a/dpkg.c b/dpkg.c
index 9c8fffa..845cfa6 100644
--- a/dpkg.c
+++ b/dpkg.c
@@ -1262,7 +1262,7 @@ void unpack_package(deb_file_t *deb_file)
{
const char *package_name = name_hashtable[package_hashtable[deb_file->package]->name];
const unsigned int status_num = search_status_hashtable(package_name);
- const unsigned int status_package_num = status_hashtable[status_num]->status;
+ const unsigned int status_package_num = status_hashtable[status_num]->package;
FILE *out_stream;
char *info_prefix;
@@ -1413,13 +1413,14 @@ extern int dpkg_main(int argc, char **argv)
/* Try and find a currently installed version of this package */
status_num = search_status_hashtable(name_hashtable[package_hashtable[deb_file[deb_count]->package]->name]);
+ /* If no previous entry was found initialise a new entry */
if ((status_hashtable[status_num] == NULL) ||
(status_hashtable[status_num]->status == 0)) {
/* reinstreq isnt changed to "ok" until the package control info
* is written to the status file*/
status_node->status = search_name_hashtable("install reinstreq not-installed");
+ status_hashtable[status_num] = status_node;
}
- status_hashtable[status_num] = status_node;
}
}
else if (dpkg_opt & dpkg_opt_package_name) {