The following commit has been merged in the master branch:
commit 4b9da2295656cd63e04a4fcc707a575b1f5cd88b
Author: Guillem Jover <[email protected]>
Date: Fri Feb 27 05:19:55 2009 +0200
libdpkg: Generalize f_boolean by not hardcoding to the essential member
Fix the function to use PKGPFIELD to assign to the correct struct
member instead of directly assigning to the essential member. This also
makes this function match its write counterpart w_booleandefno's generic
behaviour.
diff --git a/ChangeLog b/ChangeLog
index 6e56018..f29e33d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-02-27 Guillem Jover <[email protected]>
+ * lib/fields.c (f_boolean): Use PKGPFIELD to assign to the correct
+ member instead of hardcoding to the essential member.
+
+2009-02-27 Guillem Jover <[email protected]>
+
* lib/fields.c (f_boolean): Return if value is an empty string.
2009-02-26 Chris Coulson <[email protected]>,
diff --git a/lib/fields.c b/lib/fields.c
index ce2b048..0d32d27 100644
--- a/lib/fields.c
+++ b/lib/fields.c
@@ -130,10 +130,14 @@ void f_boolean(struct pkginfo *pigp, struct
pkginfoperfile *pifp,
enum parsedbflags flags,
const char *filename, int lno, FILE *warnto, int *warncount,
const char *value, const struct fieldinfo *fip) {
+ int boolean;
+
if (!*value)
return;
- pifp->essential = convert_string(filename, lno, _("yes/no in boolean field"),
- -1, pigp, value, booleaninfos, NULL);
+
+ boolean = convert_string(filename, lno, _("yes/no in boolean field"),
+ -1, pigp, value, booleaninfos, NULL);
+ PKGPFIELD(pifp, fip->integer, int) = boolean;
}
void f_section(struct pkginfo *pigp, struct pkginfoperfile *pifp,
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]