diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-02-10 03:19:51 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-02-10 03:19:51 +0000 |
commit | 4b5e23f3458a3327eecb2aebea633865aa9bcd08 (patch) | |
tree | c76d19693a2580684def6e77f06b7019ec3a9027 | |
parent | 6f9fc16ccf813f4efeb3dd3077798fddfd220b5d (diff) | |
download | busybox-w32-4b5e23f3458a3327eecb2aebea633865aa9bcd08.tar.gz busybox-w32-4b5e23f3458a3327eecb2aebea633865aa9bcd08.tar.bz2 busybox-w32-4b5e23f3458a3327eecb2aebea633865aa9bcd08.zip |
Replace status defines with const int to conform to sytle guide, adds 32 bytes
git-svn-id: svn://busybox.net/trunk/busybox@1785 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | archival/dpkg.c | 119 | ||||
-rw-r--r-- | dpkg.c | 119 |
2 files changed, 116 insertions, 122 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 9519eeb22..e8c5557fa 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -42,35 +42,43 @@ | |||
42 | #define UDPKG_QUIET "UDPKG_QUIET" | 42 | #define UDPKG_QUIET "UDPKG_QUIET" |
43 | #define DEPENDSMAX 64 /* maximum number of depends we can handle */ | 43 | #define DEPENDSMAX 64 /* maximum number of depends we can handle */ |
44 | 44 | ||
45 | #define STATUS_WANTSTART (0) | 45 | //static const int status_wantstart = 0; |
46 | #define STATUS_WANTUNKNOWN (1 << 0) | 46 | //static const int status_wantunknown = (1 << 0); |
47 | #define STATUS_WANTINSTALL (1 << 1) | 47 | static const int status_wantinstall = (1 << 1); |
48 | #define STATUS_WANTHOLD (1 << 2) | 48 | //static const int status_wanthold = (1 << 2); |
49 | #define STATUS_WANTDEINSTALL (1 << 3) | 49 | //static const int status_wantdeinstall = (1 << 3); |
50 | #define STATUS_WANTPURGE (1 << 4) | 50 | //static const int status_wantpurge = (1 << 4); |
51 | #define STATUS_WANTMASK ~(STATUS_WANTUNKNOWN | STATUS_WANTINSTALL | STATUS_WANTHOLD | STATUS_WANTDEINSTALL | STATUS_WANTPURGE) | 51 | static const int status_wantmask = 31; |
52 | 52 | ||
53 | #define STATUS_FLAGSTART (5) | 53 | //static const int status_flagstart = 5; |
54 | #define STATUS_FLAGOK (1 << 5) | 54 | static const int status_flagok = (1 << 5); /* 32 */ |
55 | #define STATUS_FLAGREINSTREQ (1 << 6) | 55 | //static const int status_flagreinstreq = (1 << 6); |
56 | #define STATUS_FLAGHOLD (1 << 7) | 56 | //static const int status_flaghold = (1 << 7); |
57 | #define STATUS_FLAGHOLDREINSTREQ (1 << 8) | 57 | //static const int status_flagholdreinstreq = (1 << 8); |
58 | #define STATUS_FLAGMASK ~(STATUS_FLAGOK | STATUS_FLAGREINSTREQ | STATUS_FLAGHOLD | STATUS_FLAGHOLDREINSTREQ) | 58 | static const int status_flagmask = 480; |
59 | 59 | ||
60 | #define STATUS_STATUSSTART (9) | 60 | //static const int status_statusstart = 9; |
61 | #define STATUS_STATUSNOTINSTALLED (1 << 9) | 61 | //static const int status_statusnoninstalled = (1 << 9); /* 512 */ |
62 | #define STATUS_STATUSUNPACKED (1 << 10) | 62 | static const int status_statusunpacked = (1 << 10); |
63 | #define STATUS_STATUSHALFCONFIGURED (1 << 11) | 63 | static const int status_statushalfconfigured = (1 << 11); |
64 | #define STATUS_STATUSINSTALLED (1 << 12) | 64 | static const int status_statusinstalled = (1 << 12); |
65 | #define STATUS_STATUSHALFINSTALLED (1 << 13) | 65 | static const int status_statushalfinstalled = (1 << 13); |
66 | #define STATUS_STATUSCONFIGFILES (1 << 14) | 66 | //static const int status_statusconfigfiles = (1 << 14); |
67 | #define STATUS_STATUSPOSTINSTFAILED (1 << 15) | 67 | //static const int status_statuspostinstfailed = (1 << 15); |
68 | #define STATUS_STATUSREMOVALFAILED (1 << 16) | 68 | //static const int status_statusremovalfailed = (1 << 16); |
69 | #define STATUS_STATUSMASK ~(STATUS_STATUSNOTINSTALLED | STATUS_STATUSUNPACKED | STATUS_STATUSHALFCONFIGURED | STATUS_STATUSCONFIGFILES | STATUS_STATUSPOSTINSTFAILED | STATUS_STATUSREMOVALFAILED | STATUS_STATUSHALFINSTALLED) | 69 | static const int status_statusmask = 130560; /* i assume status_statusinstalled is supposed to be included */ |
70 | 70 | ||
71 | #define COLOR_WHITE 0 | 71 | static const char *statuswords[][10] = { |
72 | #define COLOR_GRAY 1 | 72 | { (char *) 0, "unknown", "install", "hold", "deinstall", "purge", 0 }, |
73 | #define COLOR_BLACK 2 | 73 | { (char *) 5, "ok", "reinstreq", "hold", "hold-reinstreq", 0 }, |
74 | { (char *) 9, "not-installed", "unpacked", "half-configured", | ||
75 | "installed", "half-installed", "config-files", | ||
76 | "post-inst-failed", "removal-failed", 0 } | ||
77 | }; | ||
78 | |||
79 | const int color_white = 0; | ||
80 | const int color_grey = 1; | ||
81 | const int color_black = 2; | ||
74 | 82 | ||
75 | /* data structures */ | 83 | /* data structures */ |
76 | struct package_t { | 84 | struct package_t { |
@@ -147,11 +155,11 @@ static void depends_sort_visit(struct package_t **ordered, | |||
147 | unsigned short i; | 155 | unsigned short i; |
148 | 156 | ||
149 | /* mark node as processing */ | 157 | /* mark node as processing */ |
150 | pkg->color = COLOR_GRAY; | 158 | pkg->color = color_grey; |
151 | 159 | ||
152 | /* visit each not-yet-visited node */ | 160 | /* visit each not-yet-visited node */ |
153 | for (i = 0; i < pkg->requiredcount; i++) | 161 | for (i = 0; i < pkg->requiredcount; i++) |
154 | if (pkg->requiredfor[i]->color == COLOR_WHITE) | 162 | if (pkg->requiredfor[i]->color == color_white) |
155 | depends_sort_visit(ordered, pkgs, pkg->requiredfor[i]); | 163 | depends_sort_visit(ordered, pkgs, pkg->requiredfor[i]); |
156 | 164 | ||
157 | #if 0 | 165 | #if 0 |
@@ -166,7 +174,7 @@ static void depends_sort_visit(struct package_t **ordered, | |||
166 | *ordered = pkg; | 174 | *ordered = pkg; |
167 | 175 | ||
168 | /* mark node as done */ | 176 | /* mark node as done */ |
169 | pkg->color = COLOR_BLACK; | 177 | pkg->color = color_black; |
170 | } | 178 | } |
171 | 179 | ||
172 | static struct package_t *depends_sort(struct package_t *pkgs) | 180 | static struct package_t *depends_sort(struct package_t *pkgs) |
@@ -177,10 +185,10 @@ static struct package_t *depends_sort(struct package_t *pkgs) | |||
177 | struct package_t *pkg; | 185 | struct package_t *pkg; |
178 | 186 | ||
179 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) | 187 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) |
180 | pkg->color = COLOR_WHITE; | 188 | pkg->color = color_white; |
181 | 189 | ||
182 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) | 190 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) |
183 | if (pkg->color == COLOR_WHITE) | 191 | if (pkg->color == color_white) |
184 | depends_sort_visit(&ordered, pkgs, pkg); | 192 | depends_sort_visit(&ordered, pkgs, pkg); |
185 | 193 | ||
186 | /* Leaks the old list... return the new one... */ | 194 | /* Leaks the old list... return the new one... */ |
@@ -217,8 +225,8 @@ struct package_t *depends_resolve(struct package_t *pkgs, void *status) | |||
217 | dependpkg.package = dependsvec[i]; | 225 | dependpkg.package = dependsvec[i]; |
218 | if ((found = tfind(&dependpkg, &status, package_compare)) == 0 || | 226 | if ((found = tfind(&dependpkg, &status, package_compare)) == 0 || |
219 | ((chk = *(struct package_t **)found) && | 227 | ((chk = *(struct package_t **)found) && |
220 | (chk->status & (STATUS_FLAGOK | STATUS_STATUSINSTALLED)) != | 228 | (chk->status & (status_flagok | status_statusinstalled)) != |
221 | (STATUS_FLAGOK | STATUS_STATUSINSTALLED))) | 229 | (status_flagok | status_statusinstalled))) |
222 | { | 230 | { |
223 | /* if it fails, we look through the list of packages we are going to | 231 | /* if it fails, we look through the list of packages we are going to |
224 | * install */ | 232 | * install */ |
@@ -268,17 +276,6 @@ struct package_t *depends_resolve(struct package_t *pkgs, void *status) | |||
268 | * read using the status_read function is written back to the status file | 276 | * read using the status_read function is written back to the status file |
269 | */ | 277 | */ |
270 | 278 | ||
271 | static const char *statuswords[][10] = { | ||
272 | { (char *)STATUS_WANTSTART, "unknown", "install", "hold", | ||
273 | "deinstall", "purge", 0 }, | ||
274 | { (char *)STATUS_FLAGSTART, "ok", "reinstreq", "hold", | ||
275 | "hold-reinstreq", 0 }, | ||
276 | { (char *)STATUS_STATUSSTART, "not-installed", "unpacked", "half-configured", | ||
277 | "installed", "half-installed", | ||
278 | "config-files", "post-inst-failed", | ||
279 | "removal-failed", 0 } | ||
280 | }; | ||
281 | |||
282 | int package_compare(const void *p1, const void *p2) | 279 | int package_compare(const void *p1, const void *p2) |
283 | { | 280 | { |
284 | return strcmp(((struct package_t *)p1)->package, | 281 | return strcmp(((struct package_t *)p1)->package, |
@@ -596,7 +593,7 @@ static int dpkg_doconfigure(struct package_t *pkg) | |||
596 | char postinst[1024]; | 593 | char postinst[1024]; |
597 | char buf[1024]; | 594 | char buf[1024]; |
598 | DPRINTF("Configuring %s\n", pkg->package); | 595 | DPRINTF("Configuring %s\n", pkg->package); |
599 | pkg->status &= STATUS_STATUSMASK; | 596 | pkg->status &= status_statusmask; |
600 | snprintf(postinst, sizeof(postinst), "%s%s.postinst", INFODIR, pkg->package); | 597 | snprintf(postinst, sizeof(postinst), "%s%s.postinst", INFODIR, pkg->package); |
601 | if (is_file(postinst)) | 598 | if (is_file(postinst)) |
602 | { | 599 | { |
@@ -604,12 +601,12 @@ static int dpkg_doconfigure(struct package_t *pkg) | |||
604 | if ((r = do_system(buf)) != 0) | 601 | if ((r = do_system(buf)) != 0) |
605 | { | 602 | { |
606 | fprintf(stderr, "postinst exited with status %d\n", r); | 603 | fprintf(stderr, "postinst exited with status %d\n", r); |
607 | pkg->status |= STATUS_STATUSHALFCONFIGURED; | 604 | pkg->status |= status_statushalfconfigured; |
608 | return 1; | 605 | return 1; |
609 | } | 606 | } |
610 | } | 607 | } |
611 | 608 | ||
612 | pkg->status |= STATUS_STATUSINSTALLED; | 609 | pkg->status |= status_statusinstalled; |
613 | 610 | ||
614 | return 0; | 611 | return 0; |
615 | } | 612 | } |
@@ -690,15 +687,15 @@ static int dpkg_dounpack(struct package_t *pkg) | |||
690 | fclose(outfp); | 687 | fclose(outfp); |
691 | } | 688 | } |
692 | } | 689 | } |
693 | pkg->status &= STATUS_WANTMASK; | 690 | pkg->status &= status_wantmask; |
694 | pkg->status |= STATUS_WANTINSTALL; | 691 | pkg->status |= status_wantinstall; |
695 | pkg->status &= STATUS_FLAGMASK; | 692 | pkg->status &= status_flagmask; |
696 | pkg->status |= STATUS_FLAGOK; | 693 | pkg->status |= status_flagok; |
697 | pkg->status &= STATUS_STATUSMASK; | 694 | pkg->status &= status_statusmask; |
698 | if (r == 0) | 695 | if (r == 0) |
699 | pkg->status |= STATUS_STATUSUNPACKED; | 696 | pkg->status |= status_statusunpacked; |
700 | else | 697 | else |
701 | pkg->status |= STATUS_STATUSHALFINSTALLED; | 698 | pkg->status |= status_statushalfinstalled; |
702 | } | 699 | } |
703 | chdir(cwd); | 700 | chdir(cwd); |
704 | return r; | 701 | return r; |
@@ -824,14 +821,14 @@ static int dpkg_install(struct package_t *pkgs) | |||
824 | /* Stage 3: install */ | 821 | /* Stage 3: install */ |
825 | for (p = ordered; p != 0; p = p->next) | 822 | for (p = ordered; p != 0; p = p->next) |
826 | { | 823 | { |
827 | p->status &= STATUS_WANTMASK; | 824 | p->status &= status_wantmask; |
828 | p->status |= STATUS_WANTINSTALL; | 825 | p->status |= status_wantinstall; |
829 | 826 | ||
830 | /* for now the flag is always set to ok... this is probably | 827 | /* for now the flag is always set to ok... this is probably |
831 | * not what we want | 828 | * not what we want |
832 | */ | 829 | */ |
833 | p->status &= STATUS_FLAGMASK; | 830 | p->status &= status_flagmask; |
834 | p->status |= STATUS_FLAGOK; | 831 | p->status |= status_flagok; |
835 | 832 | ||
836 | if (dpkg_doinstall(p) != 0) | 833 | if (dpkg_doinstall(p) != 0) |
837 | { | 834 | { |
@@ -42,35 +42,43 @@ | |||
42 | #define UDPKG_QUIET "UDPKG_QUIET" | 42 | #define UDPKG_QUIET "UDPKG_QUIET" |
43 | #define DEPENDSMAX 64 /* maximum number of depends we can handle */ | 43 | #define DEPENDSMAX 64 /* maximum number of depends we can handle */ |
44 | 44 | ||
45 | #define STATUS_WANTSTART (0) | 45 | //static const int status_wantstart = 0; |
46 | #define STATUS_WANTUNKNOWN (1 << 0) | 46 | //static const int status_wantunknown = (1 << 0); |
47 | #define STATUS_WANTINSTALL (1 << 1) | 47 | static const int status_wantinstall = (1 << 1); |
48 | #define STATUS_WANTHOLD (1 << 2) | 48 | //static const int status_wanthold = (1 << 2); |
49 | #define STATUS_WANTDEINSTALL (1 << 3) | 49 | //static const int status_wantdeinstall = (1 << 3); |
50 | #define STATUS_WANTPURGE (1 << 4) | 50 | //static const int status_wantpurge = (1 << 4); |
51 | #define STATUS_WANTMASK ~(STATUS_WANTUNKNOWN | STATUS_WANTINSTALL | STATUS_WANTHOLD | STATUS_WANTDEINSTALL | STATUS_WANTPURGE) | 51 | static const int status_wantmask = 31; |
52 | 52 | ||
53 | #define STATUS_FLAGSTART (5) | 53 | //static const int status_flagstart = 5; |
54 | #define STATUS_FLAGOK (1 << 5) | 54 | static const int status_flagok = (1 << 5); /* 32 */ |
55 | #define STATUS_FLAGREINSTREQ (1 << 6) | 55 | //static const int status_flagreinstreq = (1 << 6); |
56 | #define STATUS_FLAGHOLD (1 << 7) | 56 | //static const int status_flaghold = (1 << 7); |
57 | #define STATUS_FLAGHOLDREINSTREQ (1 << 8) | 57 | //static const int status_flagholdreinstreq = (1 << 8); |
58 | #define STATUS_FLAGMASK ~(STATUS_FLAGOK | STATUS_FLAGREINSTREQ | STATUS_FLAGHOLD | STATUS_FLAGHOLDREINSTREQ) | 58 | static const int status_flagmask = 480; |
59 | 59 | ||
60 | #define STATUS_STATUSSTART (9) | 60 | //static const int status_statusstart = 9; |
61 | #define STATUS_STATUSNOTINSTALLED (1 << 9) | 61 | //static const int status_statusnoninstalled = (1 << 9); /* 512 */ |
62 | #define STATUS_STATUSUNPACKED (1 << 10) | 62 | static const int status_statusunpacked = (1 << 10); |
63 | #define STATUS_STATUSHALFCONFIGURED (1 << 11) | 63 | static const int status_statushalfconfigured = (1 << 11); |
64 | #define STATUS_STATUSINSTALLED (1 << 12) | 64 | static const int status_statusinstalled = (1 << 12); |
65 | #define STATUS_STATUSHALFINSTALLED (1 << 13) | 65 | static const int status_statushalfinstalled = (1 << 13); |
66 | #define STATUS_STATUSCONFIGFILES (1 << 14) | 66 | //static const int status_statusconfigfiles = (1 << 14); |
67 | #define STATUS_STATUSPOSTINSTFAILED (1 << 15) | 67 | //static const int status_statuspostinstfailed = (1 << 15); |
68 | #define STATUS_STATUSREMOVALFAILED (1 << 16) | 68 | //static const int status_statusremovalfailed = (1 << 16); |
69 | #define STATUS_STATUSMASK ~(STATUS_STATUSNOTINSTALLED | STATUS_STATUSUNPACKED | STATUS_STATUSHALFCONFIGURED | STATUS_STATUSCONFIGFILES | STATUS_STATUSPOSTINSTFAILED | STATUS_STATUSREMOVALFAILED | STATUS_STATUSHALFINSTALLED) | 69 | static const int status_statusmask = 130560; /* i assume status_statusinstalled is supposed to be included */ |
70 | 70 | ||
71 | #define COLOR_WHITE 0 | 71 | static const char *statuswords[][10] = { |
72 | #define COLOR_GRAY 1 | 72 | { (char *) 0, "unknown", "install", "hold", "deinstall", "purge", 0 }, |
73 | #define COLOR_BLACK 2 | 73 | { (char *) 5, "ok", "reinstreq", "hold", "hold-reinstreq", 0 }, |
74 | { (char *) 9, "not-installed", "unpacked", "half-configured", | ||
75 | "installed", "half-installed", "config-files", | ||
76 | "post-inst-failed", "removal-failed", 0 } | ||
77 | }; | ||
78 | |||
79 | const int color_white = 0; | ||
80 | const int color_grey = 1; | ||
81 | const int color_black = 2; | ||
74 | 82 | ||
75 | /* data structures */ | 83 | /* data structures */ |
76 | struct package_t { | 84 | struct package_t { |
@@ -147,11 +155,11 @@ static void depends_sort_visit(struct package_t **ordered, | |||
147 | unsigned short i; | 155 | unsigned short i; |
148 | 156 | ||
149 | /* mark node as processing */ | 157 | /* mark node as processing */ |
150 | pkg->color = COLOR_GRAY; | 158 | pkg->color = color_grey; |
151 | 159 | ||
152 | /* visit each not-yet-visited node */ | 160 | /* visit each not-yet-visited node */ |
153 | for (i = 0; i < pkg->requiredcount; i++) | 161 | for (i = 0; i < pkg->requiredcount; i++) |
154 | if (pkg->requiredfor[i]->color == COLOR_WHITE) | 162 | if (pkg->requiredfor[i]->color == color_white) |
155 | depends_sort_visit(ordered, pkgs, pkg->requiredfor[i]); | 163 | depends_sort_visit(ordered, pkgs, pkg->requiredfor[i]); |
156 | 164 | ||
157 | #if 0 | 165 | #if 0 |
@@ -166,7 +174,7 @@ static void depends_sort_visit(struct package_t **ordered, | |||
166 | *ordered = pkg; | 174 | *ordered = pkg; |
167 | 175 | ||
168 | /* mark node as done */ | 176 | /* mark node as done */ |
169 | pkg->color = COLOR_BLACK; | 177 | pkg->color = color_black; |
170 | } | 178 | } |
171 | 179 | ||
172 | static struct package_t *depends_sort(struct package_t *pkgs) | 180 | static struct package_t *depends_sort(struct package_t *pkgs) |
@@ -177,10 +185,10 @@ static struct package_t *depends_sort(struct package_t *pkgs) | |||
177 | struct package_t *pkg; | 185 | struct package_t *pkg; |
178 | 186 | ||
179 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) | 187 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) |
180 | pkg->color = COLOR_WHITE; | 188 | pkg->color = color_white; |
181 | 189 | ||
182 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) | 190 | for (pkg = pkgs; pkg != 0; pkg = pkg->next) |
183 | if (pkg->color == COLOR_WHITE) | 191 | if (pkg->color == color_white) |
184 | depends_sort_visit(&ordered, pkgs, pkg); | 192 | depends_sort_visit(&ordered, pkgs, pkg); |
185 | 193 | ||
186 | /* Leaks the old list... return the new one... */ | 194 | /* Leaks the old list... return the new one... */ |
@@ -217,8 +225,8 @@ struct package_t *depends_resolve(struct package_t *pkgs, void *status) | |||
217 | dependpkg.package = dependsvec[i]; | 225 | dependpkg.package = dependsvec[i]; |
218 | if ((found = tfind(&dependpkg, &status, package_compare)) == 0 || | 226 | if ((found = tfind(&dependpkg, &status, package_compare)) == 0 || |
219 | ((chk = *(struct package_t **)found) && | 227 | ((chk = *(struct package_t **)found) && |
220 | (chk->status & (STATUS_FLAGOK | STATUS_STATUSINSTALLED)) != | 228 | (chk->status & (status_flagok | status_statusinstalled)) != |
221 | (STATUS_FLAGOK | STATUS_STATUSINSTALLED))) | 229 | (status_flagok | status_statusinstalled))) |
222 | { | 230 | { |
223 | /* if it fails, we look through the list of packages we are going to | 231 | /* if it fails, we look through the list of packages we are going to |
224 | * install */ | 232 | * install */ |
@@ -268,17 +276,6 @@ struct package_t *depends_resolve(struct package_t *pkgs, void *status) | |||
268 | * read using the status_read function is written back to the status file | 276 | * read using the status_read function is written back to the status file |
269 | */ | 277 | */ |
270 | 278 | ||
271 | static const char *statuswords[][10] = { | ||
272 | { (char *)STATUS_WANTSTART, "unknown", "install", "hold", | ||
273 | "deinstall", "purge", 0 }, | ||
274 | { (char *)STATUS_FLAGSTART, "ok", "reinstreq", "hold", | ||
275 | "hold-reinstreq", 0 }, | ||
276 | { (char *)STATUS_STATUSSTART, "not-installed", "unpacked", "half-configured", | ||
277 | "installed", "half-installed", | ||
278 | "config-files", "post-inst-failed", | ||
279 | "removal-failed", 0 } | ||
280 | }; | ||
281 | |||
282 | int package_compare(const void *p1, const void *p2) | 279 | int package_compare(const void *p1, const void *p2) |
283 | { | 280 | { |
284 | return strcmp(((struct package_t *)p1)->package, | 281 | return strcmp(((struct package_t *)p1)->package, |
@@ -596,7 +593,7 @@ static int dpkg_doconfigure(struct package_t *pkg) | |||
596 | char postinst[1024]; | 593 | char postinst[1024]; |
597 | char buf[1024]; | 594 | char buf[1024]; |
598 | DPRINTF("Configuring %s\n", pkg->package); | 595 | DPRINTF("Configuring %s\n", pkg->package); |
599 | pkg->status &= STATUS_STATUSMASK; | 596 | pkg->status &= status_statusmask; |
600 | snprintf(postinst, sizeof(postinst), "%s%s.postinst", INFODIR, pkg->package); | 597 | snprintf(postinst, sizeof(postinst), "%s%s.postinst", INFODIR, pkg->package); |
601 | if (is_file(postinst)) | 598 | if (is_file(postinst)) |
602 | { | 599 | { |
@@ -604,12 +601,12 @@ static int dpkg_doconfigure(struct package_t *pkg) | |||
604 | if ((r = do_system(buf)) != 0) | 601 | if ((r = do_system(buf)) != 0) |
605 | { | 602 | { |
606 | fprintf(stderr, "postinst exited with status %d\n", r); | 603 | fprintf(stderr, "postinst exited with status %d\n", r); |
607 | pkg->status |= STATUS_STATUSHALFCONFIGURED; | 604 | pkg->status |= status_statushalfconfigured; |
608 | return 1; | 605 | return 1; |
609 | } | 606 | } |
610 | } | 607 | } |
611 | 608 | ||
612 | pkg->status |= STATUS_STATUSINSTALLED; | 609 | pkg->status |= status_statusinstalled; |
613 | 610 | ||
614 | return 0; | 611 | return 0; |
615 | } | 612 | } |
@@ -690,15 +687,15 @@ static int dpkg_dounpack(struct package_t *pkg) | |||
690 | fclose(outfp); | 687 | fclose(outfp); |
691 | } | 688 | } |
692 | } | 689 | } |
693 | pkg->status &= STATUS_WANTMASK; | 690 | pkg->status &= status_wantmask; |
694 | pkg->status |= STATUS_WANTINSTALL; | 691 | pkg->status |= status_wantinstall; |
695 | pkg->status &= STATUS_FLAGMASK; | 692 | pkg->status &= status_flagmask; |
696 | pkg->status |= STATUS_FLAGOK; | 693 | pkg->status |= status_flagok; |
697 | pkg->status &= STATUS_STATUSMASK; | 694 | pkg->status &= status_statusmask; |
698 | if (r == 0) | 695 | if (r == 0) |
699 | pkg->status |= STATUS_STATUSUNPACKED; | 696 | pkg->status |= status_statusunpacked; |
700 | else | 697 | else |
701 | pkg->status |= STATUS_STATUSHALFINSTALLED; | 698 | pkg->status |= status_statushalfinstalled; |
702 | } | 699 | } |
703 | chdir(cwd); | 700 | chdir(cwd); |
704 | return r; | 701 | return r; |
@@ -824,14 +821,14 @@ static int dpkg_install(struct package_t *pkgs) | |||
824 | /* Stage 3: install */ | 821 | /* Stage 3: install */ |
825 | for (p = ordered; p != 0; p = p->next) | 822 | for (p = ordered; p != 0; p = p->next) |
826 | { | 823 | { |
827 | p->status &= STATUS_WANTMASK; | 824 | p->status &= status_wantmask; |
828 | p->status |= STATUS_WANTINSTALL; | 825 | p->status |= status_wantinstall; |
829 | 826 | ||
830 | /* for now the flag is always set to ok... this is probably | 827 | /* for now the flag is always set to ok... this is probably |
831 | * not what we want | 828 | * not what we want |
832 | */ | 829 | */ |
833 | p->status &= STATUS_FLAGMASK; | 830 | p->status &= status_flagmask; |
834 | p->status |= STATUS_FLAGOK; | 831 | p->status |= status_flagok; |
835 | 832 | ||
836 | if (dpkg_doinstall(p) != 0) | 833 | if (dpkg_doinstall(p) != 0) |
837 | { | 834 | { |