[Notes] [Git][BuildStream/buildstream][tristan/stop-stripping-whitespace] 2 commits: buildelement.py: Strip the commands fed to the shell



Title: GitLab

Tristan Van Berkom pushed to branch tristan/stop-stripping-whitespace at BuildStream / buildstream

Commits:

5 changed files:

Changes:

  • buildstream/buildelement.py
    ... ... @@ -293,6 +293,13 @@ class BuildElement(Element):
    293 293
             return commands
    
    294 294
     
    
    295 295
         def __run_command(self, sandbox, cmd, cmd_name):
    
    296
    +
    
    297
    +        # Because of variable expansion, sometimes the command
    
    298
    +        # may have trailing whitespace or newlines, strip this
    
    299
    +        # out and ensure we feed a sanitized string to the shell.
    
    300
    +        #
    
    301
    +        cmd = cmd.strip()
    
    302
    +
    
    296 303
             # Note the -e switch to 'sh' means to exit with an error
    
    297 304
             # if any untested command fails.
    
    298 305
             #
    

  • tests/cachekey/project/elements/build1.expected
    1
    -dadb8f86874f714b4f6d4c9025332934efb7e85c38f6a68b1267746ae8f43f24
    1
    +c5f3e9cfa9f884582a693dfb8b0bf7cb667c3d56e4ce628ce68ccea181a7616a
    \ No newline at end of file

  • tests/cachekey/project/elements/build2.expected
    1
    -f81cefce283dd3581ba2fc865ff9c2763119274b114b12edb4e87196cfff8b2a
    1
    +53f7822567b3a2c62849e806dba31cc7e5a9ac4e30243927b7fb49c12ee48848
    \ No newline at end of file

  • tests/cachekey/project/sources/pip1.expected
    1
    -09d873158f35ea64e67919373a6cfbd4aaba9321b817c89317b1350da8267318
    \ No newline at end of file
    1
    +2e88fa60ed789a4eeb554db33fdd1a7c77cc767df223d3cc339154abf774a740
    \ No newline at end of file

  • tests/cachekey/project/target.expected
    1
    -92dae6a712b4f91f4fdbdf8dad732cf07ff4da092a319fa4f4b261a9287640de
    1
    +b73203c1ee5c19e3ef35dd56900856b09603adb68877da861bbe0a29bf4b2ee0
    \ No newline at end of file



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]