From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dHu8r-0006FS-TP for guix-patches@gnu.org; Mon, 05 Jun 2017 11:42:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dHu8o-0005DC-JW for guix-patches@gnu.org; Mon, 05 Jun 2017 11:42:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:55204) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dHu8o-0005Ct-5r for guix-patches@gnu.org; Mon, 05 Jun 2017 11:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dHu8n-0002LS-TL for guix-patches@gnu.org; Mon, 05 Jun 2017 11:42:01 -0400 Subject: bug#27250: [PATCH] gnu: crawl: Update to 0.20.0. Resent-Message-ID: References: <9de7211f-6ab6-7a7d-c2a9-ad65f95bbfe4@cock.li> <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com> From: nee Message-ID: <90198a38-ba6a-f627-edae-68d4baf31b8d@cock.li> Date: Mon, 5 Jun 2017 19:41:36 +0200 MIME-Version: 1.0 In-Reply-To: <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com> Content-Type: multipart/mixed; boundary="------------3471048B224340A7766F5386" Content-Language: en-GB List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 27250@debbugs.gnu.org This is a multi-part message in MIME format. --------------3471048B224340A7766F5386 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Am 05.06.2017 um 16:14 schrieb Arun Isaac: > > Thanks! LGTM. Only one problem: crawl-upgrade-saves.patch seems to have > trailing whitespace, and git is complaining about that. Use `git diff > --check' on your commit to see what I mean. Could you fix this and send > a new patch? > > gnu/packages/patches/crawl-upgrade-saves.patch:17: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:32: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:40: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:55: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:63: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:68: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:75: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:81: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:84: trailing whitespace. > ++ > gnu/packages/patches/crawl-upgrade-saves.patch:92: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:100: trailing whitespace. > + > gnu/packages/patches/crawl-upgrade-saves.patch:111: trailing whitespace. > ++ > gnu/packages/patches/crawl-upgrade-saves.patch:115: trailing whitespace. > + > I ran git diff --check HEAD~ on my branch and saw the same warnings. I don't know much about diff and patch, though. What is the correct diff command to generate a patch? I used `diff -crB database.cc database2.cc > crawl-upgrade-saves.patch` and then edited the header myself. Searching for 'diff ' or 'patch' on https://www.gnu.org/software/guix/manual/guix.html doesn't bring up anything related. I did some comparison with other files in ./gnu/packages/patches/ and it seems like `diff -u` generates the format that most files in there have. But it still leaves one trailing whitespace in empty lines. Other .patch files have those too. I attached the commit with the .patch file generated in the diff -u format instead of diff -c. --------------3471048B224340A7766F5386 Content-Type: text/x-patch; name="0001-gnu-crawl-Update-to-0.20.0.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-gnu-crawl-Update-to-0.20.0.patch" =46rom bdcc845e3ff430762efc22af82c54f58c65763f4 Mon Sep 17 00:00:00 2001 From: nee Date: Sun, 4 Jun 2017 17:19:41 +0200 Subject: [PATCH] gnu: crawl: Update to 0.20.0. * gnu/packages/games.scm (crawl)[source]: Add a patch to fix savegame upgrades. Update to 0.20.0. * gnu/packages/patches/crawl-upgrade-saves.patch: New file. * gnu/local.mk (dist_patch_DATA): Add patch. --- gnu/local.mk | 1 + gnu/packages/games.scm | 5 +- gnu/packages/patches/crawl-upgrade-saves.patch | 83 ++++++++++++++++++++= ++++++ 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/crawl-upgrade-saves.patch diff --git a/gnu/local.mk b/gnu/local.mk index e7d5ee2f4..b8a85494d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -550,6 +550,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/cpufrequtils-fix-aclocal.patch \ %D%/packages/patches/cracklib-CVE-2016-6318.patch \ %D%/packages/patches/cracklib-fix-buffer-overflow.patch \ + %D%/packages/patches/crawl-upgrade-saves.patch \ %D%/packages/patches/crda-optional-gcrypt.patch \ %D%/packages/patches/crossmap-allow-system-pysam.patch \ %D%/packages/patches/csound-header-ordering.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index c1993485b..c2c24f3c8 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -3955,7 +3955,7 @@ fish. The whole game is accompanied by quiet, comf= orting music.") (define-public crawl (package (name "crawl") - (version "0.19.5") + (version "0.20.0") (source (origin (method url-fetch) @@ -3969,7 +3969,8 @@ fish. The whole game is accompanied by quiet, comf= orting music.") version "-nodeps.tar.xz"))) (sha256 (base32 - "00yl2lb2shglxlxzpyk99zvglfx4amjybqwnzdcasvbiggb4cj18")))) + "0127dgldij2h4m7cf32yy9ndv4vcz03g4km71lmxrsi5mw7ljgpd")) + (patches (search-patches "crawl-upgrade-saves.patch")))) (build-system gnu-build-system) (inputs `(("lua51" ,lua-5.1) diff --git a/gnu/packages/patches/crawl-upgrade-saves.patch b/gnu/package= s/patches/crawl-upgrade-saves.patch new file mode 100644 index 000000000..301942dc3 --- /dev/null +++ b/gnu/packages/patches/crawl-upgrade-saves.patch @@ -0,0 +1,83 @@ +Store the crawl version in the textdatabases in SAVEDIR and +upgrade the databases when the crawl version changes. + +By default crawl checks for a mtime difference on files in DATADIR to se= e if an +upgrade is required, but guix nulls all file dates, +and crawl would never upgrade saves. + +--- a/source/database.cc 2016-05-31 09:56:08.000000000 +0200 ++++ a/source/database.cc 2017-06-05 03:00:19.270632107 +0200 +@@ -25,6 +25,7 @@ + #include "syscalls.h" + #include "threads.h" + #include "unicode.h" ++#include "version.h" +=20 + // TextDB handles dependency checking the db vs text files, creating th= e + // db, loading, and destroying the DB. +@@ -55,6 +56,7 @@ + vector _input_files; + DBM* _db; + string timestamp; ++ string version; + TextDB *_parent; + const char* lang() { return _parent ? Options.lang_name : 0; } + public: +@@ -165,7 +167,7 @@ +=20 + TextDB::TextDB(const char* db_name, const char* dir, ...) + : _db_name(db_name), _directory(dir), +- _db(nullptr), timestamp(""), _parent(0), translation(0) ++ _db(nullptr), timestamp(""), version(""), _parent(0), translatio= n(0) + { + va_list args; + va_start(args, dir); +@@ -187,7 +189,7 @@ + : _db_name(parent->_db_name), + _directory(parent->_directory + Options.lang_name + "/"), + _input_files(parent->_input_files), // FIXME: pointless copy +- _db(nullptr), timestamp(""), _parent(parent), translation(nullptr= ) ++ _db(nullptr), timestamp(""), version(""), _parent(parent), transl= ation(nullptr) + { + } +=20 +@@ -202,6 +204,9 @@ + return false; +=20 + timestamp =3D _query_database(*this, "TIMESTAMP", false, false, tru= e); ++ version =3D _query_database(*this, "VERSION", false, false, true); ++ if (version.empty()) ++ return false; + if (timestamp.empty()) + return false; +=20 +@@ -245,6 +250,9 @@ + string ts; + bool no_files =3D true; +=20 ++ if (string(Version::Long) !=3D version) ++ return true; ++ + for (const string &file : _input_files) + { + string full_input_path =3D _directory + file; +@@ -261,7 +269,7 @@ + ts +=3D buf; + } +=20 +- if (no_files && timestamp.empty()) ++ if (no_files && timestamp.empty() && version.empty()) + { + // No point in empty databases, although for simplicity keep on= es + // for disappeared translations for now. +@@ -321,7 +329,10 @@ + _store_text_db(full_input_path, _db); + } + } ++ ++ string current_version =3D string(Version::Long); + _add_entry(_db, "TIMESTAMP", ts); ++ _add_entry(_db, "VERSION", current_version); +=20 + dbm_close(_db); + _db =3D 0; --=20 2.13.0 --------------3471048B224340A7766F5386--