From c2d030a8799cad81e07d95a2a820dbd1b4e6aaf6 Mon Sep 17 00:00:00 2001 From: Jukka Jylänki Date: Sat, 25 May 2013 19:29:28 +0300 Subject: Add warning message print to file_packager to warn user when he accidentally specifies --preload-file to an absolute path, as discussed in #486. --- tools/file_packager.py | 2 ++ 1 file changed, 2 insertions(+) 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: -- cgit v1.2.3-18-g5258