Deleted Added
full compact
version.c (98766) version.c (101677)
1/*
1/*
2 * FreeBSD install - a package for the installation and maintainance
2 * FreeBSD install - a package for the installation and maintenance
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
13 *
14 * Maxim Sobolev
15 * 31 July 2001
16 *
17 */
18
19#include <sys/cdefs.h>
3 * of non-core utilities.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
13 *
14 * Maxim Sobolev
15 * 31 July 2001
16 *
17 */
18
19#include <sys/cdefs.h>
20__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/version.c 98766 2002-06-24 16:03:24Z markm $");
20__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/version.c 101677 2002-08-11 13:05:30Z schweikh $");
21
22#include "lib.h"
23#include <err.h>
24
25/*
26 * Routines to assist with PLIST_FMT_VER numbers in the packing
27 * lists.
28 *
29 * Following is the PLIST_FMT_VER history:
30 * 1.0 - Initial revision;
31 * 1.1 - When recording/checking checksum of symlink use hash of readlink()
21
22#include "lib.h"
23#include <err.h>
24
25/*
26 * Routines to assist with PLIST_FMT_VER numbers in the packing
27 * lists.
28 *
29 * Following is the PLIST_FMT_VER history:
30 * 1.0 - Initial revision;
31 * 1.1 - When recording/checking checksum of symlink use hash of readlink()
32 * value insted of the hash of an object this links points to.
32 * value instead of the hash of an object this links points to.
33 *
34 */
35int
36verscmp(Package *pkg, int major, int minor)
37{
38 int rval = 0;
39
40 if ((pkg->fmtver_maj < major) || (pkg->fmtver_maj == major &&

--- 36 unchanged lines hidden (view full) ---

77 return pkgname;
78 else
79 return &ch[1];
80}
81
82/*
83 * version_cmp(pkg1, pkg2) returns -1, 0 or 1 depending on if the version
84 * components of pkg1 is less than, equal to or greater than pkg2. No
33 *
34 */
35int
36verscmp(Package *pkg, int major, int minor)
37{
38 int rval = 0;
39
40 if ((pkg->fmtver_maj < major) || (pkg->fmtver_maj == major &&

--- 36 unchanged lines hidden (view full) ---

77 return pkgname;
78 else
79 return &ch[1];
80}
81
82/*
83 * version_cmp(pkg1, pkg2) returns -1, 0 or 1 depending on if the version
84 * components of pkg1 is less than, equal to or greater than pkg2. No
85 * comparision of the basenames is done.
85 * comparison of the basenames is done.
86 *
86 *
87 * The port verison is defined by:
87 * The port version is defined by:
88 * ${PORTVERSION}[_${PORTREVISION}][,${PORTEPOCH}]
88 * ${PORTVERSION}[_${PORTREVISION}][,${PORTEPOCH}]
89 * ${PORTEPOCH} supercedes ${PORTVERSION} supercedes ${PORTREVISION}.
89 * ${PORTEPOCH} supersedes ${PORTVERSION} supersedes ${PORTREVISION}.
90 * See the commit log for revision 1.349 of ports/Mk/bsd.port.mk
91 * for more information.
92 *
93 * The epoch and revision are defined to be a single number, while the rest
94 * of the version should conform to the porting guidelines. It can contain
90 * See the commit log for revision 1.349 of ports/Mk/bsd.port.mk
91 * for more information.
92 *
93 * The epoch and revision are defined to be a single number, while the rest
94 * of the version should conform to the porting guidelines. It can contain
95 * multiple components, seperated by a period, including letters.
95 * multiple components, separated by a period, including letters.
96 *
97 * The tests below allow for significantly more latitude in the version
98 * numbers than is allowed in the guidelines. No point in wasting user's
99 * time enforcing them here. That's what flamewars are for.
100 *
101 * Jeremy D. Lea.
102 */
103int

--- 68 unchanged lines hidden ---
96 *
97 * The tests below allow for significantly more latitude in the version
98 * numbers than is allowed in the guidelines. No point in wasting user's
99 * time enforcing them here. That's what flamewars are for.
100 *
101 * Jeremy D. Lea.
102 */
103int

--- 68 unchanged lines hidden ---