[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#562295: marked as done (and: FTBFS on GNU/kFreeBSD)



Your message dated Mon, 25 Jan 2010 03:32:22 +0000
with message-id <E1NZFgc-00034j-4b@ries.debian.org>
and subject line Bug#562295: fixed in and 1.2.2-4
has caused the Debian Bug report #562295,
regarding and: FTBFS on GNU/kFreeBSD
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 owner@bugs.debian.org
immediately.)


-- 
562295: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=562295
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: and
Version: 1.2.2-3
Severity: important
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

Hi,

your package FTBFS on GNU/kFreeBSD because it needs a little
buildsys-related porting. I did so by using a variable to gather all CC
settings for architectures supported by Debian (Linux, GNU(/Hurd) and
GNU/kFreeBSD). There's also the '/' pitfall meaning it's needed to tweak
ARCH a bit before using it in a filename. As for the addition of the
and-GNU_kFreeBSD.c file, I've used and-GNU.c

Thanks for considering.

Mraw,
KiBi.
--- a/Makefile
+++ b/Makefile
@@ -89,13 +89,14 @@ MANPAGES=and.8 and.conf.5 and.priorities
 #
 # Determine architecture from uname(1)
 #
-ARCH=$(shell uname)
+ARCH=$(shell uname|sed 's,/,_,')
 
 #
 # Architecture-dependent settings: ANSI C compiler and linker
 #
+DEBIAN_GCC = gcc -ansi -pedantic -Wall -g
 ifeq (${ARCH},Linux)
-  CC = gcc -ansi -pedantic -Wall -g
+  CC = $(DEBIAN_GCC)
   LD = gcc
   LIBS =
 else
@@ -127,7 +128,12 @@ ifeq (${ARCH},IRIX64)
   LD = cc
 else
 ifeq (${ARCH},GNU)
-  CC = gcc -ansi -pedantic -Wall -g
+  CC = $(DEBIAN_GCC)
+  LD = gcc
+  LIBS =
+else
+ifeq (${ARCH},GNU_kFreeBSD)
+  CC = $(DEBIAN_GCC)
   LD = gcc
   LIBS =
 else
@@ -143,6 +149,7 @@ endif
 endif
 endif
 endif
+endif
 
 
 #
@@ -189,6 +196,8 @@ and-SunOS.o: and.h and-OSF1.c
 and-GNU.o: and.h and-GNU.c
 	$(CC) -c and-GNU.c
 
+and-GNU_kFreeBSD.o: and.h and-GNU_kFreeBSD.c
+	$(CC) -c and-GNU_kFreeBSD.c
 
 #
 # Create script for SysV init
