From owner-svn-ports-head@freebsd.org Thu Feb 1 17:31:37 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7313EDFFAE; Thu, 1 Feb 2018 17:31:36 +0000 (UTC) (envelope-from pawel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE6B792A1; Thu, 1 Feb 2018 17:31:36 +0000 (UTC) (envelope-from pawel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DB401005D; Thu, 1 Feb 2018 17:31:36 +0000 (UTC) (envelope-from pawel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11HVaGu051811; Thu, 1 Feb 2018 17:31:36 GMT (envelope-from pawel@FreeBSD.org) Received: (from pawel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11HVapd051809; Thu, 1 Feb 2018 17:31:36 GMT (envelope-from pawel@FreeBSD.org) Message-Id: <201802011731.w11HVapd051809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pawel set sender to pawel@FreeBSD.org using -f From: Pawel Pekala Date: Thu, 1 Feb 2018 17:31:36 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r460620 - in head/games/keeperrl: . files X-SVN-Group: ports-head X-SVN-Commit-Author: pawel X-SVN-Commit-Paths: in head/games/keeperrl: . files X-SVN-Commit-Revision: 460620 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 17:31:37 -0000 Author: pawel Date: Thu Feb 1 17:31:35 2018 New Revision: 460620 URL: https://svnweb.freebsd.org/changeset/ports/460620 Log: Add patch that forces configuration files in $H/.KeeperRL directory instead of current working directory Added: head/games/keeperrl/files/ head/games/keeperrl/files/patch-main.cpp (contents, props changed) Modified: head/games/keeperrl/Makefile Modified: head/games/keeperrl/Makefile ============================================================================== --- head/games/keeperrl/Makefile Thu Feb 1 17:29:09 2018 (r460619) +++ head/games/keeperrl/Makefile Thu Feb 1 17:31:35 2018 (r460620) @@ -2,6 +2,7 @@ PORTNAME= keeperrl PORTVERSION= 0.0.${ALPHA_VERSION} +PORTREVISION= 1 CATEGORIES= games MAINTAINER= pawel@FreeBSD.org Added: head/games/keeperrl/files/patch-main.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/keeperrl/files/patch-main.cpp Thu Feb 1 17:31:35 2018 (r460620) @@ -0,0 +1,43 @@ +--- main.cpp.orig 2018-01-31 20:31:47 UTC ++++ main.cpp +@@ -22,6 +22,7 @@ + #include "extern/ProgramOptions.h" + + #include ++#include + + #include "view.h" + #include "options.h" +@@ -285,18 +286,8 @@ static int keeperMain(po::parser& commandLineFlags) { + DirectoryPath userPath([&] () -> string { + if (commandLineFlags["user_dir"].was_set()) + return commandLineFlags["user_dir"].get().string; +-#ifdef USER_DIR +- else if (const char* userDir = USER_DIR) +- return userDir; +-#endif // USER_DIR +-#ifndef WINDOWS +- else if (const char* localPath = std::getenv("XDG_DATA_HOME")) +- return localPath + string("/KeeperRL"); +-#endif +-#ifdef ENABLE_LOCAL_USER_DIR // Some environments don't define XDG_DATA_HOME + else if (const char* homePath = std::getenv("HOME")) +- return homePath + string("/.local/share/KeeperRL"); +-#endif // ENABLE_LOCAL_USER_DIR ++ return homePath + string("/.KeeperRL"); + else + return "."; + }()); +@@ -311,8 +302,10 @@ static int keeperMain(po::parser& commandLineFlags) { + #else + uploadUrl = "http://localhost/~michal/" + serverVersion; + #endif +- //userPath.createIfDoesntExist(); +- CHECK(userPath.exists()) << "User directory \"" << userPath << "\" doesn't exist."; ++ if (!userPath.exists()) { ++ auto configDir = userPath.file(""); ++ ::mkdir(configDir.getPath(), 0775); ++ } + auto settingsPath = userPath.file("options.txt"); + if (commandLineFlags["restore_settings"].was_set()) + remove(settingsPath.getPath());