Browse Source

added dog, a buffering replacement for cat

early
Nagy Karoly Gabriel 17 years ago
parent
commit
8392c0dce1
  1. 50
      textproc/dog/64bit-goodness.diff
  2. 70
      textproc/dog/check-ctime.patch
  3. 21
      textproc/dog/dog.cache
  4. 16
      textproc/dog/dog.conf
  5. 86
      textproc/dog/dog.copy
  6. 34
      textproc/dog/dog.desc
  7. 34
      textproc/dog/manpage-touchup.patch

50
textproc/dog/64bit-goodness.diff

@ -0,0 +1,50 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../dog/64bit-goodness.diff
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
diff -ur dog-1.7/dog.c dog-1.7-64bit/dog.c
This patch comes from Gentoo, author is the Gentoo maintainer of dog
--- dog-1.7/dog.c 2000-06-21 18:04:43.000000000 +0200
+++ dog-1.7-64bit/dog.c 2005-05-23 10:40:58.613766328 +0200
@@ -38,22 +38,13 @@
#include <limits.h>
#include <netdb.h>
-// this is fun
-#if defined(__alpha)
-#define uint16 unsigned short
-#define int16 short
-#define uint32 unsigned int
-#define int32 int
-#define uint64 unsigned long
-#define int64 long
-#else
-#define uint16 unsigned short
-#define int16 short
-#define uint32 unsigned long
-#define int32 long
-#define uint64 unsigned long long
-#define int64 long long
-#endif
+#define uint16 uint16_t
+#define int16 int16_t
+#define uint32 uint32_t
+#define int32 int32_t
+#define uint64 uint64_t
+#define int64 int64_t
+
#if defined(__STDC__)
#define __dog_signed signed
#else

70
textproc/dog/check-ctime.patch

@ -0,0 +1,70 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../dog/check-ctime.patch
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
diff --exclude='*~' --exclude='.*' -I '$Id:' -urN dog-1.7.orig/dog.c dog-1.7/dog.c
This patch comes from Gentoo, author is the Gentoo maintainer of dog.
--- ./dog.c 2005-05-13 08:01:37.000000000 -0400
+++ ./dog.c 2005-05-13 08:30:38.000000000 -0400
@@ -36,6 +36,7 @@
#include <string.h>
#include "getopt.h"
#include <limits.h>
+#include <time.h>
#include <netdb.h>
// this is fun
@@ -1321,26 +1322,35 @@
InetSockAddr sa;
int newsock;
uint32 ipAddr;
- int k;
+ socklen_t k;
time_t curr_time;
char curr_date[64];
k = sizeof(sa);
while ((newsock=accept(sock,(struct sockaddr*)&sa,&k)) != -1) {
if (!no_bind_header) {
+ char *result = NULL;
ipAddr = ntohl(sa.addr);
time(&curr_time);
- strcpy(curr_date,ctime(&curr_time));
+ if (!(result = ctime(&curr_time))) {
+ perror("ctime");
+ goto done;
+ }
+ strncpy(curr_date, result, sizeof(curr_date) - 1);
while (!isalnum(curr_date[strlen(curr_date)-1])) {
curr_date[strlen(curr_date)-1] = 0;
}
printf("# %s from %d.%d.%d.%d:%d\n",curr_date,(int)ipAddr>>24,(int)(ipAddr>>16)&0xff,(int)(ipAddr>>8)&0xff,(int)ipAddr&0xff,ntohs(sa.port));
}
- straight_dump = newsock;
- DumpThings(argc,argv,hang_up_bind ? -1 : newsock);
- if (hang_up_bind) {
+
+ goto done;
+
+ done:
+ straight_dump = newsock;
+ DumpThings(argc,argv,hang_up_bind ? -1 : newsock);
+ if (hang_up_bind) {
close(newsock);
- }
+ }
}
}

21
textproc/dog/dog.cache

@ -0,0 +1,21 @@
[TIMESTAMP] 1189150810 Fri Sep 7 15:40:10 2007
[BUILDTIME] 0 (5)
[SIZE] 0.04 MB, 8 files
[DEP] 00-dirtree
[DEP] bash
[DEP] binutils
[DEP] bzip2
[DEP] coreutils
[DEP] diffutils
[DEP] findutils
[DEP] gcc
[DEP] glibc
[DEP] grep
[DEP] linux-header
[DEP] make
[DEP] patch
[DEP] sed
[DEP] sysfiles
[DEP] tar

16
textproc/dog/dog.conf

@ -0,0 +1,16 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../dog/dog.conf
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---
[[ $libdir = *lib64 ]] && var_append patchfiles ' ' "$confdir/64bit-goodness.diff"

86
textproc/dog/dog.copy

