Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

5
misc/root-tail/DESCR Normal file
View File

@@ -0,0 +1,5 @@
Displays a given file anywhere on your X11 root window with a transparent
background. It was made because I'm very lazy and this was easier than
making a new rxvt pixmap each time I changed my background to simulate that
transparent effect. A null desc (example: "/var/log/messages,red,") will
prevent the printing of a description and the []'s.

17
misc/root-tail/Makefile Normal file
View File

@@ -0,0 +1,17 @@
# $NetBSD: Makefile,v 1.11 2012/10/08 09:57:36 asau Exp $
#
DISTNAME= root-tail-0.0.10
PKGREVISION= 3
CATEGORIES= misc x11
MASTER_SITES= http://www.goof.com/pcg/marc/data/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.goof.com/pcg/marc/root-tail.html
COMMENT= Allows printing of text directly to the X11 root window
USE_IMAKE= YES
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

3
misc/root-tail/PLIST Normal file
View File

@@ -0,0 +1,3 @@
@comment $NetBSD: PLIST,v 1.3 2003/03/04 04:15:24 jschauma Exp $
bin/root-tail
${IMAKE_MAN_DIR}/root-tail.${IMAKE_MANNEWSUFFIX}

6
misc/root-tail/distinfo Normal file
View File

@@ -0,0 +1,6 @@
$NetBSD: distinfo,v 1.3 2005/02/24 11:02:57 agc Exp $
SHA1 (root-tail-0.0.10.tar.gz) = 19963087202e6b365f8d9820bdee283ace16caa4
RMD160 (root-tail-0.0.10.tar.gz) = b51ffaf59d8fade1122631941f924d5e53b941f8
Size (root-tail-0.0.10.tar.gz) = 7816 bytes
SHA1 (patch-aa) = dba9a38b50e538171cf060ad1ef2e035717037c5

View File

@@ -0,0 +1,118 @@
$NetBSD: patch-aa,v 1.1 2002/07/04 13:32:21 agc Exp $
Add a test to see if the log file has been turned over, and to re-open
files if it has.
--- root-tail.c 2002/07/04 13:05:32 1.1
+++ root-tail.c 2002/07/04 13:18:38
@@ -27,14 +27,6 @@
#define VERSION "0.0.10"
-/*---------------- Let's define signals functions -------------*/
-
-static void reopen (int);
-static void list_files (int);
-static void force_refresh (int);
-static void InstallSigHandler (void);
-FILE *openLog (const char *);
-
/*------------------------ initalize variables -----------------*/
int geom_mask, noinitial;
int screen, listlen = STD_HEIGHT, width = STD_WIDTH, ScreenWidth, ScreenHeight,
@@ -58,6 +50,7 @@
char desc[255]; /* alternative description */
FILE *f; /* FILE struct associated with file */
Pixel color; /* color to be used for printing */
+ struct stat st; /* stat buffer from previous */
struct logfile_entry *next;
};
@@ -70,6 +63,14 @@
Pixel color;
};
+/*---------------- Let's define signals functions -------------*/
+
+static void reopen (int);
+static void list_files (int);
+static void force_refresh (int);
+static void InstallSigHandler (void);
+FILE *openLog (struct logfile_entry *, const char *);
+
/*----------------------------- start code ---------------------*/
@@ -83,7 +84,7 @@
{
printf ("reopenin as %p (%s)\n", e->f, e->fname);
fclose (e->f);
- e->f = openLog (e->fname);
+ e->f = openLog (e, e->fname);
printf ("reopened as %p\n", e->f);
if (e->f == NULL)
{
@@ -226,15 +227,15 @@
}
FILE *
-openLog (const char *name)
+openLog (struct logfile_entry *e, const char *name)
{
FILE *f = fopen (name, "r");
- struct stat statbuf;
off_t size;
+
if (f == NULL)
return NULL;
- stat (name, &statbuf);
- size = statbuf.st_size;
+ stat (name, &e->st);
+ size = e->st.st_size;
if (size > (listlen+1) * width)
{
char dummy[255];
@@ -363,8 +364,16 @@
for (current = loglist; current != NULL; current = current->next)
{
+ struct stat st;
clearerr (current->f);
+ if (stat(current->fname, &st) < 0) {
+ continue;
+ }
+ if (st.st_ino != current->st.st_ino) {
+ need_reopen = 1;
+ }
+
while (!lineinput (temp, width + 2, current->f))
{
/*
@@ -418,7 +427,7 @@
if (need_reopen)
reopen (1);
- /* we ignore possible errors due to windo resizing &c */
+ /* we ignore possible errors due to window resizing &c */
while (XPending (disp))
{
XNextEvent (disp, &xev);
@@ -607,13 +616,14 @@
}
}
- if ((f = openLog (fname)) == NULL)
+ e = (struct logfile_entry *)
+ malloc (sizeof (struct logfile_entry));
+
+ if ((f = openLog (e, fname)) == NULL)
{
perror (fname);
exit (-1);
}
- e = (struct logfile_entry *)
- malloc (sizeof (struct logfile_entry));
strncpy (e->fname, fname, 255);
e->fname[255] = '\0'; /* just in case */