[tor-commits] [sbws/master] Make symlink relative ...

pastly at torproject.org pastly at torproject.org
Tue Jun 26 15:36:49 UTC 2018


commit e59349c8c95b5fe749aaeda32333515aa1122e6d
Author: Matt Traudt <sirmatt at ksu.edu>
Date:   Thu Jun 14 18:25:21 2018 -0400

    Make symlink relative ...
    
    I think this is the more common way to do things. It allows you to move
    the files around without the symlink breaking.
---
 sbws/lib/v3bwfile.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sbws/lib/v3bwfile.py b/sbws/lib/v3bwfile.py
index ddfefe7..9b8e2e8 100644
--- a/sbws/lib/v3bwfile.py
+++ b/sbws/lib/v3bwfile.py
@@ -414,9 +414,10 @@ class V3BwFile(object):
                     fd.write(str(self.header))
                     for line in self.bw_lines:
                         fd.write(str(line))
+                output_basename = os.path.basename(output)
                 log.debug('Creating symlink from {} to {}.'
-                          .format(output, out_link))
-                os.symlink(output, out_link)
+                          .format(output_basename, out_link))
+                os.symlink(output_basename, out_link)
         else:
             with open(output, 'wt') as fd:
                 fd.write(str(self.header))





More information about the tor-commits mailing list