Your message dated Wed, 23 Dec 2009 22:02:20 +0000
with message-id <[email protected]>
and subject line Bug#532698: fixed in and 1.2.2-3
has caused the Debian Bug report #532698,
regarding and: FTBFS on Debian GNU/Hurd
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
532698: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532698
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: and
Version: 1.2.2-2.1
Severity: normal
Hi,
and currently fails to build on Debian GNU/Hurd. Now that we have
somewhat of a /proc system, it should sorta work. Attached is a patch
to allow it to at least build and run on Debian GNU/Hurd.
Thank you,
Barry deFreese
diff -urN repo/and-1.2.2/Makefile ./and-1.2.2/Makefile
--- repo/and-1.2.2/Makefile 2009-06-10 15:42:50.000000000 -0400
+++ ./and-1.2.2/Makefile 2009-06-10 14:59:35.000000000 -0400
@@ -126,6 +126,11 @@
CC = cc
LD = cc
else
+ifeq (${ARCH},GNU)
+ CC = gcc -ansi -pedantic -Wall -g
+ LD = gcc
+ LIBS =
+else
# unsupported architecture
CC = false
LD = false
@@ -137,6 +142,7 @@
endif
endif
endif
+endif
#
@@ -180,6 +186,8 @@
and-SunOS.o: and.h and-OSF1.c
$(CC) -c and-OSF1.c -o and-SunOS.o
+and-GNU.o: and.h and-GNU.c
+ $(CC) -c and-GNU.c
#
diff -urN repo/and-1.2.2/and-GNU.c ./and-1.2.2/and-GNU.c
--- repo/and-1.2.2/and-GNU.c 1969-12-31 19:00:00.000000000 -0500
+++ ./and-1.2.2/and-GNU.c 2009-06-10 15:32:23.000000000 -0400
@@ -0,0 +1,136 @@
+/*
+
+ AND auto nice daemon - renice programs according to their CPU usage.
+ Copyright (C) 1999-2003 Patrick Schemitz <[email protected]>
+ http://and.sourceforge.net/
+
+ 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; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <unistd.h>
+#include <string.h>
+#include <dirent.h>
+#include <ctype.h>
+#include <syslog.h>
+#include <sys/stat.h>
+#include <signal.h>
+#include <sys/param.h> /* kernel interrupt frequency: HZ */
+
+
+#include "and.h"
+
+
+/*
+
+ AND -- auto-nice daemon/GNU version.
+
+ GNU-specific AND version. Makes excessive use of the GNU
+ /proc filesystem and is not portable.
+
+ 1999-2003 Patrick Schemitz, <[email protected]>
+ http://and.sourceforge.net/
+
+*/
+
+
+static DIR *linux_procdir = 0;
+
+
+static struct and_procent linux_proc;
+
+
+int linux_readproc (char *fn)
+{
+ /* Scan /proc/<pid>/stat file. Format described in proc(5).
+ l1: pid comm state ppid
+ l2: pgrp session tty tpgid
+ l3: flags minflt cminflt majflt cmajflt
+ l4: utime stime cutime cstime
+ l5: counter priority
+ */
+ FILE* f;
+ int i;
+ long li;
+ long unsigned u, ujf, sjf;
+ char state;
+ char buffer [1024];
+ if (!(f = fopen(fn,"rt"))) return 0;
+ fscanf(f,"%d %1023s %c
%d",&(linux_proc.pid),buffer,&state,&(linux_proc.ppid));
+ fscanf(f,"%d %d %d %d",&i,&i,&i,&i);
+ fscanf(f,"%lu %lu %lu %lu %lu",&u,&u,&u,&u,&u);
+ fscanf(f,"%lu %lu %ld %ld",&ujf,&sjf,&li,&li);
+ fscanf(f,"%ld %d",&li,&(linux_proc.nice));
+ i = feof(f);
+ fclose(f);
+ if (i) return 0;
+ if (state == 'Z') return 0; /* ignore zombies */
+ ujf += sjf; /* take into account both usr and sys time */
+ ujf /= 60; /* convert jiffies to seconds */
+ linux_proc.utime = ujf > INT_MAX ? INT_MAX: (int) ujf;
+ buffer[strlen(buffer)-1] = 0; /* remove () around command name */
+ strncpy(linux_proc.command,&buffer[1],1023);
+ linux_proc.command[1023] = 0;
+ and_printf(3, "GNU: process %s pid: %d ppid: %d\n",
+ linux_proc.command, linux_proc.pid, linux_proc.ppid);
+ return 1;
+}
+
+
+struct and_procent *linux_getnext ()
+{
+ char name [1024];
+ struct dirent *entry;
+ struct stat dirstat;
+ if (!linux_procdir) return NULL;
+ while ((entry = readdir(linux_procdir)) != NULL) { /* omit . .. apm bus... */
+ if (isdigit(entry->d_name[0])) break;
+ }
+ if (!entry) return NULL;
+ /* stat() /proc/<pid> directory to get uid/gid */
+ snprintf(name, 1024, "/proc/%s",entry->d_name);
+ if (stat(name,&dirstat)) return linux_getnext();
+ /* read the job's stat "file" to get command, nice level, etc */
+ snprintf(name, 1024, "/proc/%s/stat",entry->d_name);
+ if (!linux_readproc(name)) return linux_getnext();
+ linux_proc.uid = dirstat.st_uid;
+ linux_proc.gid = dirstat.st_gid;
+ return &linux_proc;
+}
+
+
+struct and_procent *linux_getfirst ()
+{
+ if (linux_procdir) {
+ rewinddir(linux_procdir);
+ } else {
+ linux_procdir = opendir("/proc");
+ if (!linux_procdir) {
+ and_printf(0,"cannot open /proc, aborting.\n");
+ abort();
+ }
+ }
+ return linux_getnext();
+}
+
+
+int main (int argc, char** argv)
+{
+ and_setprocreader(&linux_getfirst,&linux_getnext);
+ return and_main(argc,argv);
+}
--- End Message ---
--- Begin Message ---
Source: and
Source-Version: 1.2.2-3
We believe that the bug you reported is fixed in the latest version of
and, which is due to be installed in the Debian FTP archive:
and_1.2.2-3.diff.gz
to main/a/and/and_1.2.2-3.diff.gz
and_1.2.2-3.dsc
to main/a/and/and_1.2.2-3.dsc
and_1.2.2-3_i386.deb
to main/a/and/and_1.2.2-3_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Barry deFreese <[email protected]> (supplier of updated and package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Wed, 23 Dec 2009 16:47:24 -0500
Source: and
Binary: and
Architecture: source i386
Version: 1.2.2-3
Distribution: unstable
Urgency: low
Maintainer: Debian QA Group <[email protected]>
Changed-By: Barry deFreese <[email protected]>
Description:
and - Auto Nice Daemon
Closes: 372746 449941 532698
Changes:
and (1.2.2-3) unstable; urgency=low
.
* QA upload.
+ Set maintainer to Debian QA Group <[email protected]>.
* Acknowledge NMUs.
* Add Homepage field.
* Update watch file to use SF redirector. (Closes: #449941).
* Add -f support to run in foreground (Closes: #372746).
+ Thanks to Andras Korn for the patch!
* Add support to build on GNU/Hurd. (Closes: #532698).
* Bump debhelper build-dep and compat to 5.
* Bump Standards Version to 3.8.3.
Checksums-Sha1:
552b14a03e6e44083cbb471cb3b4ea46ac7f6236 956 and_1.2.2-3.dsc
e805015a767db5f990dae4d4a254fdaeac00114a 8174 and_1.2.2-3.diff.gz
c9b86fe1881cb1c8953de9657feead362071da40 26346 and_1.2.2-3_i386.deb
Checksums-Sha256:
993db6738ec0fb0acf7d5400e630ccac4052fcdcb6feee27e2b88aa029dc3861 956
and_1.2.2-3.dsc
4ab7d73ba64992a7aa1af12970b6f347c51d4604b6de697d0d106942bcf083b2 8174
and_1.2.2-3.diff.gz
e60a4aa939f525a9f83e21612f81759a309ff1d21dd12468f450eed8e8845dfb 26346
and_1.2.2-3_i386.deb
Files:
edc28f3d77d2710dbb6b480d3d69977b 956 misc extra and_1.2.2-3.dsc
2d19519a30a4c0d37995c07f1f5eb139 8174 misc extra and_1.2.2-3.diff.gz
50d0b8cb666cf7e975ff199718ae9780 26346 misc extra and_1.2.2-3_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAksykVgACgkQ5ItltUs5T34PJgCg2BsZBYalnxJVAs+VXpb8cfoh
nYYAoJlGyeWysK3D68aNWcRDyX1pG4iD
=7hHj
-----END PGP SIGNATURE-----
--- End Message ---