From: Brian Harring Date: Sat, 24 Sep 2005 18:51:48 +0000 (-0000) Subject: update so that int 0 is stored (change to the logic test for storing null vals) X-Git-Tag: v2.0.53_rc4_2111~58 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d2ccf4135a8ae3e326804b7fc0167e0b51bb59b3;p=portage.git update so that int 0 is stored (change to the logic test for storing null vals) svn path=/main/branches/2.0/; revision=2024 --- diff --git a/pym/portage_db_flat_hash.py b/pym/portage_db_flat_hash.py index 8ee7661ff..44ed59da6 100644 --- a/pym/portage_db_flat_hash.py +++ b/pym/portage_db_flat_hash.py @@ -24,14 +24,14 @@ class database(portage_db_flat.database): mydict = {} for x in self.dbkeys: - mydict[x] = data.get(x, "") + mydict[x] = str(data.get(x, "")) mydict["_mtime_"] = long(data["_mtime_"]) return mydict def set_values(self, key, values): l = [] for x in values.keys(): - if values[x] and x != "_mtime_": + if values[x] not in (None, '') and x != "_mtime_": l.append("%s=%s\n" % (x, values[x])) l.append(values["_mtime_"]) portage_db_flat.database.set_values(self, key, l, raw=True)