From laszlof@buster.freebsdmatrix.net  Tue Nov 26 17:21:37 2002
Return-Path: <laszlof@buster.freebsdmatrix.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2A69737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 2002 17:21:37 -0800 (PST)
Received: from buster.freebsdmatrix.net (pcp01940281pcs.waldlk01.mi.comcast.net [68.32.92.195])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 403D543E9C
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 2002 17:21:36 -0800 (PST)
	(envelope-from laszlof@buster.freebsdmatrix.net)
Received: from buster.freebsdmatrix.net (localhost [127.0.0.1])
	by buster.freebsdmatrix.net (Postfix) with ESMTP id 84F6719A3CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 26 Nov 2002 20:21:30 -0500 (EST)
Received: (from laszlof@localhost)
	by buster.freebsdmatrix.net (8.12.6/8.12.6/Submit) id gAR1LUfo012786;
	Tue, 26 Nov 2002 20:21:30 -0500 (EST)
Message-Id: <200211270121.gAR1LUfo012786@buster.freebsdmatrix.net>
Date: Tue, 26 Nov 2002 20:21:30 -0500 (EST)
From: "Frank J. Laszlo" <laszlof@freebsdmatrix.net>
Reply-To: "Frank J. Laszlo" <laszlof@freebsdmatrix.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Fix for games/euchre port for 5.0	
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45775
>Category:       ports
>Synopsis:       Fix for games/euchre port for 5.0
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 26 17:30:03 PST 2002
>Closed-Date:    Thu Dec 12 01:44:36 PST 2002
>Last-Modified:  Thu Dec 12 01:44:36 PST 2002
>Originator:     Frank J. Laszlo
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
none	
>Environment:
System: FreeBSD buster.freebsdmatrix.net 4.7-STABLE FreeBSD 4.7-STABLE #4: Thu Nov 14 22:35:17 EST 2002 root@buster.freebsdmatrix.net:/usr/obj/usr/src/sys/BUSTER i386


>Description:
	the Options.cpp was trying to open a file that does not exist, causing it to fail. we want to only try to open the file if it actually exists. 
>How-To-Repeat:
	Build previous port on 5.0

>Fix:

	Shell archive of the new port with patch. 

--- euchre.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	euchre
#	euchre/CVS
#	euchre/CVS/Root
#	euchre/CVS/Repository
#	euchre/CVS/Entries
#	euchre/Makefile
#	euchre/distinfo
#	euchre/pkg-comment
#	euchre/pkg-descr
#	euchre/pkg-plist
#	euchre/files
#	euchre/files/patch-aa
#
Echo c - euchre
mkdir -p euchre > /dev/null 2>&1
echo c - euchre/CVS
mkdir -p euchre/CVS > /dev/null 2>&1
echo x - euchre/CVS/Root
sed 's/^X//' >euchre/CVS/Root << 'END-of-euchre/CVS/Root'
X/usr/cvs
END-of-euchre/CVS/Root
echo x - euchre/CVS/Repository
sed 's/^X//' >euchre/CVS/Repository << 'END-of-euchre/CVS/Repository'
Xports/games/euchre
END-of-euchre/CVS/Repository
echo x - euchre/CVS/Entries
sed 's/^X//' >euchre/CVS/Entries << 'END-of-euchre/CVS/Entries'
X/Makefile/1.2/Mon Nov 25 02:52:39 2002//
X/distinfo/1.1/Mon Nov 25 02:48:44 2002//
X/pkg-comment/1.1/Mon Nov 25 02:48:44 2002//
X/pkg-descr/1.1/Mon Nov 25 02:48:44 2002//
X/pkg-plist/1.1/Mon Nov 25 02:48:44 2002//
XD
END-of-euchre/CVS/Entries
echo x - euchre/Makefile
sed 's/^X//' >euchre/Makefile << 'END-of-euchre/Makefile'
X# New ports collection Makefile for:	euchre
X# Date created:				23 July 2002
X# Whom:					Frank Laszlo <laszlof@freebsdmatrix.net>
X#
X# $FreeBSD: ports/games/euchre/Makefile,v 1.2 2002/11/25 02:52:39 will Exp $
X#
X
XPORTNAME=	euchre
XPORTVERSION=	0.3
XCATEGORIES=	games
XMASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
XMASTER_SITE_SUBDIR=	${PORTNAME}
X
XMAINTAINER=	laszlof@freebsdmatrix.net
X
XUSE_AUTOMAKE=	yes
XUSE_GTK=	yes
X
X.include <bsd.port.mk>
END-of-euchre/Makefile
echo x - euchre/distinfo
sed 's/^X//' >euchre/distinfo << 'END-of-euchre/distinfo'
XMD5 (euchre-0.3.tar.gz) = 97a61061a1bccf3977ac459ef23b90b3
END-of-euchre/distinfo
echo x - euchre/pkg-comment
sed 's/^X//' >euchre/pkg-comment << 'END-of-euchre/pkg-comment'
XVery popular card game with variable skill levels
END-of-euchre/pkg-comment
echo x - euchre/pkg-descr
sed 's/^X//' >euchre/pkg-descr << 'END-of-euchre/pkg-descr'
XA very basic interpretation of the game 'Euchre.'
X
XWWW: http://sourceforge.net/projects/euchre/
END-of-euchre/pkg-descr
echo x - euchre/pkg-plist
sed 's/^X//' >euchre/pkg-plist << 'END-of-euchre/pkg-plist'
Xbin/euchre
END-of-euchre/pkg-plist
echo c - euchre/files
mkdir -p euchre/files > /dev/null 2>&1
echo x - euchre/files/patch-aa
sed 's/^X//' >euchre/files/patch-aa << 'END-of-euchre/files/patch-aa'
X--- src/lib/Options.cpp.orig	Tue Nov 26 19:56:54 2002
X+++ src/lib/Options.cpp	Tue Nov 26 19:59:02 2002
X@@ -25,6 +25,9 @@
X #include <stdlib.h>
X #include <unistd.h>
X #include <iostream.h>
X+#include <sys/types.h>
X+#include <sys/stat.h>
X+#include <unistd.h>
X 
X #include "Debug.hpp"
X #include "Options.hpp"
X@@ -86,7 +89,19 @@
X   char fullpath[OPTIONS_PATH_SIZE];
X   snprintf(fullpath, OPTIONS_PATH_SIZE, "%s/%s", dir, OPTIONS_FILE_NAME);
X 
X-  ifstream in(fullpath, ios::nocreate);
X+  // We only want to try to open the file if it already exists.
X+  // ios::nocreate seems to have disappeared, so we'll use stat instead.
X+
X+  struct stat b;
X+
X+  if (-1 == stat(fullpath, &b))
X+  {
X+    LOG("could not open " << fullpath << endl);
X+    return 1;
X+  }
X+
X+  ifstream in(fullpath);
X+
X   if (! in) {
X     LOG("could not open " << fullpath << endl);
X     return 1;
END-of-euchre/files/patch-aa
exit
--- euchre.shar ends here ---


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: edwin 
State-Changed-When: Thu Dec 12 01:44:12 PST 2002 
State-Changed-Why:  
Commited, thanks! 
(next time please do a diff -u instead of a full sharchive) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=45775 
>Unformatted:
