diff options
author | Florian Mayer <fmayer@google.com> | 2019-03-05 17:03:10 +0000 |
---|---|---|
committer | Florian Mayer <fmayer@google.com> | 2019-03-19 17:04:46 +0000 |
commit | bda40419126fe3ab966abf1cd696a47c96e3cd4a (patch) | |
tree | ea2d3577e5eaa5ecd93fa31e106e52660cdac72c /libpackagelistparser/packagelistparser.c | |
parent | d5345f58fdb11f9f362b00bbfd9d7b19ca659fcc (diff) | |
download | system_core-bda40419126fe3ab966abf1cd696a47c96e3cd4a.tar.gz system_core-bda40419126fe3ab966abf1cd696a47c96e3cd4a.tar.bz2 system_core-bda40419126fe3ab966abf1cd696a47c96e3cd4a.zip |
Add versionCode parser for package list.
Bug: 123186697
Change-Id: I9194cc55abd943c4b8b2f9d29dcad035170f2736
Diffstat (limited to 'libpackagelistparser/packagelistparser.c')
-rw-r--r-- | libpackagelistparser/packagelistparser.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libpackagelistparser/packagelistparser.c b/libpackagelistparser/packagelistparser.c index 4ce2363df..edc533cbf 100644 --- a/libpackagelistparser/packagelistparser.c +++ b/libpackagelistparser/packagelistparser.c @@ -239,6 +239,15 @@ extern bool packagelist_parse(pfn_on_package callback, void *userdata) pkg_info->profileable_from_shell = (bool)tmp; } + cur = strsep(&next, " \t\r\n"); + if (cur) { + tmp = strtoul(cur, &endptr, 10); + if (*endptr != '\0') { + errmsg = "Could not convert field \"versionCode\" to integer value"; + goto err; + } + pkg_info->version_code = tmp; + } rc = callback(pkg_info, userdata); if (rc == false) { |