From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Mar 22 14:40:12 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B5431065673 for ; Thu, 22 Mar 2012 14:40:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F9FD8FC18 for ; Thu, 22 Mar 2012 14:40:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q2MEeC0s052954 for ; Thu, 22 Mar 2012 14:40:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q2MEeC0L052953; Thu, 22 Mar 2012 14:40:12 GMT (envelope-from gnats) Resent-Date: Thu, 22 Mar 2012 14:40:12 GMT Resent-Message-Id: <201203221440.q2MEeC0L052953@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Marco Steinbach Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B76AD1065673 for ; Thu, 22 Mar 2012 14:37:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7158FC1A for ; Thu, 22 Mar 2012 14:37:05 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q2MEb5Ep034018 for ; Thu, 22 Mar 2012 14:37:05 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q2MEb5MD034017; Thu, 22 Mar 2012 14:37:05 GMT (envelope-from nobody) Message-Id: <201203221437.q2MEb5MD034017@red.freebsd.org> Date: Thu, 22 Mar 2012 14:37:05 GMT From: Marco Steinbach To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/166319: [PATCH] ports/bsdgames: battlestar needs fixing X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 14:40:12 -0000 >Number: 166319 >Category: ports >Synopsis: [PATCH] ports/bsdgames: battlestar needs fixing >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 22 14:40:12 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Marco Steinbach >Release: 9.0-STABLE #0 r231681M >Organization: >Environment: FreeBSD x2.c0c0.intra 9.0-STABLE FreeBSD 9.0-STABLE #0 r231681M: Tue Feb 14 20:09:20 CET 2012 root@x2.c0c0.intra:/usr/obj/usr/src/sys/X2VIMAGE amd64 >Description: *BATTLESTAR NEWSFLASH*BATTLESTAR NEWSFLASH*BATTLESTAR NEWSFLASH* Battlestar Daily uncovers heinous sabotage scheme ! Leaked mission radio protocols show losing grip on reality. In what flabbergasted experts describe as a 'highly efficient, covert thingie'-scheme, members of our forces involved in highly classified operations suffered a dramatic loss of vital sensorical capabilities, leading to desastrous results. >From leaked radio recordings and its own sources involved in mission preparation and conduct, BD learned shocking details of failed missions. While sources insist, that missions parameters were in normal range at all times, the recordings reveal disoriented operatives, sobbingly crawling floors looking for gear like laser pistols, or panicking over loss of visuals after battles in space. 'Odd.', one expert is quoted saying after reviewing detailed mission protocols, clearly admitting to this being a deliberate act of sabotage. 'They need to adapt to this new threat.', says Vidad Gleirg, Battlestar senior consultant with Anagram & Partners, 'Quickly.'. BD has notified officials of the situation, and is awaiting responses. >How-To-Repeat: Start battlestar, go right, go left. There should be a laser pistol, but it's missing. Start battlestar, launch from the battlestar, pick a space fight, win it, and be left in total darkness. >Fix: battlestar lets setbit in sys/param.h override its own, different implementation, leading to all sorts of odd behaviour. I've renamed battlestars setbit to bsetbit in this patch. Also, won space fights do no longer end in darkness, as this patch sets buffering back to linemode afterwards. I've tested the attached, patched port on i386 and amd64, and it works for me. Patch attached with submission follows: # 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: # # bsdgames # bsdgames/files # bsdgames/files/patch-Makefile # bsdgames/files/patch-Makefile.inc # bsdgames/files/patch-dfly # bsdgames/files/patch-hack # bsdgames/files/share.mtree # bsdgames/files/var.mtree # bsdgames/files/patch-battlestar # bsdgames/Makefile # bsdgames/distinfo # bsdgames/pkg-descr # bsdgames/pkg-plist # echo c - bsdgames mkdir -p bsdgames > /dev/null 2>&1 echo c - bsdgames/files mkdir -p bsdgames/files > /dev/null 2>&1 echo x - bsdgames/files/patch-Makefile sed 's/^X//' >bsdgames/files/patch-Makefile << '17575789bba5033611b6c6efbbef972c' X--- Makefile.orig 2009-09-24 10:46:30.000000000 +0200 X+++ Makefile 2009-11-04 18:14:08.698185298 +0100 X@@ -8,32 +8,20 @@ X atc \ X backgammon \ X battlestar \ X- bcd \ X bs \ X- caesar \ X canfield \ X cribbage \ X- dm \ X- factor \ X fish \ X- fortune \ X- grdc \ X hack \ X hangman \ X hunt \ X larn \ X mille \ X- morse \ X- number \ X phantasia \ X piano \ X pig \ X- pom \ X- ppt \ X- primes \ X quiz \ X rain \ X- random \ X robots \ X rogue \ X sail \ 17575789bba5033611b6c6efbbef972c echo x - bsdgames/files/patch-Makefile.inc sed 's/^X//' >bsdgames/files/patch-Makefile.inc << 'd92669c9a4318694b31b78fb6db0e09c' X--- Makefile.inc.orig 2009-09-24 10:46:30.000000000 +0200 X+++ Makefile.inc 2009-11-25 23:07:35.000000000 +0100 X@@ -2,14 +2,40 @@ X # $FreeBSD: ports/games/bsdgames/files/patch-Makefile.inc,v 1.2 2009/11/26 14:45:24 miwi Exp $ X # $DragonFly: src/games/Makefile.inc,v 1.3 2006/10/08 16:22:34 pavalos Exp $ X X-BINDIR?= /usr/games X+PREFIX?= /usr/local X+BINDIR?= ${PREFIX}/bin X+SHAREDIR= ${PREFIX}/share X+MANDIR= ${PREFIX}/man/man X FILESDIR?= ${SHAREDIR}/games X WARNS?= 6 X X-.if defined(HIDEGAME) X-ORIGBINDIR:= ${BINDIR} X-BINDIR:= ${BINDIR}/hide X-ORIGBINGRP:= ${BINGRP} X+.if defined(SGIDGAME) X BINGRP= games X-BINMODE= 550 X+BINMODE= 2555 X .endif X+ X+# cribbed from DragonflyBSD build system X+ X+NXCC?= ${CC} X+NXCFLAGS?= ${CFLAGS:N-mtune*:N-mcpu*:N-march*} X+ X+.SUFFIXES: .nx .no X+ X+# .no == native object file, for helper code when cross building. X+# X+.c.no: X+ ${NXCC} ${_${.IMPSRC:T}_FLAGS} ${NXCFLAGS} -c ${.IMPSRC} -o ${.TARGET} X+ X+.y.no: X+ ${YACC} ${YFLAGS} ${.IMPSRC} X+ ${NXCC} ${NXCFLAGS} -c y.tab.c -o ${.TARGET} X+ rm -f y.tab.c X+ X+.l.no: X+ ${LEX} ${LFLAGS} -o${.TARGET}.c ${.IMPSRC} X+ ${NXCC} ${NXCFLAGS} -c ${.TARGET}.c -o ${.TARGET} X+ rm -f ${.TARGET}.c X+ X+.no.nx .c.nx: X+ ${NXCC} ${_${.IMPSRC:T}_FLAGS} ${NXCFLAGS} ${NXLDFLAGS} ${.IMPSRC} \ X+ ${NXLDLIBS} -o ${.TARGET} d92669c9a4318694b31b78fb6db0e09c echo x - bsdgames/files/patch-dfly sed 's/^X//' >bsdgames/files/patch-dfly << '1e48dda9ddd815f8815b2ac015da8ad9' X--- ./cribbage/instr.c X+++ ./cribbage/instr.c X@@ -51,7 +51,11 @@ void X instructions(void) X { X struct stat sb; X+#ifdef __DragonFly__ X union wait pstat; X+#else X+ int pstat; X+#endif X pid_t pid; X const char *pager, *path; X X@@ -77,7 +81,11 @@ instructions(void) X do { X pid = waitpid(pid, (int *)&pstat, 0); X } while (pid == -1 && errno == EINTR); X+#ifdef __DragonFly__ X if (pid == -1 || pstat.w_status) X+#else X+ if (pid == -1 || WEXITSTATUS(pstat) || WTERMSIG(pstat)) X+#endif X exit(1); X } X } X--- ./sail/pl_1.c X+++ ./sail/pl_1.c X@@ -122,7 +122,11 @@ choke(void) X void X child(void) X { X+#ifdef __DragonFly__ X union wait status; X+#else X+ int status; X+#endif X int pid; X X signal(SIGCHLD, SIG_IGN); 1e48dda9ddd815f8815b2ac015da8ad9 echo x - bsdgames/files/patch-hack sed 's/^X//' >bsdgames/files/patch-hack << '7019da9d2bb4826797565a6f8612d1c0' X--- hack/hack.unix.c.orig 2009-09-24 10:46:30.000000000 +0200 X+++ hack/hack.unix.c 2009-11-04 18:49:58.645035610 +0100 X@@ -19,7 +19,9 @@ X X #include /* for time_t and stat */ X #include X+#include X #include X+#include X X static struct tm *getlt(void); X static bool veryold(int); X@@ -95,13 +97,32 @@ X void X gethdate(const char *name) X { X-/* old version - for people short of space */ X-char *np; X+ char *p, *np, *path; X+ char filename[MAXPATHLEN+1]; X X- name = "/usr/games/hide/hack"; X- if(stat(name, &hbuf)) X- error("Cannot get status of %s.", X- (np = rindex(name, '/')) ? np+1 : name); X+ if (strchr(name, '/') != NULL || (p = getenv("PATH")) == NULL) X+ p = ""; X+ np = path = strdup(p); /* Make a copy for strsep. */ X+ if (path == NULL) X+ err(1, NULL); X+ X+ for (;;) { X+ if ((p = strsep(&np, ":")) == NULL) X+ break; X+ if (*p == '\0') /* :: */ X+ (void) strlcpy(filename, name, sizeof filename); X+ else X+ (void) snprintf(filename, sizeof filename, X+ "%s/%s", p, name); X+ X+ if (stat(filename, &hbuf) == 0) { X+ free(path); X+ return; X+ } X+ } X+ error("Cannot get status of %s.", X+ (p = strrchr(name, '/')) ? p+1 : name); X+ free(path); X } X X bool 7019da9d2bb4826797565a6f8612d1c0 echo x - bsdgames/files/share.mtree sed 's/^X//' >bsdgames/files/share.mtree << '089c25bf375790c685f9caf8899dd440' X# Games dirs X. X/set type=dir uname=root gname=wheel mode=0755 X games X atc X .. X larn X .. X quiz.db X .. X .. 089c25bf375790c685f9caf8899dd440 echo x - bsdgames/files/var.mtree sed 's/^X//' >bsdgames/files/var.mtree << '2a8b4584c0a03cb8651a8c66e226f5a3' X# Games dirs X. X/set type=dir uname=root gname=games mode=0775 X games X atc X .. X battlestar X .. X hackdir mode=0770 X save mode=0770 X .. X .. X larn X .. X phantasia X .. X .. 2a8b4584c0a03cb8651a8c66e226f5a3 echo x - bsdgames/files/patch-battlestar sed 's/^X//' >bsdgames/files/patch-battlestar << '3df5abd7894c7f669e31b5a9f0a87ab0' Xdiff -Naur battlestar.orig/com1.c battlestar/com1.c X--- battlestar.orig/com1.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com1.c 2012-03-22 13:59:03.000000000 +0100 X@@ -79,7 +79,7 @@ X for (j = 0; j < NUMOFWORDS; j++) X nightfile[i].objects[j] = dayfile[i].objects[j]; X for (p = nightobjs; p->room != 0; p++) X- setbit(nightfile[p->room].objects, p->obj); X+ bsetbit(nightfile[p->room].objects, p->obj); X location = nightfile; X } else { X for (i = 1; i <= NUMOFROOMS; i++) X@@ -167,9 +167,9 @@ X if (testbit(location[position].objects, GIRL)) X meetgirl = 1; X if (meetgirl && CYCLE * 1.5 - gtime < 10){ X- setbit(location[GARDEN].objects,GIRLTALK); X- setbit(location[GARDEN].objects,LAMPON); X- setbit(location[GARDEN].objects,ROPE); X+ bsetbit(location[GARDEN].objects,GIRLTALK); X+ bsetbit(location[GARDEN].objects,LAMPON); X+ bsetbit(location[GARDEN].objects,ROPE); X } X if (position == DOCK && (beenthere[position] || gtime > CYCLE)){ X clearbit(location[DOCK].objects, GIRL); X@@ -245,7 +245,7 @@ X position = location[position].down; X } X notes[LAUNCHED] = 0; X- setbit(location[position].objects,CRASH); X+ bsetbit(location[position].objects,CRASH); X gtime += rnd(CYCLE/4); X puts("The viper explodes into the ground and you lose consciousness..."); X zzz(); Xdiff -Naur battlestar.orig/com2.c battlestar/com2.c X--- battlestar.orig/com2.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com2.c 2012-03-22 13:59:03.000000000 +0100 X@@ -78,7 +78,7 @@ X X if (testbit(inven,value)){ X clearbit(inven,value); X- setbit(wear,value); X+ bsetbit(wear,value); X carrying -= objwt[value]; X encumber -= objcumber[value]; X gtime++; X@@ -176,13 +176,13 @@ X if (testbit(location[position].objects,BATHGOD)){ X puts("The goddess's head slices off. Her corpse floats in the water."); X clearbit(location[position].objects,BATHGOD); X- setbit(location[position].objects,DEADGOD); X+ bsetbit(location[position].objects,DEADGOD); X power += 5; X notes[JINXED]++; X } else if (testbit(location[position].objects,NORMGOD)){ X puts("The goddess pleads but you strike her mercilessly. Her broken body lies in a\npool of blood."); X clearbit(location[position].objects,NORMGOD); X- setbit(location[position].objects,DEADGOD); X+ bsetbit(location[position].objects,DEADGOD); X power += 5; X notes[JINXED]++; X if (wintime) X@@ -193,7 +193,7 @@ X if (testbit(location[position].objects,TIMER)){ X puts("The old man offers no resistance."); X clearbit(location[position].objects,TIMER); X- setbit(location[position].objects,DEADTIME); X+ bsetbit(location[position].objects,DEADTIME); X power++; X notes[JINXED]++; X } else puts("Who?"); X@@ -202,7 +202,7 @@ X if (testbit(location[position].objects,NATIVE)){ X puts("The girl screams as you cut her body to shreds. She is dead."); X clearbit(location[position].objects,NATIVE); X- setbit(location[position].objects,DEADNATIVE); X+ bsetbit(location[position].objects,DEADNATIVE); X power += 5; X notes[JINXED]++; X } else puts("What girl?"); X@@ -254,18 +254,18 @@ X murder(); X if (rnd(100) < 50){ X puts("Her screams have attracted attention. I think we are surrounded."); X- setbit(location[ahead].objects,WOODSMAN); X- setbit(location[ahead].objects,DEADWOOD); X- setbit(location[ahead].objects,MALLET); X- setbit(location[back].objects,WOODSMAN); X- setbit(location[back].objects,DEADWOOD); X- setbit(location[back].objects,MALLET); X- setbit(location[left].objects,WOODSMAN); X- setbit(location[left].objects,DEADWOOD); X- setbit(location[left].objects,MALLET); X- setbit(location[right].objects,WOODSMAN); X- setbit(location[right].objects,DEADWOOD); X- setbit(location[right].objects,MALLET); X+ bsetbit(location[ahead].objects,WOODSMAN); X+ bsetbit(location[ahead].objects,DEADWOOD); X+ bsetbit(location[ahead].objects,MALLET); X+ bsetbit(location[back].objects,WOODSMAN); X+ bsetbit(location[back].objects,DEADWOOD); X+ bsetbit(location[back].objects,MALLET); X+ bsetbit(location[left].objects,WOODSMAN); X+ bsetbit(location[left].objects,DEADWOOD); X+ bsetbit(location[left].objects,MALLET); X+ bsetbit(location[right].objects,WOODSMAN); X+ bsetbit(location[right].objects,DEADWOOD); X+ bsetbit(location[right].objects,MALLET); X } X break; X default: X@@ -285,15 +285,15 @@ X puts("You have cornered him. His laser sword extends as he steps forward."); X position = FINAL; X fight(DARK,75); X- setbit(location[position].objects,TALISMAN); X- setbit(location[position].objects,AMULET); X+ bsetbit(location[position].objects,TALISMAN); X+ bsetbit(location[position].objects,AMULET); X return(0); X } X else if (followgod == gtime){ X puts("The goddess leads you down a steamy tunnel and into a high, wide chamber."); X puts("She sits down on a throne."); X position = 268; X- setbit(location[position].objects,NORMGOD); X+ bsetbit(location[position].objects,NORMGOD); X notes[CANTSEE] = 1; X return(0); X } Xdiff -Naur battlestar.orig/com3.c battlestar/com3.c X--- battlestar.orig/com3.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com3.c 2012-03-22 13:59:03.000000000 +0100 X@@ -46,10 +46,10 @@ X switch(position){ X case 144: /* copse near beach */ X if (!notes[DUG]){ X- setbit(location[position].objects,DEADWOOD); X- setbit(location[position].objects,COMPASS); X- setbit(location[position].objects,KNIFE); X- setbit(location[position].objects,MACE); X+ bsetbit(location[position].objects,DEADWOOD); X+ bsetbit(location[position].objects,COMPASS); X+ bsetbit(location[position].objects,KNIFE); X+ bsetbit(location[position].objects,MACE); X notes[DUG] = 1; X } X break; X@@ -95,7 +95,7 @@ X for (n=0; n < NUMOFOBJECTS; n++) X if (testbit(inven,n)){ X clearbit(inven,n); X- setbit(location[position].objects,n); X+ bsetbit(location[position].objects,n); X } X carrying = 0; X encumber = 0; X@@ -254,7 +254,7 @@ X puts("Dark blood oozes from the charred blast hole. Her naked body floats in the"); X puts("pools and then off downstream."); X clearbit(location[position].objects,BATHGOD); X- setbit(location[180].objects,DEADGOD); X+ bsetbit(location[180].objects,DEADGOD); X power += 5; X ego -= 10; X notes[JINXED]++; X@@ -263,7 +263,7 @@ X puts("She writhes in the dirt as the agony of death taunts her."); X puts("She has stopped moving."); X clearbit(location[position].objects,NORMGOD); X- setbit(location[position].objects,DEADGOD); X+ bsetbit(location[position].objects,DEADGOD); X power += 5; X ego -= 10; X notes[JINXED]++; X@@ -281,7 +281,7 @@ X ego -= 2; X notes[JINXED]++; X clearbit(location[position].objects,TIMER); X- setbit(location[position].objects,DEADTIME); X+ bsetbit(location[position].objects,DEADTIME); X } X else puts("What old timer?"); X break; X@@ -297,7 +297,7 @@ X if (testbit(location[position].objects,NATIVE)){ X puts("The girl is blown backwards several feet and lies in a pool of blood."); X clearbit(location[position].objects,NATIVE); X- setbit(location[position].objects,DEADNATIVE); X+ bsetbit(location[position].objects,DEADNATIVE); X power += 5; X ego -= 2; X notes[JINXED]++; Xdiff -Naur battlestar.orig/com4.c battlestar/com4.c X--- battlestar.orig/com4.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com4.c 2012-03-22 13:59:03.000000000 +0100 X@@ -58,7 +58,7 @@ X heavy = (carrying + objwt[value]) <= WEIGHT; X bulky = (encumber + objcumber[value]) <= CUMBER; X if ((testbit(from,value) || wiz || tempwiz) && heavy && bulky && !testbit(inven,value)){ X- setbit(inven,value); X+ bsetbit(inven,value); X carrying += objwt[value]; X encumber += objcumber[value]; X gtime++; X@@ -223,12 +223,12 @@ X if (deposit && testbit(location[position].objects,value)){ X clearbit(location[position].objects,value); X if (value != GRENADE) X- setbit(location[deposit].objects,value); X+ bsetbit(location[deposit].objects,value); X else{ X puts("A thundering explosion nearby sends up a cloud of smoke and shrapnel."); X for (n = 0; n < NUMOFWORDS; n ++) X location[deposit].objects[n] = 0; X- setbit(location[deposit].objects,CHAR); X+ bsetbit(location[deposit].objects,CHAR); X } X if (value == ROPE && position == FINAL) X location[position].access = 1; X@@ -282,7 +282,7 @@ X die(0); X } X if (value != AMULET && value != MEDALION && value != TALISMAN) X- setbit(location[position].objects,value); X+ bsetbit(location[position].objects,value); X else X tempwiz = 0; X gtime++; Xdiff -Naur battlestar.orig/com5.c battlestar/com5.c X--- battlestar.orig/com5.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com5.c 2012-03-22 13:59:03.000000000 +0100 X@@ -100,7 +100,7 @@ X } X printf("Goddess:\n"); X if (!loved) X- setbit(location[position].objects,MEDALION); X+ bsetbit(location[position].objects,MEDALION); X loved = 1; X gtime += 10; X zzz(); X@@ -156,7 +156,7 @@ X n = rnd(NUMOFOBJECTS); X clearbit(inven,n); X if (n != AMULET && n != MEDALION && n != TALISMAN) X- setbit(location[position].objects,n); X+ bsetbit(location[position].objects,n); X carrying -= objwt[n]; X encumber -= objcumber[n]; X } X@@ -164,10 +164,10 @@ X fight(ELF,10); X break; X case 1: X- setbit(location[position].objects,DEADWOOD); X+ bsetbit(location[position].objects,DEADWOOD); X break; X case 2: X- setbit(location[position].objects,HALBERD); X+ bsetbit(location[position].objects,HALBERD); X break; X default: X break; Xdiff -Naur battlestar.orig/com6.c battlestar/com6.c X--- battlestar.orig/com6.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com6.c 2012-03-22 13:59:03.000000000 +0100 X@@ -69,7 +69,7 @@ X if (notes[LAUNCHED] && testbit(location[position].objects,LAND) && location[position].down){ X notes[LAUNCHED] = 0; X position = location[position].down; X- setbit(location[position].objects,VIPER); X+ bsetbit(location[position].objects,VIPER); X fuel -= 2; X gtime++; X puts("You are down."); X@@ -181,7 +181,7 @@ X puts("You hop in the car and turn the key. There is a perceptible grating noise,"); X puts("and an explosion knocks you unconscious..."); X clearbit(location[position].objects,CAR); X- setbit(location[position].objects,CRASH); X+ bsetbit(location[position].objects,CRASH); X injuries[5] = injuries[6] = injuries[7] = injuries[8] = 1; X gtime += 15; X zzz(); X@@ -200,7 +200,7 @@ X puts("forward through bush and fern. You are thrown and the horse gallups off."); X clearbit(location[position].objects,HORSE); X while (!(position = rnd(NUMOFROOMS+1)) || !OUTSIDE || !beenthere[position] || location[position].flyhere); X- setbit(location[position].objects,HORSE); X+ bsetbit(location[position].objects,HORSE); X if (location[position].north) X position = location[position].north; X else if (location[position].south) Xdiff -Naur battlestar.orig/com7.c battlestar/com7.c X--- battlestar.orig/com7.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/com7.c 2012-03-22 13:59:03.000000000 +0100 X@@ -220,7 +220,7 @@ X else { X puts("With his bare hand he deflects the laser blast and whips the pistol from you!"); X clearbit(inven,LASER); X- setbit(location[position].objects,LASER); X+ bsetbit(location[position].objects,LASER); X carrying -= objwt[LASER]; X encumber -= objcumber[LASER]; X } Xdiff -Naur battlestar.orig/externs.h battlestar/externs.h X--- battlestar.orig/externs.h 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/externs.h 2012-03-22 13:59:03.000000000 +0100 X@@ -50,8 +50,8 @@ X #define rnd(x) (random() % (x)) X #define max(a,b) ((a) < (b) ? (b) : (a)) X #define testbit(array, index) (array[index/BITS] & (1 << (index % BITS))) X-#ifndef setbit X-#define setbit(array, index) (array[index/BITS] |= (1 << (index % BITS))) X+#ifndef bsetbit X+#define bsetbit(array, index) (array[index/BITS] |= (1 << (index % BITS))) X #endif X #define clearbit(array, index) (array[index/BITS] &= ~(1 << (index % BITS))) X Xdiff -Naur battlestar.orig/fly.c battlestar/fly.c X--- battlestar.orig/fly.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/fly.c 2012-03-22 13:59:09.000000000 +0100 X@@ -294,6 +294,7 @@ X signal(SIGALRM, SIG_DFL); X mvcur(0,COLS-1,LINES-1,0); X endwin(); X+ setlinebuf(stdout); X signal(SIGTSTP, SIG_DFL); X signal(SIGINT, oldsig); X } Xdiff -Naur battlestar.orig/init.c battlestar/init.c X--- battlestar.orig/init.c 2012-03-22 13:59:00.000000000 +0100 X+++ battlestar/init.c 2012-03-22 13:59:03.000000000 +0100 X@@ -61,11 +61,11 @@ X gtime = 0; X snooze = CYCLE * 1.5; X position = 22; X- setbit(wear, PAJAMAS); X+ bsetbit(wear, PAJAMAS); X fuel = TANKFULL; X torps = TORPEDOES; X for (p = dayobjs; p->room != 0; p++) X- setbit(location[p->room].objects, p->obj); X+ bsetbit(location[p->room].objects, p->obj); X } else X restore(); X signal(SIGINT, die); X@@ -124,10 +124,10 @@ X CUMBER = 3; X WEIGHT = 9; /* that'll get him! */ X gclock = 10; X- setbit(location[7].objects, WOODSMAN); /* viper room */ X- setbit(location[20].objects, WOODSMAN); /* laser " */ X- setbit(location[13].objects, DARK); /* amulet " */ X- setbit(location[8].objects, ELF); /* closet */ X+ bsetbit(location[7].objects, WOODSMAN); /* viper room */ X+ bsetbit(location[20].objects, WOODSMAN); /* laser " */ X+ bsetbit(location[13].objects, DARK); /* amulet " */ X+ bsetbit(location[8].objects, ELF); /* closet */ X } X return 0; /* anything else, Chris? */ X } 3df5abd7894c7f669e31b5a9f0a87ab0 echo x - bsdgames/Makefile sed 's/^X//' >bsdgames/Makefile << '1b8469a0da3b002d2011ae4db2810f35' X# Ports collection makefile for: games X# Date created: 20 Nov 2002 X# Whom: Mark Murray X# X# $FreeBSD: ports/games/bsdgames/Makefile,v 1.29 2010/11/26 08:01:47 uqs Exp $ X# X XPORTNAME= bsdgames XPORTVERSION= 2.4 XPORTREVISION= 1 XPORTEPOCH= 2 XCATEGORIES= games X# Fetched from http://gitweb.dragonflybsd.org/dragonfly.git/tree/v2.4.0:/games X# Content is stable, but file timestamps differ. Bad gitweb, no cookie! XMASTER_SITES= ${MASTER_SITE_LOCAL} XMASTER_SITE_SUBDIR= uqs X XMAINTAINER= uqs@FreeBSD.org XCOMMENT= Traditional BSD games taken from DragonFly BSD X XWRKSRC= ${WRKDIR}/dragonfly XUSE_BZIP2= yes XMAKE_ENV+= NO_WERROR=1 XMAN6= adventure.6 \ X arithmetic.6 \ X atc.6 \ X backgammon.6 \ X battlestar.6 \ X bs.6 \ X canfield.6 \ X cfscores.6 \ X cribbage.6 \ X fish.6 \ X hack.6 \ X hangman.6 \ X hunt.6 \ X huntd.6 \ X larn.6 \ X mille.6 \ X phantasia.6 \ X piano.6 \ X pig.6 \ X quiz.6 \ X rain.6 \ X robots.6 \ X rogue.6 \ X sail.6 \ X snake.6 \ X snscore.6 \ X trek.6 \ X wargames.6 \ X worm.6 \ X worms.6 \ X wump.6 X XMANCOMPRESSED= maybe X X# contain /usr/share/games XSHAREPATH_FILES=atc/atc.6 \ X atc/pathnames.h \ X cribbage/cribbage.6 \ X cribbage/pathnames.h \ X fish/pathnames.h \ X larn/pathnames.h \ X quiz/datfiles/index \ X quiz/pathnames.h \ X quiz/quiz.6 \ X wump/pathnames.h X X# contain /usr/games/* XGAMESPATH_FILES=backgammon/backgammon/backgammon.6 \ X backgammon/common_source/init.c \ X canfield/canfield/canfield.6 \ X cribbage/cribbage.6 \ X hunt/hunt/hunt.6 \ X hunt/huntd/huntd.6 \ X phantasia/pathnames.h \ X wargames/wargames.sh X X# These keep score in /var/games XSGID_BINARIES= atc battlestar canfield/canfield cribbage hack phantasia \ X robots sail snake/snake X Xpost-patch: X @for f in ${SHAREPATH_FILES}; do \ X ${REINPLACE_CMD} -e 's|/usr/share/games|${PREFIX}/share/games|g' \ X ${WRKSRC}/$${f}; \ X done X @for f in ${GAMESPATH_FILES}; do \ X ${REINPLACE_CMD} -e 's|/usr/games|${PREFIX}/bin|g' \ X ${WRKSRC}/$${f}; \ X done X @for f in ${SGID_BINARIES}; do \ X ${REINPLACE_CMD} -e 's/HIDEGAME/SGIDGAME/' \ X ${WRKSRC}/$${f}/Makefile; \ X done X X# Only useful for DESTDIR XVARDIR?= /var X Xpre-su-install: X ${MKDIR} ${VARDIR} X mtree -deU -f ${FILESDIR}/var.mtree -p ${VARDIR} X mtree -deU -f ${FILESDIR}/share.mtree -p ${PREFIX}/share X X.include 1b8469a0da3b002d2011ae4db2810f35 echo x - bsdgames/distinfo sed 's/^X//' >bsdgames/distinfo << '354c1e2600c4cb29368a6a5b96738898' XSHA256 (bsdgames-2.4.tar.bz2) = c89da5b3a63b3d5b4ecb9658a549a0ade114529d10890cd6cf0979a96a28ce19 XSIZE (bsdgames-2.4.tar.bz2) = 2011321 354c1e2600c4cb29368a6a5b96738898 echo x - bsdgames/pkg-descr sed 's/^X//' >bsdgames/pkg-descr << '978b0bfbd3735907eb98559ed653734c' XThis is a port of the BSD "standard" games from Dragonfly BSD which Xincludes many improvements and cleanups from NetBSD and OpenBSD. X XThis source was formerly a part of the FreeBSD base system, but has Xsurvived in the Dragonfly BSD repository. 978b0bfbd3735907eb98559ed653734c echo x - bsdgames/pkg-plist sed 's/^X//' >bsdgames/pkg-plist << 'e01e321a0c35d9902912ae07553c5f8d' X@comment $FreeBSD: ports/games/bsdgames/pkg-plist,v 1.5 2009/12/17 16:45:05 nemoliu Exp $ Xbin/adventure Xbin/arithmetic Xbin/atc Xbin/backgammon Xbin/teachgammon Xbin/battlestar Xbin/bs Xbin/canfield Xbin/cfscores Xbin/cribbage Xbin/fish Xbin/hack Xbin/hangman Xbin/hunt Xbin/huntd Xbin/larn Xbin/mille Xbin/phantasia Xbin/piano Xbin/pig Xbin/quiz Xbin/rain Xbin/robots Xbin/rogue Xbin/sail Xbin/snake Xbin/snscore Xbin/trek Xbin/wargames Xbin/worm Xbin/worms Xbin/wump Xshare/games/atc/Game_List Xshare/games/atc/Killer Xshare/games/atc/crossover Xshare/games/atc/default Xshare/games/atc/easy Xshare/games/atc/game_2 X@dirrm share/games/atc Xshare/games/larn/larnmaze Xshare/games/larn/larnopts Xshare/games/larn/larn.help X@dirrm share/games/larn Xshare/games/quiz.db/africa Xshare/games/quiz.db/america Xshare/games/quiz.db/areas Xshare/games/quiz.db/arith Xshare/games/quiz.db/asia Xshare/games/quiz.db/babies Xshare/games/quiz.db/bard Xshare/games/quiz.db/chinese Xshare/games/quiz.db/collectives Xshare/games/quiz.db/ed Xshare/games/quiz.db/elements Xshare/games/quiz.db/europe Xshare/games/quiz.db/flowers Xshare/games/quiz.db/greek Xshare/games/quiz.db/inca Xshare/games/quiz.db/index Xshare/games/quiz.db/latin Xshare/games/quiz.db/locomotive Xshare/games/quiz.db/midearth Xshare/games/quiz.db/morse Xshare/games/quiz.db/murders Xshare/games/quiz.db/poetry Xshare/games/quiz.db/posneg Xshare/games/quiz.db/pres Xshare/games/quiz.db/province Xshare/games/quiz.db/seq-easy Xshare/games/quiz.db/seq-hard Xshare/games/quiz.db/sexes Xshare/games/quiz.db/sov Xshare/games/quiz.db/spell Xshare/games/quiz.db/state Xshare/games/quiz.db/trek Xshare/games/quiz.db/ucc X@dirrm share/games/quiz.db Xshare/games/cribbage.instr Xshare/games/fish.instr Xshare/games/wump.info X@dirrm share/games X@cwd /var/games X@exec chgrp games /var/games X@dirrmtry atc X@exec mkdir %D/atc X@exec chmod 0775 %D/atc X@dirrmtry battlestar X@exec mkdir %D/battlestar X@exec chmod 0775 %D/battlestar Xhackdir/perm Xhackdir/rumors Xhackdir/help Xhackdir/hh Xhackdir/data Xphantasia/monsters Xphantasia/void X@comment FIXME below are highscores, we should keep them if non-empty X@comment Also, we must make sure to not clobber them upon install XXX Xhackdir/record X@dirrmtry hackdir/save X@dirrmtry hackdir X@exec mkdir -p %D/hackdir/save X@exec chmod 0770 %D/hackdir %D/hackdir/save Xlarn/lscore12.0 Xlarn/llog12.0 X@dirrmtry larn X@exec chmod 0775 %D/larn Xphantasia/characs Xphantasia/gold Xphantasia/lastdead Xphantasia/mess Xphantasia/motd Xphantasia/scoreboard X@dirrmtry phantasia X@exec chmod 0775 %D/phantasia X@comment atc_score Xbattlestar.log Xcfscores Xcriblog Xrobots_roll Xrogue.scores Xsaillog Xsnakerawscores Xsnake.log e01e321a0c35d9902912ae07553c5f8d exit >Release-Note: >Audit-Trail: >Unformatted: