sys: packagelist: drop ABI version from package name
Having the ABI version appended to the package name is not very helpful when checking for updated versions of a package online or requesting a new image for the device from an updater service. In both cases, the ABI version could have been bumped meanwhile and that name is then simply not found. Resolve this by removing the appended ABI version in the output of the rpc-sys packagelist call. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
d3f2041f43
commit
ccb75178cf
1 changed files with 12 additions and 0 deletions
12
sys.c
12
sys.c
|
@ -228,6 +228,18 @@ procstr:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If there is ABIVersion, remove that suffix */
|
||||||
|
if (!strcmp(var, "ABIVersion:")) {
|
||||||
|
if (strlen(pkg) <= strlen(p1))
|
||||||
|
continue;
|
||||||
|
tmp = &pkg[strlen(pkg) - strlen(p1)];
|
||||||
|
if (strncmp(p1, tmp, strlen(p1)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
*tmp = '\0';
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!strcmp(var, "Version:")) {
|
if (!strcmp(var, "Version:")) {
|
||||||
strncpy(ver, p1, sizeof(ver));
|
strncpy(ver, p1, sizeof(ver));
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue