Newbie developer: /bin/sh sees command with arguments as name for binary

Julian Groß via gnome-devel-list <[email protected]> Sun, 14 Mar 2021 15:11:58 +0100
Newsgroups gmane.comp.gnome.devel
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============4746352447664142977==
Content-Type: multipart/alternative;
 boundary="------------F926600334924045829A1156"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------F926600334924045829A1156
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit

Hello,

I am in the process of adding multi-threaded support to file-roller. 
Unfortunately I have run into a weird problem where the command that 
gets generated for `tar` works in terminal but not inside file-roller. 
Somehow /bin/sh seems to interpret whatever you give to 
--use-compress-program="" as a binary rather than a binary and an argument.
This is what I currently have: 
https://gitlab.gnome.org/jug007/file-roller/-/merge_requests/1/diffs
The lbzip2 code at line 217 in src/fr-command-tar.c is what I am 
currently working with. Compressing something to tar.bz2 with lbzip2 
installed fails since /bin/sh cannot find the command "lbzip2 -n 1".
The code for actually running the command seems to be in 
src/fr-process.c line 944, but I cannot really make any sense of it. I 
am pretty much a complete newbie and this is my first time working on a 
program in C.
I would appreciate if someone could take a look at the code and see if 
they can find out what is going wrong.

By the way, and example command that is generated by file-roller is:
tar --force-local --no-recursion --no-wildcards -v -p -C 
/home/motofckr9k/osc/home:JulianGro/vircadia-domain -cf 
/home/motofckr9k/osc/home:JulianGro/vircadia-domain/.fr-F2ZXj4/vircadia-2021.1.0.tar.bz2 
--use-compress-program='lbzip2 -n 1' -T 
/home/motofckr9k/.cache/.fr-Wc4QJ1/file-list --

Error message is:
/bin/sh: 1: lbzip2 -n 1: not found


Greetings
Julian Groß

--------------F926600334924045829A1156
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <font face="Ubuntu">Hello,<br>
      <br>
      I am in the process of adding multi-threaded support to
      file-roller. Unfortunately I have run into a weird problem where
      the command that gets generated for `tar` works in terminal but
      not inside file-roller. Somehow /bin/sh seems to interpret
      whatever you give to --use-compress-program="" as a binary rather
      than a binary and an argument.<br>
      This is what I currently have:
      <a class="moz-txt-link-freetext" href="https://gitlab.gnome.org/jug007/file-roller/-/merge_requests/1/diffs">https://gitlab.gnome.org/jug007/file-roller/-/merge_requests/1/diffs</a><br>
      The lbzip2 code at line 217 in src/fr-command-tar.c is what I am
      currently working with. Compressing something to tar.bz2 with
      lbzip2 installed fails since /bin/sh cannot find the command
      "lbzip2 -n 1".<br>
      The code for actually running the command seems to be in
      src/fr-process.c line 944, but I cannot really make any sense of
      it. I am pretty much a complete newbie and this is my first time
      working on a program in C.<br>
      I would appreciate if someone could take a look at the code and
      see if they can find out what is going wrong.<br>
      <br>
      By the way, and example command that is generated by file-roller
      is:<br>
      tar --force-local --no-recursion --no-wildcards -v -p -C
      /home/motofckr9k/osc/home:JulianGro/vircadia-domain -cf
/home/motofckr9k/osc/home:JulianGro/vircadia-domain/.fr-F2ZXj4/vircadia-2021.1.0.tar.bz2
      --use-compress-program='lbzip2 -n 1' -T
      /home/motofckr9k/.cache/.fr-Wc4QJ1/file-list --<br>
      <br>
      Error message is:<br>
      /bin/sh: 1: lbzip2 -n 1: not found<br>
      <br>
      <br>
      Greetings<br>
      Julian Groß<br>
    </font>
  </body>
</html>

--------------F926600334924045829A1156--

--===============4746352447664142977==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnome-devel-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gnome-devel-list

--===============4746352447664142977==--