From 78098bab96c0228d700978492152ba3c2a872d2b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 19 Apr 2014 23:29:33 +0200 Subject: platform: Allow custom platform file before install The new environment variable, PASSWORD_STORE_PLATFORM_FILE is now used for loading custom platform files while pass lives as src/password-store.sh. After it is installed using 'make install', this environment variable is no longer used, and either no platform file is loaded (if the default platform is acceptable), or a hardcoded also-installed platform file is referenced. Signed-off-by: Jason A. Donenfeld --- Makefile | 6 ++++-- src/password-store.sh | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index bee69e1..ed81e82 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,13 @@ ifneq ($(strip $(wildcard $(PLATFORMFILE))),) install: install-common @install -m 0644 -v "$(PLATFORMFILE)" "$(DESTDIR)$(LIBDIR)/password-store.platform.sh" @mkdir -p -v "$(DESTDIR)$(BINDIR)/" - sed 's:.*platform-defined-functions.*:source $(DESTDIR)$(LIBDIR)/password-store.platform.sh:' src/password-store.sh > "$(DESTDIR)$(BINDIR)/pass" + sed 's:.*PASSWORD_STORE_PLATFORM_FILE.*:source "$(DESTDIR)$(LIBDIR)/password-store.platform.sh":' src/password-store.sh > "$(DESTDIR)$(BINDIR)/pass" @chmod 0755 "$(DESTDIR)$(BINDIR)/pass" else install: install-common - @install -m 0755 -v src/password-store.sh "$(DESTDIR)$(BINDIR)/pass" + @mkdir -p -v "$(DESTDIR)$(BINDIR)/" + sed '/PASSWORD_STORE_PLATFORM_FILE/d' src/password-store.sh > "$(DESTDIR)$(BINDIR)/pass" + @chmod 0755 "$(DESTDIR)$(BINDIR)/pass" endif uninstall: diff --git a/src/password-store.sh b/src/password-store.sh index eb98fad..e350c46 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -177,7 +177,7 @@ tmpdir() { GETOPT="getopt" SHRED="shred -f -z" -# source /path/to/platform-defined-functions +source "$PASSWORD_STORE_PLATFORM_FILE" 2>/dev/null # # END platform definable -- cgit v1.2.3-54-g00ecf 5e50182b846bc6'/>
Commit message (Expand)AuthorFilesLines
2015-01-13Handle being given numbers as feed nameAntonio Terceiro2-0/+16
2015-01-13Rakefile: remove wrong (and thus unused) flagAntonio Terceiro1-1/+0
2015-01-13Remove deprecated 'test suite' fileAntonio Terceiro1-12/+0
2015-01-13Rakefile: re-indentAntonio Terceiro1-35/+35
2015-01-13Rakefile: run tests in verbose modeAntonio Terceiro1-1/+2
2014-10-071.2.3 releaseAntonio Terceiro1-1/+1
2014-10-07Fix cleanup of maildirsAntonio Terceiro3-1/+16
2014-05-18feed2imap-test: reuse cache dir/protect configAntonio Terceiro1-1/+1
2014-02-13feed2imap-test: can now take a feed URL as argumentAntonio Terceiro1-3/+22
2014-02-13update .gitignoreAntonio Terceiro1-0/+2
2014-02-13fix dependency on ruby-feedparserAntonio Terceiro1-1/+1
2014-02-05Release 1.2.2Antonio Terceiro2-2/+2
2014-02-05config: fix regression with arrays as targetAntonio Terceiro2-1/+17
2013-08-28Fix teardown method nameAntonio Terceiro1-1/+1