[hackers] [9base] added mtime, next version will be 5 || anselm

From: <hg_AT_suckless.org>
Date: Mon, 22 Mar 2010 08:04:42 +0000 (UTC)

changeset: 50:f46cbd1821d1
tag: tip
user: anselm_AT_garbe.us
date: Mon Mar 22 08:04:31 2010 +0000
files: Makefile config.mk mtime/Makefile mtime/mtime mtime/mtime.c
description:
added mtime, next version will be 5

diff -r 14d0900be889 -r f46cbd1821d1 Makefile
--- a/Makefile Thu Oct 15 16:35:28 2009 -0400
+++ b/Makefile Mon Mar 22 08:04:31 2010 +0000
@@ -3,7 +3,7 @@
 include config.mk
 
 SUBDIRS = lib9 yacc awk basename bc cal cat cleanname date dc du echo grep hoc ls \
- mk rc read sed seq sleep sort tee test touch tr troff uniq
+ mk mtime rc read sed seq sleep sort tee test touch tr troff uniq
 
 all:
         @echo 9base build options:
diff -r 14d0900be889 -r f46cbd1821d1 config.mk
--- a/config.mk Thu Oct 15 16:35:28 2009 -0400
+++ b/config.mk Mon Mar 22 08:04:31 2010 +0000
@@ -4,10 +4,10 @@
 PREFIX = /usr/local/plan9
 MANPREFIX = ${PREFIX}/share/man
 
-VERSION = 4
-#OBJTYPE = 386
+VERSION = 5
+OBJTYPE = 386
 #OBJTYPE = arm
-OBJTYPE = x86_64
+#OBJTYPE = x86_64
 
 # Linux/BSD
 #CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -c -I. -DPREFIX="\"${PREFIX}\""
diff -r 14d0900be889 -r f46cbd1821d1 mtime/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mtime/Makefile Mon Mar 22 08:04:31 2010 +0000
@@ -0,0 +1,11 @@
+# mtime - unix port from plan9
+#
+# Depends on ../lib9
+
+TARG = mtime
+
+include ../std.mk
+
+pre-uninstall:
+
+post-install:
diff -r 14d0900be889 -r f46cbd1821d1 mtime/mtime
Binary file mtime/mtime has changed
diff -r 14d0900be889 -r f46cbd1821d1 mtime/mtime.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mtime/mtime.c Mon Mar 22 08:04:31 2010 +0000
@@ -0,0 +1,33 @@
+#include <u.h>
+#include <libc.h>
+
+void
+usage(void)
+{
+ fprint(2, "usage: mtime file...\n");
+ exits("usage");
+}
+
+void
+main(int argc, char **argv)
+{
+ int errors, i;
+ Dir *d;
+
+ ARGBEGIN{
+ default:
+ usage();
+ }ARGEND
+
+ errors = 0;
+ for(i=0; i<argc; i++){
+ if((d = dirstat(argv[i])) == nil){
+ fprint(2, "stat %s: %r\n", argv[i]);
+ errors = 1;
+ }else{
+ print("%11lud %s\n", d->mtime, argv[i]);
+ free(d);
+ }
+ }
+ exits(errors ? "errors" : nil);
+}
Received on Mon Mar 22 2010 - 08:04:42 UTC

This archive was generated by hypermail 2.2.0 : Mon Mar 22 2010 - 08:12:06 UTC