@ -0,0 +1,86 @@
--- ./package/textproc/dog/64bit-goodness.diff 2007-09-07 15:44:24.000000000 +0800
+++ ./package/textproc/dog/64bit-goodness.diff 2007-09-07 15:58:39.000000000 +0800
@@ -1,3 +1,19 @@
+# --- SDE-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+#
+# Filename: package/.../dog/64bit-goodness.diff
+# Copyright (C) 2007 The OpenSDE Project
+#
+# More information can be found in the files COPYING and README.
+#
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- SDE-COPYRIGHT-NOTE-END ---
+
diff -ur dog-1.7/dog.c dog-1.7-64bit/dog.c
This patch comes from Gentoo, author is the Gentoo maintainer of dog
--- dog-1.7/dog.c 2000-06-21 18:04:43.000000000 +0200
--- ./package/textproc/dog/dog.conf 2007-09-07 15:37:57.000000000 +0800
+++ ./package/textproc/dog/dog.conf 2007-09-07 15:58:39.000000000 +0800
@@ -1,2 +1,16 @@
+# --- SDE-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+#
+# Filename: package/.../dog/dog.conf
+# Copyright (C) 2007 The OpenSDE Project
+#
+# More information can be found in the files COPYING and README.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License. A copy of the
+# GNU General Public License can be found in the file COPYING.
+# --- SDE-COPYRIGHT-NOTE-END ---
+
[[ $libdir = *lib64 ]] && var_append patchfiles ' ' "$confdir/64bit-goodness.diff"
--- ./package/textproc/dog/manpage-touchup.patch 2007-09-07 15:45:28.000000000 +0800
+++ ./package/textproc/dog/manpage-touchup.patch 2007-09-07 15:58:39.000000000 +0800
@@ -1,3 +1,19 @@
+# --- SDE-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+#
+# Filename: package/.../dog/manpage-touchup.patch
+# Copyright (C) 2007 The OpenSDE Project
+#
+# More information can be found in the files COPYING and README.
+#
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- SDE-COPYRIGHT-NOTE-END ---
+
The correct syntax of the -w option does not have a space between
the -w and the cols ... the manpage seems to imply differently though
so let's fix it.
--- ./package/textproc/dog/check-ctime.patch 2007-09-07 15:44:53.000000000 +0800
+++ ./package/textproc/dog/check-ctime.patch 2007-09-07 15:58:39.000000000 +0800
@@ -1,3 +1,19 @@
+# --- SDE-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+#
+# Filename: package/.../dog/check-ctime.patch
+# Copyright (C) 2007 The OpenSDE Project
+#
+# More information can be found in the files COPYING and README.
+#
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
+# of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+# --- SDE-COPYRIGHT-NOTE-END ---
+
diff --exclude='*~' --exclude='.*' -I '$Id:' -urN dog-1.7.orig/dog.c dog-1.7/dog.c
This patch comes from Gentoo, author is the Gentoo maintainer of dog.
--- ./dog.c 2005-05-13 08:01:37.000000000 -0400
Unknown tag '+# ' on package/textproc/dog/dog.copy

34
textproc/dog/dog.desc

@ -0,0 +1,34 @@
[COPY] --- SDE-COPYRIGHT-NOTE-BEGIN ---
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY]
[COPY] Filename: package/.../dog/dog.desc
[COPY] Copyright (C) 2007 The OpenSDE Project
[COPY]
[COPY] More information can be found in the files COPYING and README.
[COPY]
[COPY] This program is free software; you can redistribute it and/or modify
[COPY] it under the terms of the GNU General Public License as published by
[COPY] the Free Software Foundation; version 2 of the License. A copy of the
[COPY] GNU General Public License can be found in the file COPYING.
[COPY] --- SDE-COPYRIGHT-NOTE-END ---
[I] A buffering replacement for cat.
[T] Dog writes the contents of each given file, URL or standard input to
[T] standard output. It currently supports file, http and raw URLs. It is
[T] designed as a compatible, but enhanced replacement for cat.
[U] http://packages.debian.org/unstable/text/dog
[A] Jason Cohen <dogboy@photodex.com>
[M] Nagy Karoly Gabriel <karasz@opensde.org>
[C] extra/text
[L] GPL
[S] Stable
[V] 1.7
[P] X -----5---9 800.000
[D] 1158990027 dog_1.7.orig.tar.gz http://ftp.de.debian.org/debian/pool/main/d/dog/

34
textproc/dog/manpage-touchup.patch

@ -0,0 +1,34 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../dog/manpage-touchup.patch
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
The correct syntax of the -w option does not have a space between
the -w and the cols ... the manpage seems to imply differently though
so let's fix it.
http://bugs.gentoo.org/show_bug.cgi?id=69660
This patch comes from Gentoo, author is the gentoo maintainer of dog.
--- ./dog.1
+++ ./dog.1
@@ -8,3 +8,3 @@
.B dog
-[\-AbBeEnstTuv] [\-w cols] [\-l lines]
+[\-AbBeEnstTuv] [\-w<cols>] [\-l lines]
[\-\-show\-all] [\-\-number\-nonblank] [\-\-no\-blanks] [\-\-bind=port]
@@ -64,3 +64,3 @@
.TP
-.I \-w n
+.I \-w<n>
Print first n characters of each line (default=80)
Loading…
Cancel
Save