aboutsummaryrefslogtreecommitdiff
path: root/archival/dpkg.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r--archival/dpkg.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c
index f133299e3..1cd45eda4 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -18,7 +18,7 @@
18 * known difference between busybox dpkg and the official dpkg that i don't 18 * known difference between busybox dpkg and the official dpkg that i don't
19 * consider important, its worth keeping a note of differences anyway, just to 19 * consider important, its worth keeping a note of differences anyway, just to
20 * make it easier to maintain. 20 * make it easier to maintain.
21 * - the first value for the confflile: field isnt placed on a new line. 21 * - the first value for the confflile: field isn't placed on a new line.
22 * - when installing a package the status: field is placed at the end of the 22 * - when installing a package the status: field is placed at the end of the
23 * section, rather than just after the package: field. 23 * section, rather than just after the package: field.
24 * 24 *
@@ -110,7 +110,7 @@ typedef struct common_node_s {
110 edge_t **edge; 110 edge_t **edge;
111} common_node_t; 111} common_node_t;
112 112
113/* Currently it doesnt store packages that have state-status of not-installed 113/* Currently it doesn't store packages that have state-status of not-installed
114 * So it only really has to be the size of the maximum number of packages 114 * So it only really has to be the size of the maximum number of packages
115 * likely to be installed at any one time, so there is a bit of leeway here */ 115 * likely to be installed at any one time, so there is a bit of leeway here */
116#define STATUS_HASH_PRIME 8191 116#define STATUS_HASH_PRIME 8191
@@ -205,7 +205,7 @@ static int search_name_hashtable(const char *key)
205 return probe_address; 205 return probe_address;
206} 206}
207 207
208/* this DOESNT add the key to the hashtable 208/* this DOESN'T add the key to the hashtable
209 * TODO make it consistent with search_name_hashtable 209 * TODO make it consistent with search_name_hashtable
210 */ 210 */
211static unsigned search_status_hashtable(const char *key) 211static unsigned search_status_hashtable(const char *key)
@@ -467,7 +467,7 @@ static void add_split_dependencies(common_node_t *parent_node, const char *whole
467 version = strchr(field2, '('); 467 version = strchr(field2, '(');
468 if (version == NULL) { 468 if (version == NULL) {
469 edge->operator = VER_ANY; 469 edge->operator = VER_ANY;
470 /* Get the versions hash number, adding it if the number isnt already in there */ 470 /* Get the versions hash number, adding it if the number isn't already in there */
471 edge->version = search_name_hashtable("ANY"); 471 edge->version = search_name_hashtable("ANY");
472 } else { 472 } else {
473 /* Skip leading ' ' or '(' */ 473 /* Skip leading ' ' or '(' */
@@ -496,7 +496,7 @@ static void add_split_dependencies(common_node_t *parent_node, const char *whole
496 496
497 /* Truncate version at trailing ' ' or ')' */ 497 /* Truncate version at trailing ' ' or ')' */
498 version[strcspn(version, " )")] = '\0'; 498 version[strcspn(version, " )")] = '\0';
499 /* Get the versions hash number, adding it if the number isnt already in there */ 499 /* Get the versions hash number, adding it if the number isn't already in there */
500 edge->version = search_name_hashtable(version); 500 edge->version = search_name_hashtable(version);
501 } 501 }
502 502
@@ -562,7 +562,7 @@ static int read_package_field(const char *package_buffer, char **field_name, cha
562 offset_name_end = offset; 562 offset_name_end = offset;
563 offset_value_start = next_offset; 563 offset_value_start = next_offset;
564 } 564 }
565 /* TODO: Name might still have trailing spaces if ':' isnt 565 /* TODO: Name might still have trailing spaces if ':' isn't
566 * immediately after name */ 566 * immediately after name */
567 break; 567 break;
568 case '\n': 568 case '\n':
@@ -776,7 +776,7 @@ static void index_status_file(const char *filename)
776 const unsigned package_num = fill_package_struct(control_buffer); 776 const unsigned package_num = fill_package_struct(control_buffer);
777 if (package_num != -1) { 777 if (package_num != -1) {
778 status_node = xmalloc(sizeof(status_node_t)); 778 status_node = xmalloc(sizeof(status_node_t));
779 /* fill_package_struct doesnt handle the status field */ 779 /* fill_package_struct doesn't handle the status field */
780 status_line = strstr(control_buffer, "Status:"); 780 status_line = strstr(control_buffer, "Status:");
781 if (status_line != NULL) { 781 if (status_line != NULL) {
782 status_line += 7; 782 status_line += 7;
@@ -850,7 +850,7 @@ static void write_status_file(deb_file_t **deb_file)
850 if (status_hashtable[status_num] != NULL) { 850 if (status_hashtable[status_num] != NULL) {
851 const char *status_from_hashtable = name_hashtable[status_hashtable[status_num]->status]; 851 const char *status_from_hashtable = name_hashtable[status_hashtable[status_num]->status];
852 if (strcmp(status_from_file, status_from_hashtable) != 0) { 852 if (strcmp(status_from_file, status_from_hashtable) != 0) {
853 /* New status isnt exactly the same as old status */ 853 /* New status isn't exactly the same as old status */
854 const int state_status = get_status(status_num, 3); 854 const int state_status = get_status(status_num, 3);
855 if ((strcmp("installed", name_hashtable[state_status]) == 0) 855 if ((strcmp("installed", name_hashtable[state_status]) == 0)
856 || (strcmp("unpacked", name_hashtable[state_status]) == 0) 856 || (strcmp("unpacked", name_hashtable[state_status]) == 0)
@@ -919,7 +919,7 @@ static void write_status_file(deb_file_t **deb_file)
919 } 919 }
920 } 920 }
921 } 921 }
922 /* If the package from the status file wasnt handle above, do it now*/ 922 /* If the package from the status file wasn't handle above, do it now*/
923 if (!write_flag) { 923 if (!write_flag) {
924 fprintf(new_status_file, "%s\n\n", control_buffer); 924 fprintf(new_status_file, "%s\n\n", control_buffer);
925 } 925 }
@@ -946,7 +946,7 @@ static void write_status_file(deb_file_t **deb_file)
946 if (errno != ENOENT) 946 if (errno != ENOENT)
947 bb_error_msg_and_die("can't create backup status file"); 947 bb_error_msg_and_die("can't create backup status file");
948 /* Its ok if renaming the status file fails because status 948 /* Its ok if renaming the status file fails because status
949 * file doesnt exist, maybe we are starting from scratch */ 949 * file doesn't exist, maybe we are starting from scratch */
950 bb_error_msg("no status file found, creating new one"); 950 bb_error_msg("no status file found, creating new one");
951 } 951 }
952 952
@@ -1061,7 +1061,7 @@ static int check_deps(deb_file_t **deb_file, int deb_start /*, int dep_max_count
1061 } 1061 }
1062 1062
1063 1063
1064 /* Check dependendcies */ 1064 /* Check dependentcies */
1065 for (i = 0; i < PACKAGE_HASH_PRIME; i++) { 1065 for (i = 0; i < PACKAGE_HASH_PRIME; i++) {
1066 int status_num = 0; 1066 int status_num = 0;
1067 int number_of_alternatives = 0; 1067 int number_of_alternatives = 0;
@@ -1244,7 +1244,7 @@ static void run_package_script_or_die(const char *package_name, const char *scri
1244 1244
1245 script_path = xasprintf("/var/lib/dpkg/info/%s.%s", package_name, script_type); 1245 script_path = xasprintf("/var/lib/dpkg/info/%s.%s", package_name, script_type);
1246 1246
1247 /* If the file doesnt exist is isnt fatal */ 1247 /* If the file doesn't exist it isn't fatal */
1248 result = access(script_path, F_OK) ? EXIT_SUCCESS : system(script_path); 1248 result = access(script_path, F_OK) ? EXIT_SUCCESS : system(script_path);
1249 free(script_path); 1249 free(script_path);
1250 if (result) 1250 if (result)
@@ -1839,7 +1839,7 @@ int dpkg_main(int argc UNUSED_PARAM, char **argv)
1839 ) { 1839 ) {
1840 status_node = xmalloc(sizeof(status_node_t)); 1840 status_node = xmalloc(sizeof(status_node_t));
1841 status_node->package = deb_file[deb_count]->package; 1841 status_node->package = deb_file[deb_count]->package;
1842 /* reinstreq isnt changed to "ok" until the package control info 1842 /* reinstreq isn't changed to "ok" until the package control info
1843 * is written to the status file*/ 1843 * is written to the status file*/
1844 status_node->status = search_name_hashtable("install reinstreq not-installed"); 1844 status_node->status = search_name_hashtable("install reinstreq not-installed");
1845 status_hashtable[status_num] = status_node; 1845 status_hashtable[status_num] = status_node;