summaryrefslogtreecommitdiff
path: root/src/ver.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-05-07 08:51:02 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2012-05-07 08:51:02 +0200
commit9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046 (patch)
tree3b56caf8d0b3e50d4b72f057c5ab02d61d2357c6 /src/ver.c
parentc9a43a14697fa955f31e495a8b03a523975ad285 (diff)
downloadapk-tools-9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046.tar.gz
apk-tools-9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046.tar.bz2
apk-tools-9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046.tar.xz
apk-tools-9154b8b5e44859ce0a1fd0ba292b26bf8dc8d046.zip
ver: print '?' when package is not available in any repo
This makes it possible to differ between downgradable packages (-l '<') and unavailable in repos (-l '?').
Diffstat (limited to 'src/ver.c')
-rw-r--r--src/ver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ver.c b/src/ver.c
index 4bfd607..90b6cd6 100644
--- a/src/ver.c
+++ b/src/ver.c
@@ -125,7 +125,8 @@ static void ver_print_package_status(struct ver_ctx *ictx, struct apk_database *
break;
}
}
- r = apk_version_compare_blob(*pkg->version, *latest);
+ r = latest->len ? apk_version_compare_blob(*pkg->version, *latest)
+ : APK_VERSION_UNKNOWN;
opstr = apk_version_op_string(r);
if ((ictx->limchars != NULL) && (strchr(ictx->limchars, *opstr) == NULL))
return;