pkgsrc/biology/nut/patches/patch-ab
obache 2c581bd82c Update nut to 13.2. Should close PR 34466.
Pkgsrc changes:
    Add DESTDIR support.

Recent changes (cannot available changes from 10.18 to 12.6 anymore).
13.2:
This release makes minor changes to the analysis reset and food suggestion
functions.
13.1:
This release changes some fatty acid defaults to allow more saturated fat when
eating low-carb, and to raise the maximum amount of long-chain Omega-3.
13.0:
This release introduces the new USDA Nutrient Database SR20 and allows current
NUT installations to have their existing meal records reinterpreted with the new
database.
12.7:
This release uses a new food name abbreviation algorithm so that food names are
more informative and less cryptic.
2008-01-30 05:43:55 +00:00

36 lines
1.1 KiB
Text

$NetBSD: patch-ab,v 1.7 2008/01/30 05:43:55 obache Exp $
--- db.c.orig 2007-12-29 07:45:33.000000000 +0000
+++ db.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <sys/stat.h>
#include <ctype.h>
+#include <errno.h>
#ifndef NUTDIR
char nutdir1[]=".nutdb";
@@ -892,9 +893,22 @@ strcpy(subuser,sub);
sprintf(versionfile,"%s/%s/%s","NUTDB",subuser,versionfile1);
#else
sprintf(nutdir,"%s/%s",getenv("HOME"),nutdir1);
-mkdir (nutdir, 0700 );
+if (mkdir(nutdir, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
+ if (errno != EEXIST) {
+ printf("Cannot create %s: %s\n", nutdir,
+ strerror(errno));
+ exit(1);
+ }
+}
sprintf(nutdirsubuser,"%s/%s/%s",getenv("HOME"),nutdir1,subuser);
mkdir (nutdirsubuser, 0700 );
+if (mkdir(nutdirsubuser, S_IRWXU|S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH) != 0) {
+ if (errno != EEXIST) {
+ printf("Cannot create %s: %s\n", nutdirsubuser,
+ strerror(errno));
+ exit(1);
+ }
+}
sprintf(USDAjoined,"%s/%s",FOODDIR,USDAjoined1);
sprintf(globalFOOD,"%s/%s",FOODDIR,globalFOOD1);
sprintf(globalNUT,"%s/%s",FOODDIR,globalNUT1);