aboutsummaryrefslogtreecommitdiff
path: root/offlineimap/expandvars.patch
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2016-07-29 20:06:28 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2016-07-29 21:44:23 +0200
commitdb211c7f310a5de18c7803a1ebfbb7ab2b1e3f0d (patch)
tree01459134ef2b03b3c5191d61f9243c8bb1d169a5 /offlineimap/expandvars.patch
parente382c9379e58e4ab12814115e344d1eb96a855e0 (diff)
downloaddotfiles-db211c7f310a5de18c7803a1ebfbb7ab2b1e3f0d.tar.gz
dotfiles-db211c7f310a5de18c7803a1ebfbb7ab2b1e3f0d.zip
make my dotfiles location independent
This is achieved by storing the absolute path to the dotfile directory in the variable $DOTFILES_LOCATION. And change every hardcoded location into the dotfiles with this var. The Variable $DOTFILES_LOCATION populated with the output of get_dotfiles_location.sh at 3 places: 1) config.fish | zshrc 2) xinitrc (should be allready exported) get_dotfiles_location uses the assumption that it is symlinked into the dotfiles directory. offlineimap: * include patch for offlineimap * change config to the small one * include environment file in systemd unit setup.py: * handle offlineimap situation * print a warning and prompt for proceeding * write the environment file for the systemd unit * add pseudo dependency (get_dotfiles_location) to [fish-config, offlineimap, i3] * print errors on stderr * don't exit if a function fails config.fish: * export $DOTFILES_LOCATION * change hardcoded links * add perl tools to path * export some yaourt specific vars if yaourt is available zshrc: export $DOTFILES_LOCATION xinitrc: export $DOTFILES_LOCATION i3/*: change hardcoded links scripts/* change hardcoded links README.md: mention $DOTFILES_LOCATION
Diffstat (limited to 'offlineimap/expandvars.patch')
-rw-r--r--offlineimap/expandvars.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/offlineimap/expandvars.patch b/offlineimap/expandvars.patch
new file mode 100644
index 0000000..3f36fae
--- /dev/null
+++ b/offlineimap/expandvars.patch
@@ -0,0 +1,13 @@
+diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py
+index e61f53d..8da0e19 100644
+--- a/offlineimap/repository/IMAP.py
++++ b/offlineimap/repository/IMAP.py
+@@ -378,7 +378,7 @@ class IMAPRepository(BaseRepository):
+ # 3. read password from file specified in Repository 'remotepassfile'
+ passfile = self.getconf('remotepassfile', None)
+ if passfile != None:
+- fd = codecs.open(os.path.expanduser(passfile), 'r', 'UTF-8')
++ fd = codecs.open(os.path.expandvars(os.path.expanduser(passfile)), 'r', 'UTF-8')
+ password = fd.readline().strip()
+ fd.close()
+ return password.encode('UTF-8')