--- /dev/null
+++ b/and-GNU_kFreeBSD.c
@@ -0,0 +1,136 @@
+/*
+
+    AND auto nice daemon - renice programs according to their CPU usage.
+    Copyright (C) 1999-2003 Patrick Schemitz <schemitz@users.sourceforge.net>
+    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, <schemitz@users.sourceforge.net>
+  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-4

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-4.debian.tar.gz
  to main/a/and/and_1.2.2-4.debian.tar.gz
and_1.2.2-4.dsc
  to main/a/and/and_1.2.2-4.dsc
and_1.2.2-4_i386.deb
  to main/a/and/and_1.2.2-4_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 562295@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dario Minnucci <midget@debian.org> (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 ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 25 Jan 2010 03:28:06 +0100
Source: and
Binary: and
Architecture: source i386
Version: 1.2.2-4
Distribution: unstable
Urgency: low
Maintainer: Dario Minnucci <midget@debian.org>
Changed-By: Dario Minnucci <midget@debian.org>
Description: 
 and        - Auto Nice Daemon
Closes: 367997 562220 562295
Changes: 
 and (1.2.2-4) unstable; urgency=low
 .
   * Intend to adopt and. (Closes: #562220)
   * debian/control:
     - Maintainer address changed.
     - Added dependency on ${misc:Depends}
     - Debhelper upgraded to (>= 7.0.50~) to allow "override_dh_" in
       debian/rules
   * debian/rules: Replaced by the 'magic' rules file
   * Package migrated to 3.0 (quilt) format
   * Direct changes on upstream sources were extracted into patches.
     The extraction produced the following patches:
     + 000_and.8.man.diff
     + 000_and.c.diff
     + 000_and.conf.5.man.diff
     + 000_and-GNU.c.diff
     + 000_and.priorities.5.man.diff
     + 000_highpriostart.c.diff
     + 000_Makefile.diff
     + 000_watch.diff
   * Patch 000_watch.diff dropped.
   * Added headers to all extracted patches.
   * Added patch 000_and+kbsd.diff to fix FTBFS on GNU/kFreeBSD
     Thanks to Cyril Brulebois (Closes: #562295)
   * debian/copyright: Migrated to DEP-5 format.
   * debian/and.init.d: Written from scratch. (Closes: #367997)
Checksums-Sha1: 
 ff4b638195a1f4385ccade04582519b7824a23bc 1621 and_1.2.2-4.dsc
 7d6dc11e8b399fe9cd15ffa68091b5c098fd7d71 11887 and_1.2.2-4.debian.tar.gz
 8c8a824ce773b30db6fc1157f81d0a15165e7dca 28446 and_1.2.2-4_i386.deb
Checksums-Sha256: 
 251d84a5751de9b71532c5b60f362261e6313375bcc74f168e796c53a4cb02a1 1621 and_1.2.2-4.dsc
 8a2c53785c8573a66d5045cd59ed2f8f5361bafa642e800785c60beb6cae1362 11887 and_1.2.2-4.debian.tar.gz
 9cf91bef8fea24002e4588805805a8ad1159c4519f9197a477880002c8854e63 28446 and_1.2.2-4_i386.deb
Files: 
 904fc97da41d065f2be3a7ac02116bf0 1621 misc extra and_1.2.2-4.dsc
 310fc5e8a11ca03a8f4b50c5638c5b5a 11887 misc extra and_1.2.2-4.debian.tar.gz
 60a18cd3e8154b1873a79175a36d64b4 28446 misc extra and_1.2.2-4_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIcBAEBCAAGBQJLXQMGAAoJEPyEGy2CyLcRCz8P/0SQT6uZD4T7ynWtE9lDF2Z5
NKwjGhe/jNqAO0EdvLuFUSAUpQvsP1IhzZXx5YJinAuZ2Sbb00Nrd/VYWvM4W/4v
GZAnoxItgYeOipKFnQI0CRhRy7sjgGbxX7+hJoqFTO0Q4ZLfdIRN7IFOQvtfQq2o
KeF1DIKX8TvBzR9QnAK8dYy7VfJmKJM8kaAbf+TMBYHu20Al3kwf/fJrglJKg+6w
H0+4w2eecFyLGmCNRi4gqU95lOK6odLsuj94DU5oO97V8J0/sW7bulyQjt4enfl3
wpUvDqLi5+E2ltCn5S/10yizSW5FzTQuel+cFWw5atKrpz9cDz2beuT+3fWekGKG
mbufPLlcnVvPJMfqMBtGSCy9EsHp8hofkCYqrdH+nPTbVDoEiBRaZGHwSDVulgk2
kjKUB+serq67dbBqM6olpZ3aj8c835s90w48oPog7JWgcLauPcxK9LOY5cy0zs6G
JFqCG58UkKrMQG6w1pMi/PQefdRxOv9Xm+zHpWi+m9y7REOXEgaQYf1p3KbSVtTm
A7zZHMnoYeKN5ZlJQChtMQZw+qk0fvr1wHUg9PY3gNOkG7e/YfkCFusDftn/LbV7
hBEiAGrCh6Jy+D6VjSp1AXs7QsiDPc7URXkpUjXEpLG3zWtFV87gwtiPuagit4jX
0TDj5s2pzPxvMZGk0gV0
=6FgR
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: