Will Salmon pushed to branch willsalmon/simpleOutSource at BuildStream / buildstream
Commits:
- 
90ea7130
by William Salmon at 2018-09-10T12:10:13Z
 
4 changed files:
- buildstream/buildelement.py
 - buildstream/element.py
 - buildstream/storage/_filebaseddirectory.py
 - tests/format/variables.py
 
Changes:
| ... | ... | @@ -139,7 +139,6 @@ class BuildElement(Element): | 
| 139 | 139 | 
 | 
| 140 | 140 | 
         return dictionary
 | 
| 141 | 141 | 
 | 
| 142 | 
-  | 
|
| 143 | 142 | 
     def command_subdir(self, build_root):
 | 
| 144 | 143 | 
         command_subdir = self.get_variable('command-subdir')
 | 
| 145 | 144 | 
         if command_subdir:
 | 
| ... | ... | @@ -1860,7 +1860,7 @@ class Element(Plugin): | 
| 1860 | 1860 | 
 | 
| 1861 | 1861 | 
             # Run shells with network enabled and readonly root.
 | 
| 1862 | 1862 | 
             return sandbox.run(argv, flags, env=environment)
 | 
| 1863 | 
-        
 | 
|
| 1863 | 
+  | 
|
| 1864 | 1864 | 
     def prepare_buildroot(self, root):
 | 
| 1865 | 1865 | 
         # This allows anything inheriting to use this as a handy hook
 | 
| 1866 | 1866 | 
         pass
 | 
| ... | ... | @@ -1890,7 +1890,8 @@ class Element(Plugin): | 
| 1890 | 1890 | 
                             .format(self.normal_name)) as temp:
 | 
| 1891 | 1891 | 
             for source in self.sources():
 | 
| 1892 | 1892 | 
                 source._init_workspace(temp)
 | 
| 1893 | 
-                ## why is this not just source.stage()?????????!!!!!!1111oneonei
 | 
|
| 1893 | 
+                # Why is this not just source.stage()
 | 
|
| 1894 | 
+  | 
|
| 1894 | 1895 | 
             self.prepare_buildroot(temp)
 | 
| 1895 | 1896 | 
             # Now hardlink the files into the workspace target.
 | 
| 1896 | 1897 | 
             utils.link_files(temp, workspace.get_absolute_path())
 | 
| ... | ... | @@ -71,9 +71,11 @@ class FileBasedDirectory(Directory): | 
| 71 | 71 | 
         # bizarre errors, so check for it here
 | 
| 72 | 72 | 
         if not isinstance(subdirectory_spec, list):
 | 
| 73 | 73 | 
             subdirectory_spec = [subdirectory_spec]
 | 
| 74 | 
-        print ('subdirectory_spec', subdirectory_spec)
 | 
|
| 75 | 
-        while '.' in subdirectory_spec: subdirectory_spec.remove('.')
 | 
|
| 76 | 
-        #todo make this fix handle all file inc ../thing
 | 
|
| 74 | 
+  | 
|
| 75 | 
+        # This is hear so that valid addresses that contain "." are handled
 | 
|
| 76 | 
+        # without error, possible due to joining addresses which contain "."
 | 
|
| 77 | 
+        while '.' in subdirectory_spec:
 | 
|
| 78 | 
+            subdirectory_spec.remove('.')
 | 
|
| 77 | 79 | 
 | 
| 78 | 80 | 
         # Because of the way split works, it's common to get a list which begins with
 | 
| 79 | 81 | 
         # an empty string. Detect these and remove them.
 | 
| ... | ... | @@ -19,7 +19,8 @@ DATA_DIR = os.path.join( | 
| 19 | 19 | 
 @pytest.mark.parametrize("target,varname,expected", [
 | 
| 20 | 20 | 
     ('autotools.bst', 'make-install', "make -j1 DESTDIR=\"/buildstream-install\" install"),
 | 
| 21 | 21 | 
     ('cmake.bst', 'cmake',
 | 
| 22 | 
-     "cmake -B_builddir -H. -G\"Unix Makefiles\" -DCMAKE_INSTALL_PREFIX:PATH=\"/usr\" \\\n" +
 | 
|
| 22 | 
+     "cmake -B_builddir -H\"/buildstream/pony/cmake.bst/././\" -G\"Unix Makefiles\" " +
 | 
|
| 23 | 
+     "-DCMAKE_INSTALL_PREFIX:PATH=\"/usr\" \\\n" +
 | 
|
| 23 | 24 | 
      "-DCMAKE_INSTALL_LIBDIR=lib   "),
 | 
| 24 | 25 | 
     ('distutils.bst', 'python-install',
 | 
| 25 | 26 | 
      "python3 setup.py install --prefix \"/usr\" \\\n" +
 | 
| ... | ... | @@ -45,7 +46,8 @@ def test_defaults(cli, datafiles, tmpdir, target, varname, expected): | 
| 45 | 46 | 
 @pytest.mark.parametrize("target,varname,expected", [
 | 
| 46 | 47 | 
     ('autotools.bst', 'make-install', "make -j1 DESTDIR=\"/custom/install/root\" install"),
 | 
| 47 | 48 | 
     ('cmake.bst', 'cmake',
 | 
| 48 | 
-     "cmake -B_builddir -H. -G\"Ninja\" -DCMAKE_INSTALL_PREFIX:PATH=\"/opt\" \\\n" +
 | 
|
| 49 | 
+     "cmake -B_builddir -H\"/buildstream/pony/cmake.bst/././\" -G\"Ninja\" " +
 | 
|
| 50 | 
+     "-DCMAKE_INSTALL_PREFIX:PATH=\"/opt\" \\\n" +
 | 
|
| 49 | 51 | 
      "-DCMAKE_INSTALL_LIBDIR=lib   "),
 | 
| 50 | 52 | 
     ('distutils.bst', 'python-install',
 | 
| 51 | 53 | 
      "python3 setup.py install --prefix \"/opt\" \\\n" +
 | 
