diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-04-14 17:51:38 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-04-14 17:51:38 +0000 |
commit | 91d2370c2c6a5a6a8214647730701d8e85e62441 (patch) | |
tree | 101230a8bd16a03319acc4b9b5fb33c33fb58672 /archival/dpkg.c | |
parent | 599dbdd2f8da81fb29fd52efab56d9b8a299ff9b (diff) | |
download | busybox-w32-91d2370c2c6a5a6a8214647730701d8e85e62441.tar.gz busybox-w32-91d2370c2c6a5a6a8214647730701d8e85e62441.tar.bz2 busybox-w32-91d2370c2c6a5a6a8214647730701d8e85e62441.zip |
Larry Doolittle writes:
This is a bulk spelling fix patch against busybox-1.00-pre10.
If anyone gets a corrupted copy (and cares), let me know and
I will make alternate arrangements.
Erik - please apply.
Authors - please check that I didn't corrupt any meaning.
Package importers - see if any of these changes should be
passed to the upstream authors.
I glossed over lots of sloppy capitalizations, missing apostrophes,
mixed American/British spellings, and German-style compound words.
What is "pretect redefined for test" in cmdedit.c?
Good luck on the 1.00 release!
- Larry
git-svn-id: svn://busybox.net/trunk/busybox@8759 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'archival/dpkg.c')
-rw-r--r-- | archival/dpkg.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index e192b4a62..c096518a2 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Mini dpkg implementation for busybox. | 2 | * Mini dpkg implementation for busybox. |
3 | * This is not meant as a replacemnt for dpkg | 3 | * This is not meant as a replacement for dpkg |
4 | * | 4 | * |
5 | * Written By Glenn McGrath with the help of others | 5 | * Written By Glenn McGrath with the help of others |
6 | * Copyright (C) 2001 by Glenn McGrath | 6 | * Copyright (C) 2001 by Glenn McGrath |
@@ -23,7 +23,7 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * Known difference between busybox dpkg and the official dpkg that i dont | 26 | * Known difference between busybox dpkg and the official dpkg that i don't |
27 | * consider important, its worth keeping a note of differences anyway, just to | 27 | * consider important, its worth keeping a note of differences anyway, just to |
28 | * make it easier to maintain. | 28 | * make it easier to maintain. |
29 | * - The first value for the Confflile: field isnt placed on a new line. | 29 | * - The first value for the Confflile: field isnt placed on a new line. |
@@ -86,7 +86,7 @@ common_node_t *package_hashtable[PACKAGE_HASH_PRIME + 1]; | |||
86 | 86 | ||
87 | /* Currently it doesnt store packages that have state-status of not-installed | 87 | /* Currently it doesnt store packages that have state-status of not-installed |
88 | * So it only really has to be the size of the maximum number of packages | 88 | * So it only really has to be the size of the maximum number of packages |
89 | * likely to be installed at any one time, so there is a bit of leaway here */ | 89 | * likely to be installed at any one time, so there is a bit of leeway here */ |
90 | #define STATUS_HASH_PRIME 8191 | 90 | #define STATUS_HASH_PRIME 8191 |
91 | typedef struct status_node_s { | 91 | typedef struct status_node_s { |
92 | unsigned int package:14; /* has to fit PACKAGE_HASH_PRIME */ | 92 | unsigned int package:14; /* has to fit PACKAGE_HASH_PRIME */ |
@@ -94,7 +94,7 @@ typedef struct status_node_s { | |||
94 | } status_node_t; | 94 | } status_node_t; |
95 | status_node_t *status_hashtable[STATUS_HASH_PRIME + 1]; | 95 | status_node_t *status_hashtable[STATUS_HASH_PRIME + 1]; |
96 | 96 | ||
97 | /* Even numbers are for 'extras', like ored dependecies or null */ | 97 | /* Even numbers are for 'extras', like ored dependencies or null */ |
98 | enum edge_type_e { | 98 | enum edge_type_e { |
99 | EDGE_NULL = 0, | 99 | EDGE_NULL = 0, |
100 | EDGE_PRE_DEPENDS = 1, | 100 | EDGE_PRE_DEPENDS = 1, |
@@ -148,7 +148,7 @@ void make_hash(const char *key, unsigned int *start, unsigned int *decrement, co | |||
148 | for(i = 1; i < len; i++) { | 148 | for(i = 1; i < len; i++) { |
149 | /* shifts the ascii based value and adds it to previous value | 149 | /* shifts the ascii based value and adds it to previous value |
150 | * shift amount is mod 24 because long int is 32 bit and data | 150 | * shift amount is mod 24 because long int is 32 bit and data |
151 | * to be shifted is 8, dont want to shift data to where it has | 151 | * to be shifted is 8, don't want to shift data to where it has |
152 | * no effect*/ | 152 | * no effect*/ |
153 | hash_num += ((key[i] + key[i-1]) << ((key[i] * i) % 24)); | 153 | hash_num += ((key[i] + key[i-1]) << ((key[i] * i) % 24)); |
154 | } | 154 | } |
@@ -392,7 +392,7 @@ int search_package_hashtable(const unsigned int name, const unsigned int version | |||
392 | /* | 392 | /* |
393 | * This function searches through the entire package_hashtable looking | 393 | * This function searches through the entire package_hashtable looking |
394 | * for a package which provides "needle". It returns the index into | 394 | * for a package which provides "needle". It returns the index into |
395 | * the package_hashtable for the provining package. | 395 | * the package_hashtable for the providing package. |
396 | * | 396 | * |
397 | * needle is the index into name_hashtable of the package we are | 397 | * needle is the index into name_hashtable of the package we are |
398 | * looking for. | 398 | * looking for. |
@@ -489,7 +489,7 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line, | |||
489 | /* Skip leading ' ' or '(' */ | 489 | /* Skip leading ' ' or '(' */ |
490 | version += strspn(field2, " "); | 490 | version += strspn(field2, " "); |
491 | version += strspn(version, "("); | 491 | version += strspn(version, "("); |
492 | /* Calculate length of any operator charactors */ | 492 | /* Calculate length of any operator characters */ |
493 | offset_ch = strspn(version, "<=>"); | 493 | offset_ch = strspn(version, "<=>"); |
494 | /* Determine operator */ | 494 | /* Determine operator */ |
495 | if (offset_ch > 0) { | 495 | if (offset_ch > 0) { |
@@ -636,7 +636,7 @@ unsigned int get_status(const unsigned int status_node, const int num) | |||
636 | for (i = 1; i < num; i++) { | 636 | for (i = 1; i < num; i++) { |
637 | /* skip past a word */ | 637 | /* skip past a word */ |
638 | status_string += strcspn(status_string, " "); | 638 | status_string += strcspn(status_string, " "); |
639 | /* skip past the seperating spaces */ | 639 | /* skip past the separating spaces */ |
640 | status_string += strspn(status_string, " "); | 640 | status_string += strspn(status_string, " "); |
641 | } | 641 | } |
642 | len = strcspn(status_string, " \n\0"); | 642 | len = strcspn(status_string, " \n\0"); |
@@ -955,13 +955,13 @@ void write_status_file(deb_file_t **deb_file) | |||
955 | fclose(new_status_file); | 955 | fclose(new_status_file); |
956 | 956 | ||
957 | 957 | ||
958 | /* Create a seperate backfile to dpkg */ | 958 | /* Create a separate backfile to dpkg */ |
959 | if (rename("/var/lib/dpkg/status", "/var/lib/dpkg/status.udeb.bak") == -1) { | 959 | if (rename("/var/lib/dpkg/status", "/var/lib/dpkg/status.udeb.bak") == -1) { |
960 | struct stat stat_buf; | 960 | struct stat stat_buf; |
961 | if (stat("/var/lib/dpkg/status", &stat_buf) == 0) { | 961 | if (stat("/var/lib/dpkg/status", &stat_buf) == 0) { |
962 | bb_error_msg_and_die("Couldnt create backup status file"); | 962 | bb_error_msg_and_die("Couldnt create backup status file"); |
963 | } | 963 | } |
964 | /* Its ok if renaming the status file fails becasue status | 964 | /* Its ok if renaming the status file fails because status |
965 | * file doesnt exist, maybe we are starting from scratch */ | 965 | * file doesnt exist, maybe we are starting from scratch */ |
966 | bb_error_msg("No status file found, creating new one"); | 966 | bb_error_msg("No status file found, creating new one"); |
967 | } | 967 | } |
@@ -971,10 +971,10 @@ void write_status_file(deb_file_t **deb_file) | |||
971 | } | 971 | } |
972 | } | 972 | } |
973 | 973 | ||
974 | /* This function returns TRUE if the given package can statisfy a | 974 | /* This function returns TRUE if the given package can satisfy a |
975 | * dependency of type depend_type. | 975 | * dependency of type depend_type. |
976 | * | 976 | * |
977 | * A pre-depends is statisfied only if a package is already installed, | 977 | * A pre-depends is satisfied only if a package is already installed, |
978 | * which a regular depends can be satisfied by a package which we want | 978 | * which a regular depends can be satisfied by a package which we want |
979 | * to install. | 979 | * to install. |
980 | */ | 980 | */ |
@@ -1085,7 +1085,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count) | |||
1085 | for (i = 0; i < PACKAGE_HASH_PRIME; i++) { | 1085 | for (i = 0; i < PACKAGE_HASH_PRIME; i++) { |
1086 | int status_num = 0; | 1086 | int status_num = 0; |
1087 | int number_of_alternatives = 0; | 1087 | int number_of_alternatives = 0; |
1088 | const edge_t * root_of_alternatives; | 1088 | const edge_t * root_of_alternatives = NULL; |
1089 | const common_node_t *package_node = package_hashtable[i]; | 1089 | const common_node_t *package_node = package_hashtable[i]; |
1090 | 1090 | ||
1091 | /* If the package node does not exist then this | 1091 | /* If the package node does not exist then this |
@@ -1118,7 +1118,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count) | |||
1118 | continue; | 1118 | continue; |
1119 | #endif | 1119 | #endif |
1120 | 1120 | ||
1121 | /* This code is tested only for EDGE_DEPENDS, sine I | 1121 | /* This code is tested only for EDGE_DEPENDS, since I |
1122 | * have no suitable pre-depends available. There is no | 1122 | * have no suitable pre-depends available. There is no |
1123 | * reason that it shouldn't work though :-) | 1123 | * reason that it shouldn't work though :-) |
1124 | */ | 1124 | */ |
@@ -1211,7 +1211,7 @@ char **create_list(const char *filename) | |||
1211 | char *line = NULL; | 1211 | char *line = NULL; |
1212 | int count = 0; | 1212 | int count = 0; |
1213 | 1213 | ||
1214 | /* dont use [xw]fopen here, handle error ourself */ | 1214 | /* don't use [xw]fopen here, handle error ourself */ |
1215 | list_stream = fopen(filename, "r"); | 1215 | list_stream = fopen(filename, "r"); |
1216 | if (list_stream == NULL) { | 1216 | if (list_stream == NULL) { |
1217 | return(NULL); | 1217 | return(NULL); |
@@ -1385,7 +1385,7 @@ void remove_package(const unsigned int package_num, int noisy) | |||
1385 | bb_error_msg_and_die("script failed, prerm failure"); | 1385 | bb_error_msg_and_die("script failed, prerm failure"); |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | /* Create a list of files to remove, and a seperate list of those to keep */ | 1388 | /* Create a list of files to remove, and a separate list of those to keep */ |
1389 | sprintf(list_name, "/var/lib/dpkg/info/%s.list", package_name); | 1389 | sprintf(list_name, "/var/lib/dpkg/info/%s.list", package_name); |
1390 | remove_files = create_list(list_name); | 1390 | remove_files = create_list(list_name); |
1391 | 1391 | ||
@@ -1480,7 +1480,7 @@ static void init_archive_deb_control(archive_handle_t *ar_handle) | |||
1480 | tar_handle = init_handle(); | 1480 | tar_handle = init_handle(); |
1481 | tar_handle->src_fd = ar_handle->src_fd; | 1481 | tar_handle->src_fd = ar_handle->src_fd; |
1482 | 1482 | ||
1483 | /* We dont care about data.tar.* or debian-binary, just control.tar.* */ | 1483 | /* We don't care about data.tar.* or debian-binary, just control.tar.* */ |
1484 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ | 1484 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ |
1485 | ar_handle->accept = llist_add_to(NULL, "control.tar.gz"); | 1485 | ar_handle->accept = llist_add_to(NULL, "control.tar.gz"); |
1486 | #endif | 1486 | #endif |
@@ -1502,7 +1502,7 @@ static void init_archive_deb_data(archive_handle_t *ar_handle) | |||
1502 | tar_handle = init_handle(); | 1502 | tar_handle = init_handle(); |
1503 | tar_handle->src_fd = ar_handle->src_fd; | 1503 | tar_handle->src_fd = ar_handle->src_fd; |
1504 | 1504 | ||
1505 | /* We dont care about control.tar.* or debian-binary, just data.tar.* */ | 1505 | /* We don't care about control.tar.* or debian-binary, just data.tar.* */ |
1506 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ | 1506 | #ifdef CONFIG_FEATURE_DEB_TAR_GZ |
1507 | ar_handle->accept = llist_add_to(NULL, "data.tar.gz"); | 1507 | ar_handle->accept = llist_add_to(NULL, "data.tar.gz"); |
1508 | #endif | 1508 | #endif |