[wiki] [sites] Add the cachedir patch to customize the cache dir via command line. || David Carey

From: <git_AT_suckless.org>
Date: Mon, 31 Aug 2020 21:52:37 +0200

commit 1153911147e84632244645f4e91815b2024f5bf5
Author: David Carey <david_AT_davidpcarey.com>
Date: Mon Aug 31 14:50:59 2020 -0500

    Add the cachedir patch to customize the cache dir via command line.

diff --git a/surf.suckless.org/patches/cachedir/index.md b/surf.suckless.org/patches/cachedir/index.md
new file mode 100644
index 00000000..c12f8c5d
--- /dev/null
+++ b/surf.suckless.org/patches/cachedir/index.md
_AT_@ -0,0 +1,13 @@
+Cachedir
+========
+Use the -h command-line tag to determine a custom cache directory.
+
+ surf -h /path/to/cache/directory
+
+Download
+--------
+* [surf-cachedir-20200831-2188894.diff](surf-cachedir-20200831-2188894.diff)
+
+Author
+------
+* David Carey <david_AT_davidpcarey.com>
diff --git a/surf.suckless.org/patches/cachedir/surf-cachedir-20200831-2188894.diff b/surf.suckless.org/patches/cachedir/surf-cachedir-20200831-2188894.diff
new file mode 100644
index 00000000..0d147a77
--- /dev/null
+++ b/surf.suckless.org/patches/cachedir/surf-cachedir-20200831-2188894.diff
_AT_@ -0,0 +1,36 @@
+From 2188894f8e6b1d2232a77b06d07776bdd6bdb4f3 Mon Sep 17 00:00:00 2001
+From: David Carey <david_AT_davidpcarey.com>
+Date: Mon, 31 Aug 2020 14:03:17 -0500
+Subject: [PATCH] Allow custom cache directory via CLI argument.
+
+---
+ surf.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/surf.c b/surf.c
+index 2b54e3c..8436ded 100644
+--- a/surf.c
++++ b/surf.c
+_AT_@ -306,7 +306,8 @@ usage(void)
+ {
+ die("usage: surf [-bBdDfFgGiIkKmMnNpPsStTvwxX]
"
+ "[-a cookiepolicies ] [-c cookiefile] [-C stylefile] [-e xid]
"
+- "[-r scriptfile] [-u useragent] [-z zoomlevel] [uri]
");
++ "[-h cachedir] [-r scriptfile] [-u useragent]
"
++ "[-z zoomlevel] [uri]
");
+ }
+
+ void
+_AT_@ -2026,6 +2027,9 @@ main(int argc, char *argv[])
+ defconfig[Geolocation].val.i = 1;
+ defconfig[Geolocation].prio = 2;
+ break;
++ case 'h':
++ cachedir = EARGF(usage());
++ break;
+ case 'i':
+ defconfig[LoadImages].val.i = 0;
+ defconfig[LoadImages].prio = 2;
+--
+2.28.0
+
Received on Mon Aug 31 2020 - 21:52:37 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 31 2020 - 22:00:47 CEST