* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
@ 2017-06-05 13:31 nee
2017-06-05 14:14 ` Arun Isaac
[not found] ` <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com>
0 siblings, 2 replies; 13+ messages in thread
From: nee @ 2017-06-05 13:31 UTC (permalink / raw)
To: 27250
[-- Attachment #1: Type: text/plain, Size: 721 bytes --]
Hello, this updates crawl to 0.20.0 which came out about a week ago.
crawl-tiles indirectly updated through inheritance.
I also wrote a patch to make crawl upgrade cached strings in the SAVEDIR
by release version in addition to mtime. Without this patch crawl will
not detect that there is a new version installed and will not upgrade
files in ~/.crawl/saves/db/, because guix sets all the timestamps on the
installed files to 1970.
I will attempt to get this patch into crawl master.
Announcement for this release:
https://crawl.develz.org/wordpress/crawl-0-20-scarf-our-wanderful-fried-frogs
Changelog for this release:
https://github.com/crawl/crawl/blob/stone_soup-0.20/crawl-ref/docs/changelog.txt
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-crawl-Update-to-0.20.0.patch --]
[-- Type: text/x-patch; name="0001-gnu-crawl-Update-to-0.20.0.patch", Size: 6061 bytes --]
From 3aa8588481fb11a3abaa07d754f768b95433aede Mon Sep 17 00:00:00 2001
From: nee <nee.git@cock.li>
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 | 117 +++++++++++++++++++++++++
3 files changed, 121 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 = \
%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, comforting 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, comforting 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/packages/patches/crawl-upgrade-saves.patch
new file mode 100644
index 000000000..c6b6b53bc
--- /dev/null
+++ b/gnu/packages/patches/crawl-upgrade-saves.patch
@@ -0,0 +1,117 @@
+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 see 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
+--- b/source/database.cc 2017-06-05 02:25:44.080149014 +0200
+***************
+*** 25,30 ****
+--- 25,31 ----
+ #include "syscalls.h"
+ #include "threads.h"
+ #include "unicode.h"
++ #include "version.h"
+
+ // TextDB handles dependency checking the db vs text files, creating the
+ // db, loading, and destroying the DB.
+***************
+*** 55,60 ****
+--- 56,62 ----
+ vector<string> _input_files;
+ DBM* _db;
+ string timestamp;
++ string version;
+ TextDB *_parent;
+ const char* lang() { return _parent ? Options.lang_name : 0; }
+ public:
+***************
+*** 165,171 ****
+
+ TextDB::TextDB(const char* db_name, const char* dir, ...)
+ : _db_name(db_name), _directory(dir),
+! _db(nullptr), timestamp(""), _parent(0), translation(0)
+ {
+ va_list args;
+ va_start(args, dir);
+--- 167,173 ----
+
+ TextDB::TextDB(const char* db_name, const char* dir, ...)
+ : _db_name(db_name), _directory(dir),
+! _db(nullptr), timestamp(""), version(""), _parent(0), translation(0)
+ {
+ va_list args;
+ va_start(args, dir);
+***************
+*** 187,193 ****
+ : _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)
+ {
+ }
+
+--- 189,195 ----
+ : _db_name(parent->_db_name),
+ _directory(parent->_directory + Options.lang_name + "/"),
+ _input_files(parent->_input_files), // FIXME: pointless copy
+! _db(nullptr), timestamp(""), version(""), _parent(parent), translation(nullptr)
+ {
+ }
+
+***************
+*** 202,207 ****
+--- 204,212 ----
+ return false;
+
+ timestamp = _query_database(*this, "TIMESTAMP", false, false, true);
++ version = _query_database(*this, "VERSION", false, false, true);
++ if (version.empty())
++ return false;
+ if (timestamp.empty())
+ return false;
+
+***************
+*** 245,250 ****
+--- 250,258 ----
+ string ts;
+ bool no_files = true;
+
++ if (string(Version::Long) != version)
++ return true;
++
+ for (const string &file : _input_files)
+ {
+ string full_input_path = _directory + file;
+***************
+*** 261,267 ****
+ ts += buf;
+ }
+
+! if (no_files && timestamp.empty())
+ {
+ // No point in empty databases, although for simplicity keep ones
+ // for disappeared translations for now.
+--- 269,275 ----
+ ts += buf;
+ }
+
+! if (no_files && timestamp.empty() && version.empty())
+ {
+ // No point in empty databases, although for simplicity keep ones
+ // for disappeared translations for now.
+***************
+*** 321,327 ****
+--- 329,338 ----
+ _store_text_db(full_input_path, _db);
+ }
+ }
++
++ string current_version = string(Version::Long);
+ _add_entry(_db, "TIMESTAMP", ts);
++ _add_entry(_db, "VERSION", current_version);
+
+ dbm_close(_db);
+ _db = 0;
--
2.13.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
2017-06-05 13:31 bug#27250: [PATCH] gnu: crawl: Update to 0.20.0 nee
@ 2017-06-05 14:14 ` Arun Isaac
2017-06-05 15:54 ` Leo Famulari
[not found] ` <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com>
1 sibling, 1 reply; 13+ messages in thread
From: Arun Isaac @ 2017-06-05 14:14 UTC (permalink / raw)
To: nee; +Cc: 27250
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.
+
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
2017-06-05 14:14 ` Arun Isaac
@ 2017-06-05 15:54 ` Leo Famulari
2017-06-06 8:27 ` Arun Isaac
[not found] ` <51e0342f.AEUAK9NcTPcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNmdv@mailjet.com>
0 siblings, 2 replies; 13+ messages in thread
From: Leo Famulari @ 2017-06-05 15:54 UTC (permalink / raw)
To: 27250, arunisaac, nee
Generally, I think it's fine if the patches we include contain whitespace issues.
-------- Original Message --------
From: Arun Isaac <arunisaac@systemreboot.net>
Sent: June 5, 2017 10:14:18 AM EDT
To: nee <nee@cock.li>
Cc: 27250@debbugs.gnu.org
Subject: bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
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.
+
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
2017-06-05 15:54 ` Leo Famulari
@ 2017-06-06 8:27 ` Arun Isaac
[not found] ` <51e0342f.AEUAK9NcTPcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNmdv@mailjet.com>
1 sibling, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2017-06-06 8:27 UTC (permalink / raw)
To: Leo Famulari; +Cc: 27250
Leo Famulari writes:
> Generally, I think it's fine if the patches we include contain
> whitespace issues.
Ok, I'll ignore the whitespace issues.
@nee:
For some reason, the `check' phase of `crawl' seems to be failing on my
machine. Did the build complete successfully on yours?
[C], function generate_level, line -1
unique.lua, function test_uniques, line 5
unique.lua, function test_uniques_blank, line 26
unique.lua, function run_unique_tests, line 65
unique.lua, function (null), line 73
Lua persistent data:
<<<<<<<<<<<<<<<<<<<<<<
bailey_type: bailey_axe
ice_cave_hard: false
tomb_guardian_sets:
1: 3
2: 3
3: 4
4: 3
5: 4
6: 3
aquarium_serial_pool_size: 1
grunt_iron_hall_animated: false
>>>>>>>>>>>>>>>>>>>>>>
Lua marker contents:
<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>
make: *** [Makefile:1767: test-test] Error 124
make: Leaving directory '/tmp/guix-build-crawl-0.20.0.drv-0/stone_soup-0.20.0/source'
phase `check' failed after 1291.6 seconds
builder for `/gnu/store/66h101ccsvhv6nkj4w444ks59kanbjaq-crawl-0.20.0.drv' failed with exit code 1
@ build-failed /gnu/store/66h101ccsvhv6nkj4w444ks59kanbjaq-crawl-0.20.0.drv - 1 builder for `/gnu/store/66h101ccsvhv6nkj4w444ks59kanb
jaq-crawl-0.20.0.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/66h101ccsvhv6nkj4w444ks59kanbjaq-crawl-0.20.0.drv' failed
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <51e0342f.AEUAK9NcTPcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNmdv@mailjet.com>]
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
[not found] ` <51e0342f.AEUAK9NcTPcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNmdv@mailjet.com>
@ 2017-06-06 17:56 ` nee
2017-06-07 18:24 ` Arun Isaac
[not found] ` <cu7shjbbqqo.fsf@systemreboot.net>
0 siblings, 2 replies; 13+ messages in thread
From: nee @ 2017-06-06 17:56 UTC (permalink / raw)
To: 27250
Am 06.06.2017 um 10:27 schrieb Arun Isaac:> For some reason, the `check'
phase of `crawl' seems to be failing on my
> machine. Did the build complete successfully on yours?
>
> [C], function generate_level, line -1
> unique.lua, function test_uniques, line 5
> unique.lua, function test_uniques_blank, line 26
> unique.lua, function run_unique_tests, line 65
> unique.lua, function (null), line 73
>
> Lua persistent data:
> <<<<<<<<<<<<<<<<<<<<<<
> bailey_type: bailey_axe
> ice_cave_hard: false
> tomb_guardian_sets:
> 1: 3
> 2: 3
> 3: 4
> 4: 3
> 5: 4
> 6: 3
>
> aquarium_serial_pool_size: 1
> grunt_iron_hall_animated: false
>>>>>>>>>>>>>>>>>>>>>>>
>
> Lua marker contents:
> <<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>
> make: *** [Makefile:1767: test-test] Error 124
> make: Leaving directory
'/tmp/guix-build-crawl-0.20.0.drv-0/stone_soup-0.20.0/source'
> phase `check' failed after 1291.6 seconds
> builder for
`/gnu/store/66h101ccsvhv6nkj4w444ks59kanbjaq-crawl-0.20.0.drv' failed
with exit code 1
> @ build-failed
/gnu/store/66h101ccsvhv6nkj4w444ks59kanbjaq-crawl-0.20.0.drv - 1 builder
for `/gnu/store/66h101ccsvhv6nkj4w444ks59kanb
> jaq-crawl-0.20.0.drv' failed with exit code 1
> guix build: error: build failed: build of
`/gnu/store/66h101ccsvhv6nkj4w444ks59kanbjaq-crawl-0.20.0.drv' failed
>
I ran the build 9 times trying to reproduce it, but every time all 29
tests succeeded. I'm building on x86_64 on GuixSD, using `./pre-inst-env
guix build crawl --rounds=9` on the commit I sent in last.
@arun sorry for the second mail, forgot to reply to list
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
2017-06-06 17:56 ` nee
@ 2017-06-07 18:24 ` Arun Isaac
2017-06-07 19:20 ` Leo Famulari
[not found] ` <cu7shjbbqqo.fsf@systemreboot.net>
1 sibling, 1 reply; 13+ messages in thread
From: Arun Isaac @ 2017-06-07 18:24 UTC (permalink / raw)
To: nee; +Cc: 27250
> I ran the build 9 times trying to reproduce it, but every time all 29
> tests succeeded. I'm building on x86_64 on GuixSD, using `./pre-inst-env
> guix build crawl --rounds=9` on the commit I sent in last.
I must admit I am mystified. I hope I didn't mess up somehow while
applying your patch. I will reapply your patch to a fresh branch and try
again. Meanwhile, could you rebase against the latest master, and try
building again? Maybe, a change to some other package breaks the crawl
tests.
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
2017-06-07 18:24 ` Arun Isaac
@ 2017-06-07 19:20 ` Leo Famulari
2017-06-08 15:16 ` Arun Isaac
[not found] ` <cu78tl25x2y.fsf@systemreboot.net>
0 siblings, 2 replies; 13+ messages in thread
From: Leo Famulari @ 2017-06-07 19:20 UTC (permalink / raw)
To: Arun Isaac; +Cc: 27250
[-- Attachment #1: Type: text/plain, Size: 688 bytes --]
On Wed, Jun 07, 2017 at 11:54:31PM +0530, Arun Isaac wrote:
>
> > I ran the build 9 times trying to reproduce it, but every time all 29
> > tests succeeded. I'm building on x86_64 on GuixSD, using `./pre-inst-env
> > guix build crawl --rounds=9` on the commit I sent in last.
>
> I must admit I am mystified. I hope I didn't mess up somehow while
> applying your patch. I will reapply your patch to a fresh branch and try
> again. Meanwhile, could you rebase against the latest master, and try
> building again? Maybe, a change to some other package breaks the crawl
> tests.
Another option is that the tests are affected by differences in the host
kernel or filesystem.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
2017-06-07 19:20 ` Leo Famulari
@ 2017-06-08 15:16 ` Arun Isaac
[not found] ` <cu78tl25x2y.fsf@systemreboot.net>
1 sibling, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2017-06-08 15:16 UTC (permalink / raw)
To: Leo Famulari; +Cc: 27250
> Another option is that the tests are affected by differences in the host
> kernel or filesystem.
That too.
@nee:
I am now facing similar problems with crawl-tiles as well. I am going
out of town tonight. I'll be back on Saturday, and explore this more
fully. Sorry for the delay.
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <cu78tl25x2y.fsf@systemreboot.net>]
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
[not found] ` <cu78tl25x2y.fsf@systemreboot.net>
@ 2017-06-10 11:39 ` Arun Isaac
[not found] ` <5e315f5d.AEAALOqVmtgAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZO9qA@mailjet.com>
1 sibling, 0 replies; 13+ messages in thread
From: Arun Isaac @ 2017-06-10 11:39 UTC (permalink / raw)
To: 27250
I'm unable to figure out the issue. This being just a simple update
patch, I think I'll just push it, and we'll see what happens at the
build servers. If there are subsequent problems, we'll fix it up
later. WDYT?
^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <5e315f5d.AEAALOqVmtgAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZO9qA@mailjet.com>]
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
[not found] ` <5e315f5d.AEAALOqVmtgAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZO9qA@mailjet.com>
@ 2017-06-10 19:10 ` nee
2017-06-12 9:36 ` Arun Isaac
0 siblings, 1 reply; 13+ messages in thread
From: nee @ 2017-06-10 19:10 UTC (permalink / raw)
To: 27250
[-- Attachment #1: Type: text/plain, Size: 686 bytes --]
Am 10.06.2017 um 13:39 schrieb Arun Isaac:
>
> I'm unable to figure out the issue. This being just a simple update
> patch, I think I'll just push it, and we'll see what happens at the
> build servers. If there are subsequent problems, we'll fix it up
> later. WDYT?
>
Okay, maybe the buildfarm can give us some hints about this problem. In
the meantime there was another commit updating crawl to 0.20. I rebased
my patch to it. Please use this one. I tested it with --rounds=2 and
didn't run into any problems.
I also rebuilt 0.19.5 again and noticed that the 0.20 release adds 2 new
test cases. I haven't looked into them, but that could narrow down the
location of the problem.
[-- Attachment #2: 0001-gnu-crawl-Add-a-patch-to-fix-savegame-upgrades.patch --]
[-- Type: text/x-patch, Size: 4795 bytes --]
From 5954d907008c07a06bdbfb129383eaf7813ea358 Mon Sep 17 00:00:00 2001
From: nee <nee.git@cock.li>
Date: Sat, 10 Jun 2017 20:27:58 +0200
Subject: [PATCH] gnu: crawl: Add a patch to fix savegame upgrades.
* gnu/packages/games.scm (crawl)[source]: Add a patch to fix savegame
upgrades.
* 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 | 3 +-
gnu/packages/patches/crawl-upgrade-saves.patch | 83 ++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/crawl-upgrade-saves.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 686c3c639..ddf05c706 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -550,6 +550,7 @@ dist_patch_DATA = \
%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 a76ab1ddc..4a5b94ab7 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -4049,7 +4049,8 @@ fish. The whole game is accompanied by quiet, comforting music.")
version "-nodeps.tar.xz")))
(sha256
(base32
- "0127dgldij2h4m7cf32yy9ndv4vcz03g4km71lmxrsi5mw7ljgpd"))))
+ "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/packages/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 see 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"
+
+ // TextDB handles dependency checking the db vs text files, creating the
+ // db, loading, and destroying the DB.
+@@ -55,6 +56,7 @@
+ vector<string> _input_files;
+ DBM* _db;
+ string timestamp;
++ string version;
+ TextDB *_parent;
+ const char* lang() { return _parent ? Options.lang_name : 0; }
+ public:
+@@ -165,7 +167,7 @@
+
+ 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), translation(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), translation(nullptr)
+ {
+ }
+
+@@ -202,6 +204,9 @@
+ return false;
+
+ timestamp = _query_database(*this, "TIMESTAMP", false, false, true);
++ version = _query_database(*this, "VERSION", false, false, true);
++ if (version.empty())
++ return false;
+ if (timestamp.empty())
+ return false;
+
+@@ -245,6 +250,9 @@
+ string ts;
+ bool no_files = true;
+
++ if (string(Version::Long) != version)
++ return true;
++
+ for (const string &file : _input_files)
+ {
+ string full_input_path = _directory + file;
+@@ -261,7 +269,7 @@
+ ts += buf;
+ }
+
+- if (no_files && timestamp.empty())
++ if (no_files && timestamp.empty() && version.empty())
+ {
+ // No point in empty databases, although for simplicity keep ones
+ // for disappeared translations for now.
+@@ -321,7 +329,10 @@
+ _store_text_db(full_input_path, _db);
+ }
+ }
++
++ string current_version = string(Version::Long);
+ _add_entry(_db, "TIMESTAMP", ts);
++ _add_entry(_db, "VERSION", current_version);
+
+ dbm_close(_db);
+ _db = 0;
--
2.13.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
[parent not found: <cu7shjbbqqo.fsf@systemreboot.net>]
[parent not found: <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com>]
* bug#27250: [PATCH] gnu: crawl: Update to 0.20.0.
[not found] ` <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com>
@ 2017-06-05 17:41 ` nee
0 siblings, 0 replies; 13+ messages in thread
From: nee @ 2017-06-05 17:41 UTC (permalink / raw)
To: 27250
[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-crawl-Update-to-0.20.0.patch --]
[-- Type: text/x-patch; name="0001-gnu-crawl-Update-to-0.20.0.patch", Size: 5181 bytes --]
From bdcc845e3ff430762efc22af82c54f58c65763f4 Mon Sep 17 00:00:00 2001
From: nee <nee.git@cock.li>
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 = \
%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, comforting 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, comforting 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/packages/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 see 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"
+
+ // TextDB handles dependency checking the db vs text files, creating the
+ // db, loading, and destroying the DB.
+@@ -55,6 +56,7 @@
+ vector<string> _input_files;
+ DBM* _db;
+ string timestamp;
++ string version;
+ TextDB *_parent;
+ const char* lang() { return _parent ? Options.lang_name : 0; }
+ public:
+@@ -165,7 +167,7 @@
+
+ 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), translation(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), translation(nullptr)
+ {
+ }
+
+@@ -202,6 +204,9 @@
+ return false;
+
+ timestamp = _query_database(*this, "TIMESTAMP", false, false, true);
++ version = _query_database(*this, "VERSION", false, false, true);
++ if (version.empty())
++ return false;
+ if (timestamp.empty())
+ return false;
+
+@@ -245,6 +250,9 @@
+ string ts;
+ bool no_files = true;
+
++ if (string(Version::Long) != version)
++ return true;
++
+ for (const string &file : _input_files)
+ {
+ string full_input_path = _directory + file;
+@@ -261,7 +269,7 @@
+ ts += buf;
+ }
+
+- if (no_files && timestamp.empty())
++ if (no_files && timestamp.empty() && version.empty())
+ {
+ // No point in empty databases, although for simplicity keep ones
+ // for disappeared translations for now.
+@@ -321,7 +329,10 @@
+ _store_text_db(full_input_path, _db);
+ }
+ }
++
++ string current_version = string(Version::Long);
+ _add_entry(_db, "TIMESTAMP", ts);
++ _add_entry(_db, "VERSION", current_version);
+
+ dbm_close(_db);
+ _db = 0;
--
2.13.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
end of thread, other threads:[~2017-06-12 9:37 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-05 13:31 bug#27250: [PATCH] gnu: crawl: Update to 0.20.0 nee
2017-06-05 14:14 ` Arun Isaac
2017-06-05 15:54 ` Leo Famulari
2017-06-06 8:27 ` Arun Isaac
[not found] ` <51e0342f.AEUAK9NcTPcAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNmdv@mailjet.com>
2017-06-06 17:56 ` nee
2017-06-07 18:24 ` Arun Isaac
2017-06-07 19:20 ` Leo Famulari
2017-06-08 15:16 ` Arun Isaac
[not found] ` <cu78tl25x2y.fsf@systemreboot.net>
2017-06-10 11:39 ` Arun Isaac
[not found] ` <5e315f5d.AEAALOqVmtgAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZO9qA@mailjet.com>
2017-06-10 19:10 ` nee
2017-06-12 9:36 ` Arun Isaac
[not found] ` <cu7shjbbqqo.fsf@systemreboot.net>
2017-06-07 19:26 ` Arun Isaac
[not found] ` <4577ad88.AEUAK6w8Z7kAAAAAAAAAAAO0_XAAAAACwQwAAAAAAAW9WABZNWdE@mailjet.com>
2017-06-05 17:41 ` nee
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).