aboutsummaryrefslogtreecommitdiff
path: root/tools/file_packager.py
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-05-25 19:29:28 +0300
committerJukka Jylänki <jujjyl@gmail.com>2013-05-25 19:29:28 +0300
commitc2d030a8799cad81e07d95a2a820dbd1b4e6aaf6 (patch)
treea0b67b43032846f52ea2493e63da3137de512eba /tools/file_packager.py
parentcd7b997cbb84f8b6fe9a0ad06b80ff50674bb028 (diff)
Add warning message print to file_packager to warn user when he accidentally specifies --preload-file to an absolute path, as discussed in #486.
Diffstat (limited to 'tools/file_packager.py')
-rw-r--r--tools/file_packager.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/file_packager.py b/tools/file_packager.py
index c801fe81..8af6676c 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -120,6 +120,8 @@ for arg in sys.argv[1:]:
srcpath, dstpath = arg.split('@') # User is specifying destination filename explicitly.
else:
srcpath = dstpath = arg # Use source path as destination path.
+ if os.path.isabs(dstpath):
+ print >> sys.stderr, 'Warning: Embedding an absolute file/directory name "' + dstpath + '" to the virtual filesystem. The file will be made available in the path "' + dstpath + '", and not in the root of the generated file system. Use the explicit syntax --preload-file srcpath@dstpath to specify the target location the absolute source path should be directed to.'
if os.path.isfile(srcpath) or os.path.isdir(srcpath):
data_files.append({ 'srcpath': srcpath, 'dstpath': dstpath, 'mode': mode })
else: