Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2018 16:21:32 +0000 (UTC)
From:      "Jason W. Bacon" <jwb@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r467487 - in head/sysutils: . filevercmp filevercmp/files
Message-ID:  <201804161621.w3GGLWS9098059@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jwb
Date: Mon Apr 16 16:21:31 2018
New Revision: 467487
URL: https://svnweb.freebsd.org/changeset/ports/467487

Log:
  sysutils/filevercmp: Compare version strings as in sort --version-sort
  
  Approved by:    jrm (mentor)
  Differential Revision:  https://reviews.freebsd.org/D15098

Added:
  head/sysutils/filevercmp/
  head/sysutils/filevercmp/Makefile   (contents, props changed)
  head/sysutils/filevercmp/distinfo   (contents, props changed)
  head/sysutils/filevercmp/files/
  head/sysutils/filevercmp/files/Makefile   (contents, props changed)
  head/sysutils/filevercmp/pkg-descr   (contents, props changed)
Modified:
  head/sysutils/Makefile

Modified: head/sysutils/Makefile
==============================================================================
--- head/sysutils/Makefile	Mon Apr 16 16:14:59 2018	(r467486)
+++ head/sysutils/Makefile	Mon Apr 16 16:21:31 2018	(r467487)
@@ -323,6 +323,7 @@
     SUBDIR += fileprune
     SUBDIR += fileschanged
     SUBDIR += filetype
+    SUBDIR += filevercmp
     SUBDIR += filewatcherd
     SUBDIR += finfo
     SUBDIR += firstboot-freebsd-update

Added: head/sysutils/filevercmp/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/filevercmp/Makefile	Mon Apr 16 16:21:31 2018	(r467487)
@@ -0,0 +1,20 @@
+# $FreeBSD$
+
+PORTNAME=	filevercmp
+DISTVERSION=	g20151117
+CATEGORIES=	sysutils
+
+MAINTAINER=	jwb@FreeBSD.org
+COMMENT=	Compare version strings as in sort --version-sort
+
+LICENSE=	GPLv3
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	ekg
+GH_TAGNAME=	cccb6ba1fffa2898718b0a96c63279e0979e002b
+
+MAKEFILE=	${FILESDIR}/Makefile
+INSTALL_TARGET=	install-strip
+PLIST_FILES=	bin/filevercmp include/filevercmp.h lib/libfilevercmp.a
+
+.include <bsd.port.mk>

Added: head/sysutils/filevercmp/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/filevercmp/distinfo	Mon Apr 16 16:21:31 2018	(r467487)
@@ -0,0 +1,3 @@
+TIMESTAMP = 1523600860
+SHA256 (ekg-filevercmp-g20151117-cccb6ba1fffa2898718b0a96c63279e0979e002b_GH0.tar.gz) = de0b23cd95bb121a6ec774cdbd54e1fbabe4e1cc00211997d7ecc2b5a9d102c5
+SIZE (ekg-filevercmp-g20151117-cccb6ba1fffa2898718b0a96c63279e0979e002b_GH0.tar.gz) = 3105

Added: head/sysutils/filevercmp/files/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/filevercmp/files/Makefile	Mon Apr 16 16:21:31 2018	(r467487)
@@ -0,0 +1,52 @@
+
+# Use ?= to allow overriding from the env or command-line, e.g.
+#
+#       make CXXFLAGS="-O3 -fPIC" install
+#
+# Package managers will override many of these variables automatically, so
+# this is aimed at making it easy to create packages (Debian packages,
+# FreeBSD ports, MacPorts, pkgsrc, etc.)
+
+CC ?=		cc
+CFLAGS ?=	-O -g
+AR ?=		ar
+MKDIR ?=	mkdir
+INSTALL ?=	install -c
+STRIP ?=	strip
+DESTDIR ?=	stage
+PREFIX ?=	/usr/local
+
+OBJS=	filevercmp.o
+MAIN =	main.o
+BIN =	filevercmp
+LIB =	libfilevercmp.a
+
+all: ${BIN} ${LIB}
+
+${BIN}: ${OBJS} ${MAIN}
+	${CC} ${CFLAGS} -o ${BIN} ${OBJS} ${MAIN}
+
+${LIB}: ${OBJS}
+	${AR} -rs ${LIB} ${OBJS}
+
+install: all
+	${MKDIR} -p ${DESTDIR}${PREFIX}/bin
+	${MKDIR} -p ${DESTDIR}${PREFIX}/include
+	${MKDIR} -p ${DESTDIR}${PREFIX}/lib
+	${INSTALL} ${BIN} ${DESTDIR}${PREFIX}/bin
+	${INSTALL} *.h ${DESTDIR}${PREFIX}/include
+	${INSTALL} ${LIB} ${DESTDIR}${PREFIX}/lib
+
+install-strip: install
+	${STRIP} ${DESTDIR}${PREFIX}/bin/${BIN}
+
+clean:
+	rm -rf ${BIN} ${LIB} ${OBJS} ${MAIN} ${DESTDIR}
+
+.PHONY: all clean
+
+filevercmp.o: filevercmp.c filevercmp.h
+	${CC} ${CFLAGS} -c filevercmp.c
+
+main.o: main.c filevercmp.h
+	${CC} ${CFLAGS} -c main.c

Added: head/sysutils/filevercmp/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/filevercmp/pkg-descr	Mon Apr 16 16:21:31 2018	(r467487)
@@ -0,0 +1,16 @@
+Compare version strings:
+
+This function compares strings S1 and S2:
+
+    By PREFIX in the same way as strcmp.
+
+    Then by VERSION (most similarly to version compare of Debian's dpkg).
+    Leading zeros in version numbers are ignored.
+
+    If both (PREFIX and VERSION) are equal, strcmp function is used for
+    comparison. So this function can return 0 if (and only if) strings S1 and
+    S2 are identical.
+
+It returns number >0 for S1 > S2, 0 for S1 == S2 and number <0 for S1 < S2.
+
+WWW: https://github.com/ekg/filevercmp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804161621.w3GGLWS9098059>