summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Strogin <stefan.strogin@gmail.com>2019-03-03 17:19:47 +0200
committerJames Le Cuirot <chewi@gentoo.org>2019-03-04 20:48:48 +0000
commit248251bc5b1dfbcec32db163495310f15c0b9d9f (patch)
treee3595a5ebf3f752e5bb239fa42b1979de89b1a49 /dev-games/physfs
parentRevert "sys-apps/accountsservice: version bump to 0.6.54" (diff)
downloadgentoo-248251bc5b1dfbcec32db163495310f15c0b9d9f.tar.gz
gentoo-248251bc5b1dfbcec32db163495310f15c0b9d9f.tar.bz2
gentoo-248251bc5b1dfbcec32db163495310f15c0b9d9f.zip
dev-games/physfs: backport patch to fix PHYSFS_setWriteDir
There was a bug in PHYSFS_setWriteDir() that caused creating an empty file "$HOME/.lincity-ng" instead of a directory on the first run of lincity-ng: https://github.com/lincity-ng/lincity-ng/issues/25 The upstream patch is added to <stable-3.0> branch but no release is made so far. Backport it. Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Stefan Strogin <stefan.strogin@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/11231 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'dev-games/physfs')
-rw-r--r--dev-games/physfs/files/physfs-3.0.1-setwritedir.patch40
-rw-r--r--dev-games/physfs/physfs-3.0.1-r2.ebuild (renamed from dev-games/physfs/physfs-3.0.1-r1.ebuild)4
2 files changed, 43 insertions, 1 deletions
diff --git a/dev-games/physfs/files/physfs-3.0.1-setwritedir.patch b/dev-games/physfs/files/physfs-3.0.1-setwritedir.patch
new file mode 100644
index 000000000000..9673e12a2b23
--- /dev/null
+++ b/dev-games/physfs/files/physfs-3.0.1-setwritedir.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Backport
+[https://hg.icculus.org/icculus/physfs/rev/a29fef4a20fd]
+
+# HG changeset patch
+# User Ryan C. Gordon <icculus@icculus.org>
+# Date 1526514891 14400
+# Node ID a29fef4a20fd79ead82998c91dc4828ed5061cb5
+# Parent db8f944df5c56f0244229813203fb5b24e8d9968
+PHYSFS_setWriteDir() shouldn't create an empty file if the dir doesn't exist.
+(transplanted from 2653b3bc19c9ba7d1e6bf53566719e4e30935382)
+
+diff -r db8f944df5c5 -r a29fef4a20fd src/physfs.c
+--- a/src/physfs.c Thu Apr 19 10:06:38 2018 -0400
++++ b/src/physfs.c Wed May 16 19:54:51 2018 -0400
+@@ -879,13 +879,20 @@
+
+ if (io == NULL)
+ {
++ /* file doesn't exist, etc? Just fail out. */
++ PHYSFS_Stat statbuf;
++ BAIL_IF_ERRPASS(!__PHYSFS_platformStat(d, &statbuf, 1), NULL);
++
+ /* DIR gets first shot (unlike the rest, it doesn't deal with files). */
+- retval = tryOpenDir(io, &__PHYSFS_Archiver_DIR, d, forWriting, &claimed);
+- if (retval || claimed)
+- return retval;
++ if (statbuf.filetype == PHYSFS_FILETYPE_DIRECTORY)
++ {
++ retval = tryOpenDir(io, &__PHYSFS_Archiver_DIR, d, forWriting, &claimed);
++ if (retval || claimed)
++ return retval;
++ } /* if */
+
+ io = __PHYSFS_createNativeIo(d, forWriting ? 'w' : 'r');
+- BAIL_IF_ERRPASS(!io, 0);
++ BAIL_IF_ERRPASS(!io, NULL);
+ created_io = 1;
+ } /* if */
+
+
diff --git a/dev-games/physfs/physfs-3.0.1-r1.ebuild b/dev-games/physfs/physfs-3.0.1-r2.ebuild
index 237ccc126998..79ee475a7b89 100644
--- a/dev-games/physfs/physfs-3.0.1-r1.ebuild
+++ b/dev-games/physfs/physfs-3.0.1-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -17,6 +17,8 @@ DEPEND="doc? ( app-doc/doxygen )"
DOCS=( docs/CHANGELOG.txt docs/CREDITS.txt docs/TODO.txt )
+PATCHES=( "${FILESDIR}/${P}-setwritedir.patch" )
+
multilib_src_configure() {
local mycmakeargs=(
-DPHYSFS_BUILD_SHARED=ON