summaryrefslogtreecommitdiff
path: root/meta/packages/opkg/opkg/add_vercmp.patch
blob: 540be839508e0bd67db6d5753f0a949a95e941bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Index: trunk/libopkg/opkg.c
===================================================================
--- trunk.orig/libopkg/opkg.c	2010-01-26 20:32:19.000000000 +0000
+++ trunk/libopkg/opkg.c	2010-01-26 20:40:34.000000000 +0000
@@ -876,3 +876,18 @@
 
 	return ret;
 }
+
+int
+opkg_compare_versions (const char *ver1, const char *ver2)
+{
+  pkg_t *pkg1, *pkg2;
+
+  pkg1 = pkg_new();
+  pkg2 = pkg_new();
+
+  parse_version(pkg1, ver1);
+  parse_version(pkg2, ver2);
+
+  return pkg_compare_versions(pkg1, pkg2);
+}
+
Index: trunk/libopkg/opkg.h
===================================================================
--- trunk.orig/libopkg/opkg.h	2010-01-26 20:32:19.000000000 +0000
+++ trunk/libopkg/opkg.h	2010-01-26 20:35:19.000000000 +0000
@@ -58,4 +58,6 @@
 
 int opkg_repository_accessibility_check(void);
 
+int opkg_compare_versions (const char *ver1, const char *ver2);
+
 #endif /* OPKG_H */