summaryrefslogtreecommitdiff
path: root/biology/nut/patches
diff options
context:
space:
mode:
authorgarbled <garbled>2000-01-11 02:56:33 +0000
committergarbled <garbled>2000-01-11 02:56:33 +0000
commit50973690a87f60979a5867e7a4593cd0277c534b (patch)
tree915a18f4fb730f0d7d47d7f5bfb5c0633b1481e5 /biology/nut/patches
parentc605cc2ff6f4e264e02204f70257c2558b371ede (diff)
downloadpkgsrc-50973690a87f60979a5867e7a4593cd0277c534b.tar.gz
Initial import of nut program.
record what you eat and analyze your meals.
Diffstat (limited to 'biology/nut/patches')
-rw-r--r--biology/nut/patches/patch-aa36
-rw-r--r--biology/nut/patches/patch-ab24
-rw-r--r--biology/nut/patches/patch-ac11
3 files changed, 71 insertions, 0 deletions
diff --git a/biology/nut/patches/patch-aa b/biology/nut/patches/patch-aa
new file mode 100644
index 00000000000..b9da4412a00
--- /dev/null
+++ b/biology/nut/patches/patch-aa
@@ -0,0 +1,36 @@
+$NetBSD: patch-aa,v 1.1.1.1 2000/01/11 02:56:33 garbled Exp $
+--- main.c.orig Thu Apr 8 11:28:57 1999
++++ main.c Mon Jan 10 16:07:45 2000
+@@ -23,15 +23,32 @@
+ #include "food.h"
+ #include "db.h"
+ #include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <sys/errno.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+
+ void main(int argc, char *argv[])
+ {
++
++char pathname[256];
++extern int errno;
++
+ food_root.next = NULL;
+ meal_root.next = NULL;
+ recipe_root.next = NULL;
+ make_filenames();
+ if ( ! read_food_db() )
+ {
++ sprintf(pathname, "%s/%s", getenv("HOME"), NUTDIR);
++ if (mkdir(pathname, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
++ if (errno != EEXIST) {
++ printf("Cannot create %s/%s: %s\n", getenv("HOME"), NUTDIR,
++ strerror(errno));
++ exit(1);
++ }
++ }
+ read_raw_food_db();
+ read_nut_raw_food_file();
+ }
diff --git a/biology/nut/patches/patch-ab b/biology/nut/patches/patch-ab
new file mode 100644
index 00000000000..a95de4bd21d
--- /dev/null
+++ b/biology/nut/patches/patch-ab
@@ -0,0 +1,24 @@
+$NetBSD: patch-ab,v 1.1.1.1 2000/01/11 02:56:33 garbled Exp $
+--- db.c.orig Mon Jan 10 15:24:03 2000
++++ db.c Mon Jan 10 15:42:12 2000
+@@ -32,6 +32,11 @@
+ #else
+ char nutdir1[]=NUTDIR ;
+ #endif
++#ifndef DBDIR
++char nutdir2[]=".nutdb";
++#else
++char nutdir2[]=DBDIR ;
++#endif
+
+ char rawfoodfile1[] = "abbrev.txt";
+ char rawnutfoodfile1[] = "nutfood.txt";
+@@ -454,7 +459,7 @@
+
+ void make_filenames(void)
+ {
+-sprintf(rawfoodfile,"%s/%s/%s",getenv("HOME"),nutdir1,rawfoodfile1);
++sprintf(rawfoodfile,"%s/%s",nutdir2,rawfoodfile1);
+ sprintf(rawnutfoodfile,"%s/%s/%s",getenv("HOME"),nutdir1,rawnutfoodfile1);
+ sprintf(foodfile,"%s/%s/%s",getenv("HOME"),nutdir1,foodfile1);
+ sprintf(mealfile,"%s/%s/%s",getenv("HOME"),nutdir1,mealfile1);
diff --git a/biology/nut/patches/patch-ac b/biology/nut/patches/patch-ac
new file mode 100644
index 00000000000..9b78f9d413e
--- /dev/null
+++ b/biology/nut/patches/patch-ac
@@ -0,0 +1,11 @@
+$NetBSD: patch-ac,v 1.1.1.1 2000/01/11 02:56:33 garbled Exp $
+--- Makefile.orig Mon Jan 10 15:49:05 2000
++++ Makefile Mon Jan 10 15:52:35 2000
+@@ -1,6 +1,6 @@
+ objects := $(patsubst %.c,%.o,$(wildcard *.c))
+
+-CFLAGS= -O2 -Wall -DNUTDIR=\".nutdb\"
++CFLAGS= -O2 -Wall -DNUTDIR=\".nutdb\" -DDBDIR=\"${PREFIX}/share/nut\"
+
+ nut : $(objects)
+ gcc -O2 -Wall -lm -o nut $(objects)