Package Details: doukutsu 1.2-7

Git Clone URL: https://aur.archlinux.org/doukutsu.git (read-only, click to copy)
Package Base: doukutsu
Description: Japanese freeware PC side-scrolling platformer game (aka Cave Story)
Upstream URL: http://www.cavestory.org/
Keywords: cavestory Doukutsu Monogatari
Licenses: custom:freeware
Submitter: Nascher
Maintainer: kusanaginoturugi
Last Packager: kusanaginoturugi
Votes: 12
Popularity: 0.000000
First Submitted: 2015-08-12 14:22 (UTC)
Last Updated: 2020-07-23 04:07 (UTC)

Latest Comments

xordspar0 commented on 2021-08-25 17:35 (UTC)

If you have the 290.rec file in ~/.doukutsu/, then the startup script will re-initialize your settings on every startup. 290.rec could be added to the list of ignored files, but this patch just makes sure that all the files in /opt/doukutsu exist in ~/.doukutsu instead of checking that the number of files matches.

From b8ab52f32f6e13ba02dbee55924659cd84d0c373 Mon Sep 17 00:00:00 2001
From: Jordan Christiansen <xordspar0@gmail.com>
Date: Wed, 25 Aug 2021 12:31:33 -0500
Subject: [PATCH] Fix bug where 290.rec would cause config to be reset

Now, instead of checking if the number of files in /opt/doukutsu and
~/.doukutsu matches, we check if each file in /opt/doukutsu exists in
~/doukutsu. The user's directory is allowed to have additional files
that we don't know about.
---
 doukutsu | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/doukutsu b/doukutsu
index 942dcbe..008ce5b 100644
--- a/doukutsu
+++ b/doukutsu
@@ -13,16 +13,17 @@ USERDATADIR=$HOME/.doukutsu
 function create_structure {
     mkdir -p $USERDATADIR
     ln -s -t $USERDATADIR $INSTALLDIR/{doukutsu,doukutsu.bin,DoConfigure,data,doc} 
-    cp $INSTALLDIR/Config.dat $USERDATADIR
-    cd $USERDATADIR
+    test -f $USERDATADIR/Config.dat || cp $INSTALLDIR/Config.dat $USERDATADIR
 }

 function integrity_check {
-    USERFILECOUNT=`find $USERDATADIR -maxdepth 1 | grep -v Profile.dat | grep -v error.log | wc -l`
-    SYSTEMFILECOUNT=`find $INSTALLDIR -maxdepth 1 | grep -v Profile.dat | grep -v error.log | wc -l` 
-    if [ $USERFILECOUNT != $SYSTEMFILECOUNT ]; 
-      then create_structure;
-    fi
+    for expected_file in $(find $INSTALLDIR -mindepth 1 -maxdepth 1 | xargs basename --multiple); do
+        if [ ! -e "$USERDATADIR/$expected_file" ]; then
+            printf '%s does not exist\n' "$USERDATADIR/$expected_file"
+            create_structure
+            break
+        fi
+    done
 }

 while getopts "ch" options; do
@@ -38,13 +39,6 @@ while getopts "ch" options; do
     esac
 done

-if [ -d $USERDATADIR ]; then
-    integrity_check
-
-    cd $USERDATADIR
-    exec ./doukutsu $@
-else
-    create_structure
-
-    exec ./doukutsu $@
-fi
+integrity_check
+cd $USERDATADIR
+exec ./doukutsu $@
-- 
2.33.0