Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
When upgrading a pkg, test for the direction the version number is changing in.
Matthew Seaman committed 12 years ago
commit fd26742c26da990129de9ed8ef2aec00f8a4312b
parent e232d60
2 files changed +11 -0
modified libpkg/pkg.h.in
@@ -1179,6 +1179,7 @@ const char *pkg_config_name(struct pkg_config *c);
 */
int pkg_version_cmp(const char * const , const char * const);
int pkg_vcmp(struct pkg *, struct pkg *);
+
int pkg_version_change(const struct pkg * restrict);

/**
 * Fetch a file.
modified libpkg/pkg_version.c
@@ -345,3 +345,13 @@ pkg_vcmp(struct pkg *p1, struct pkg *p2)

	return (pkg_version_cmp(version1, version2));
}
+

+
int
+
pkg_version_change(const struct pkg * restrict pkg)
+
{
+
	const char *version, *oldversion;
+

+
	pkg_get(pkg, PKG_VERSION, &version,
+
	    PKG_OLD_VERSION, &oldversion);
+
	return (pkg_version_cmp(oldversion, version));
+
}