summaryrefslogtreecommitdiff
path: root/src/version.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-04-16 17:05:27 +0300
committerTimo Teras <timo.teras@iki.fi>2009-04-16 17:05:27 +0300
commitec5b63c5e4d719e07c48b0de0dc0b9f3b25d2cf8 (patch)
tree12885a6778a0a746fc0ff62b0be4b75f368cebc9 /src/version.c
parent968dfbb8b376de2dc6f2441dc3966d1416ad0046 (diff)
downloadapk-tools-ec5b63c5e4d719e07c48b0de0dc0b9f3b25d2cf8.tar.gz
apk-tools-ec5b63c5e4d719e07c48b0de0dc0b9f3b25d2cf8.tar.bz2
apk-tools-ec5b63c5e4d719e07c48b0de0dc0b9f3b25d2cf8.tar.xz
apk-tools-ec5b63c5e4d719e07c48b0de0dc0b9f3b25d2cf8.zip
pkg: clean up writing of dependencies
Diffstat (limited to 'src/version.c')
-rw-r--r--src/version.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/version.c b/src/version.c
index 45a9ede..57437aa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -128,6 +128,24 @@ static int get_token(int *type, apk_blob_t *blob)
return v;
}
+const char *apk_version_op_string(int mask)
+{
+ switch (mask) {
+ case APK_VERSION_LESS:
+ return "<";
+ case APK_VERSION_LESS|APK_VERSION_EQUAL:
+ return "<=";
+ case APK_VERSION_EQUAL:
+ return "=";
+ case APK_VERSION_GREATER|APK_VERSION_EQUAL:
+ return ">=";
+ case APK_VERSION_GREATER:
+ return ">";
+ default:
+ return "?";
+ }
+}
+
int apk_version_validate(apk_blob_t ver)
{
int t = TOKEN_DIGIT;