2 * FreeBSD install - a package for the installation and maintenance
3 * of non-core utilities.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
17 * $FreeBSD: src/usr.sbin/pkg_install/lib/version.c,v 1.1.2.3 2002/08/20 06:35:08 obrien Exp $
18 * $DragonFly: src/usr.sbin/pkg_install/lib/Attic/version.c,v 1.2 2003/06/17 04:29:59 dillon Exp $
25 * Routines to assist with PLIST_FMT_VER numbers in the packing
28 * Following is the PLIST_FMT_VER history:
29 * 1.0 - Initial revision;
30 * 1.1 - When recording/checking checksum of symlink use hash of readlink()
31 * value instead of the hash of an object this links points to.
35 verscmp(Package *pkg, int major, int minor)
39 if ((pkg->fmtver_maj < major) || (pkg->fmtver_maj == major &&
40 pkg->fmtver_mnr < minor))
42 else if ((pkg->fmtver_maj > major) || (pkg->fmtver_maj == major &&
43 pkg->fmtver_mnr > minor))