Bug 92146 - [NEW PORT] misc/newer: An implementation of AT&T Research UNIX V8 newer(1)
Summary: [NEW PORT] misc/newer: An implementation of AT&T Research UNIX V8 newer(1)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-22 10:20 UTC by Jeffrey H. Johnson
Modified: 2006-01-23 07:11 UTC (History)
1 user (show)

See Also:


Attachments
newer-1.0.shar (2.42 KB, text/plain)
2006-01-22 10:20 UTC, Jeffrey H. Johnson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeffrey H. Johnson 2006-01-22 10:20:03 UTC
In porting at least one old shell script, newer was expected.

-x-

> There doesn't appear to be any decent way to compare the last modified
> times of files from the shell...

Before everybody starts inventing their own names for this, it should be
noted that V8 already has a program for this, newer(1).  It takes two
filenames as arguments, and exits with status 0 if and only if either
(a) the first exists and the second does not, or (b) both exist and the
first's modification time is at least as recent as the second's.  Other-
wise it exits with non-zero status.  (The preceding two sentences are
essentially the whole of the manual page for it.)
 
Relatively few people have V8, but in the absence of any other precedent
for what this facility should look like, it seems reasonable to follow
V8's lead:

newer file1 file2

exit with 0 status if file1 exists and file2 does not, or if file1's last
modified time is at least as recent as file2's.

-x-

Generated with FreeBSD Port Tools 0.63
Comment 1 Sergey Matveychuk freebsd_committer freebsd_triage 2006-01-22 18:56:42 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What is a difference the utility to system newer(1)?

- --
Dixi.
Sem.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD09VqTclL2LcfYF0RAjRzAKCw3PNQLDln4K68cOB/mReM1fyAXgCfS4EY
I4awuLDyd7g8DfimaYXx+PU=
=GHBq
-----END PGP SIGNATURE-----
Comment 2 trnsz 2006-01-22 19:05:44 UTC
On January 22, 2006 9:56 PM +0300 Sergey Matveychuk <sem@FreeBSD.org> wrote:

> What is a difference the utility to system newer(1)?

System newer(1)?!  

I don't have that on my machine here.  Is it part of some other port,
or is still in 6?  It's not in bin, usr.bin or usr.sbin at least...

If it is part of another port, we should note that, and add a CONFLICT.

If I'm totally off-base here, I apologize in advance.

--
Jeffrey H. Johnson
CPE1704TKS@bellsouth.net
Comment 3 trnsz 2006-01-22 19:40:08 UTC
On January 22, 2006 2:05 PM "Jeffrey H. Johnson" wrote:
> On January 22, 2006 9:56 PM Sergey Matveychuk <sem@FreeBSD.org> wrote:
>> What is a difference the utility to system newer(1)?
> System newer(1)?!  

An update on this:

/usr/local/bin/newer was installed by package teTeX-base-3.0_6

I guess a CONFLICT is in order then?

--
Jeffrey H. Johnson
trnsz@bellsouth.net
Comment 4 Jeffrey H. Johnson 2006-01-22 19:55:59 UTC
Sorry:

CONFLICTS=      teTeX-base-[0-9]*

is in order here.

--
Jeffrey H. Johnson
CPE1704TKS@bellsouth.net
Comment 5 Jeffrey H. Johnson 2006-01-22 20:27:40 UTC
He it is, with proper CONFLICTS, sorry for the mess:

--- newer-1.0_1.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	newer
#	newer/Makefile
#	newer/distinfo
#	newer/pkg-descr
#
echo c - newer
mkdir -p newer > /dev/null 2>&1
echo x - newer/Makefile
sed 's/^X//' >newer/Makefile << 'END-of-newer/Makefile'
X# New ports collection makefile for:    newer
X# Date created:         22 January 2006
X# Whom:                 Jeffrey H. Johnson <CPE1704TKS@bellsouth.net>
X#
X# $FreeBSD: ports/misc/newer/Makefile,v 1.01 2006/01/22 15:28:42 trn Exp $
X#
X
XPORTNAME=	newer
XPORTVERSION=	1.0
XPORTREVISION=	1
XCATEGORIES=	misc
XMASTER_SITES=	ftp://ftp.cwru.edu/pub/chet/
XDISTFILES=	newer.c
X
XMAINTAINER=	CPE1704TKS@bellsouth.net
XCOMMENT=	An implementation of AT&T Research UNIX V8 newer(1)
X
XEXTRACT_ONLY=
X
XCONFLICTS=	teTeX-base-[0-9]*
X
XPLIST_FILES=	bin/newer
XNO_EXTRACT=	yes
X
Xdo-build:
X	${CP} ${DISTDIR}/newer.c ${WRKDIR}/newer.c
X	${CC} ${CFLAGS} -o ${WRKDIR}/newer ${WRKDIR}/newer.c
X
Xdo-install:
X	${INSTALL_PROGRAM} ${WRKDIR}/newer ${PREFIX}/bin
X
X.include <bsd.port.mk>
END-of-newer/Makefile
echo x - newer/distinfo
sed 's/^X//' >newer/distinfo << 'END-of-newer/distinfo'
XMD5 (newer.c) = b21df1d77cfa2a7559d2e9cd6e0ca841
XSHA256 (newer.c) =
42117fa1b4fe735742bc5be1e73e80cffb041ae264290432ae5dc7faa292d0d4
XSIZE (newer.c) =  1539
END-of-newer/distinfo
echo x - newer/pkg-descr
sed 's/^X//' >newer/pkg-descr << 'END-of-newer/pkg-descr'
X> There doesn't appear to be any decent way to compare the last modified
X> times of files from the shell...
X
XBefore everybody starts inventing their own names for this, it should be
Xnoted that V8 already has a program for this, newer(1).  It takes two
Xfilenames as arguments, and exits with status 0 if and only if either
X(a) the first exists and the second does not, or (b) both exist and the
Xfirst's modification time is at least as recent as the second's.  Other-
Xwise it exits with non-zero status.  (The preceding two sentences are
Xessentially the whole of the manual page for it.)
X 
XRelatively few people have V8, but in the absence of any other precedent
Xfor what this facility should like look, it seems reasonable to follow
XV8's lead:
X
Xnewer file1 file2
X
Xexit with 0 status if file1 exists and file2 does not, or if file1's last
Xmodified time is at least as recent as file2's.
END-of-newer/pkg-descr
exit
--- newer-1.0_1.shar ends here ---

--
Jeffrey H. Johnson
CPE1704TKS@bellsouth.net
Comment 6 Sergey Matveychuk freebsd_committer freebsd_triage 2006-01-23 06:20:37 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeffrey H. Johnson wrote:
> On January 22, 2006 9:56 PM +0300 Sergey Matveychuk <sem@FreeBSD.org> wrote:
> 
> 
>>What is a difference the utility to system newer(1)?
> 
> 
> System newer(1)?!  
> 
> I don't have that on my machine here.  Is it part of some other port,
> or is still in 6?  It's not in bin, usr.bin or usr.sbin at least...
> 
> If it is part of another port, we should note that, and add a CONFLICT.
> 
> If I'm totally off-base here, I apologize in advance.

You're right. I've just done 'man newer' and thought it was a system one.

- --
Sem.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD1HW1TclL2LcfYF0RAmQlAKCXNX+pkcj9n+CLk7+RlhEO7mkWFgCgyd1T
maAq0vVltJmjnL5k39XBqT8=
=Q83L
-----END PGP SIGNATURE-----
Comment 7 Sergey Matveychuk freebsd_committer freebsd_triage 2006-01-23 07:11:03 UTC
State Changed
From-To: open->closed

New port added. Thanks!