aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorarved <arved@FreeBSD.org>2007-08-03 17:02:43 +0800
committerarved <arved@FreeBSD.org>2007-08-03 17:02:43 +0800
commit6d914d2c930a8c20726e47902d43b0e3ede71ae6 (patch)
treeeb090994de4e9234b8615a364eb9cbaeb516eb1c /www
parentfad6a188a69696bcdb0816b5bf64f68dfbf54aef (diff)
downloadfreebsd-ports-gnome-6d914d2c930a8c20726e47902d43b0e3ede71ae6.tar.gz
freebsd-ports-gnome-6d914d2c930a8c20726e47902d43b0e3ede71ae6.tar.zst
freebsd-ports-gnome-6d914d2c930a8c20726e47902d43b0e3ede71ae6.zip
Make podbeuter work with the default configuration.
Obtained from: newsbeuter SVN Reported by: sat
Diffstat (limited to 'www')
-rw-r--r--www/newsbeuter/Makefile1
-rw-r--r--www/newsbeuter/files/patch-configcontainer.cpp86
2 files changed, 87 insertions, 0 deletions
diff --git a/www/newsbeuter/Makefile b/www/newsbeuter/Makefile
index 58851db658a0..6525c4bb606a 100644
--- a/www/newsbeuter/Makefile
+++ b/www/newsbeuter/Makefile
@@ -6,6 +6,7 @@
PORTNAME= newsbeuter
PORTVERSION= 0.5
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://synflood.at/newsbeuter/
diff --git a/www/newsbeuter/files/patch-configcontainer.cpp b/www/newsbeuter/files/patch-configcontainer.cpp
new file mode 100644
index 000000000000..bf2358fb0426
--- /dev/null
+++ b/www/newsbeuter/files/patch-configcontainer.cpp
@@ -0,0 +1,86 @@
+Index: src/configcontainer.cpp
+===================================================================
+--- src/configcontainer.cpp (revision 935)
++++ src/configcontainer.cpp (revision 937)
+@@ -85,43 +85,13 @@
+ return AHS_OK;
+
+ case configdata::STR:
++ case configdata::PATH:
+ if (params.size() < 1) {
+ return AHS_TOO_FEW_PARAMS;
+ }
+ cfgdata.value = params[0];
+ return AHS_OK;
+
+- case configdata::PATH: {
+- if (params.size() < 1) {
+- return AHS_TOO_FEW_PARAMS;
+- }
+-
+- // a path config option is a bit more difficult to handle, because we need to replace
+- // a possible "~/" at the beginning of the string with the user's home directory.
+-
+- const char * homedir;
+- std::string filepath;
+-
+- if (!(homedir = ::getenv("HOME"))) {
+- struct passwd * spw = ::getpwuid(::getuid());
+- if (spw) {
+- homedir = spw->pw_dir;
+- } else {
+- homedir = "";
+- }
+- }
+-
+- if (strcmp(homedir,"")!=0 && params[0].substr(0,2) == "~/") {
+- filepath.append(homedir);
+- filepath.append(1,'/');
+- filepath.append(params[0].substr(2,params[0].length()-2));
+- } else {
+- filepath.append(params[0]);
+- }
+-
+- cfgdata.value = filepath;
+- return AHS_OK;
+- }
+ default:
+ // should not happen
+ return AHS_INVALID_COMMAND;
+@@ -150,7 +120,35 @@
+ }
+
+ std::string configcontainer::get_configvalue(const std::string& key) {
+- return config_data[key].value;
++ std::string retval = config_data[key].value;
++ if (config_data[key].type == configdata::PATH) {
++ const char * homedir;
++ std::string filepath;
++
++ if (!(homedir = ::getenv("HOME"))) {
++ struct passwd * spw = ::getpwuid(::getuid());
++ if (spw) {
++ homedir = spw->pw_dir;
++ } else {
++ homedir = "";
++ }
++ }
++
++ if (strcmp(homedir,"")!=0) {
++ if (retval == "~") {
++ filepath.append(homedir);
++ } else if (retval.substr(0,2) == "~/") {
++ filepath.append(homedir);
++ filepath.append(1,'/');
++ filepath.append(retval.substr(2,retval.length()-2));
++ }
++ } else {
++ filepath.append(retval);
++ }
++ retval = filepath;
++ }
++
++ return retval;
+ }
+
+ int configcontainer::get_configvalue_as_int(const std::string& key) {