diff options
author | Zeeshan Ali <zeenix@collabora.co.uk> | 2018-09-24 09:54:20 +0200 |
---|---|---|
committer | Zeeshan Ali <zeenix@collabora.co.uk> | 2018-09-24 19:28:05 +0200 |
commit | b5bddfaeacfc97a3f9ee0f95bb19cf26b990f3a8 (patch) | |
tree | 10feaa940c0049209eff05249887156d1cb3fb57 /demo/install-file.py | |
parent | 1d965f9b1e18d00feddc0fb8dae784f044b36625 (diff) | |
download | geoclue-wip/fix-autostart.tar.gz |
build: Install demo agent to autostart directory toowip/fix-autostart
We were doing this already but forgot to port this from autotools to meson.
Diffstat (limited to 'demo/install-file.py')
-rw-r--r-- | demo/install-file.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/demo/install-file.py b/demo/install-file.py new file mode 100644 index 0000000..e06d9df --- /dev/null +++ b/demo/install-file.py @@ -0,0 +1,26 @@ +#!/bin/python3 + +# A simple script that copies a given file (first arg) to a given location +# (second arg). + +import sys +import os +from shutil import copy + +if len(sys.argv) < 3: + print('Usage: ' + sys.argv[0] + ' SOURCE_FILE DESTINATION_DIR') + + sys.exit(-1) + +try: + dest_dir = os.environ['DESTDIR'] + '/' + sys.argv[2] +except KeyError: + dest_dir = sys.argv[2] + +try: + if not os.path.exists(dest_dir): + os.makedirs(dest_dir) +except OSError: + print ('Error: Creating directory. ' + dest_dir) + +copy(sys.argv[1], dest_dir) |