]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
buildman: patman: Fix -H when installed as a symlink
authorSimon Glass <sjg@chromium.org>
Mon, 7 Mar 2016 02:45:34 +0000 (19:45 -0700)
committerSimon Glass <sjg@chromium.org>
Mon, 14 Mar 2016 21:34:50 +0000 (15:34 -0600)
It is convenient to install symlinks to buildman and patman in the search
patch, such as /usr/local/bin. But when this is done, the -H option fails to
work because it looks in the directory containing the symlink instead of its
target. Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
tools/buildman/control.py
tools/patman/patman.py

index 8b3cd30c00119aa990cc0dcc22aa627aa567b400..c2c54bf0e81b63676279391cec512358ee10bdcd 100644 (file)
@@ -101,7 +101,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         pager = os.getenv('PAGER')
         if not pager:
             pager = 'more'
-        fname = os.path.join(os.path.dirname(sys.argv[0]), 'README')
+        fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
+                             'README')
         command.Run(pager, fname)
         return 0
 
index d05c5ff8e1d317a240896f04b5f03a642b743c6b..fe50eb4d5c8322b9b4a07a767a44c05523f614b8 100755 (executable)
@@ -117,7 +117,8 @@ elif options.full_help:
     pager = os.getenv('PAGER')
     if not pager:
         pager = 'more'
-    fname = os.path.join(os.path.dirname(sys.argv[0]), 'README')
+    fname = os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),
+                         'README')
     command.Run(pager, fname)
 
 # Process commits, produce patches files, check them, email them