#21 Fix overquoting for ${cmd}
Merged 2 years ago by pbokoc. Opened 2 years ago by siosm.
fedora-docs/ siosm/template overquoting  into  main

file modified
+4 -4
@@ -10,7 +10,7 @@ 

      echo ""

      echo "This build script is using Docker container runtime to run the build in an isolated environment."

      echo ""

-     docker run --rm -it -v "$(pwd):/antora" "${image}" "${cmd}"

+     docker run --rm -it -v "$(pwd):/antora" "${image}" ${cmd}

  

  elif uname | grep -iq linux; then

      # Running on Linux.
@@ -26,7 +26,7 @@ 

          echo ""

          echo "This build script is using Podman to run the build in an isolated environment."

          echo ""

-         podman run --rm -it -v "$(pwd):/antora:z" "${image}" "${cmd}"

+         podman run --rm -it -v "$(pwd):/antora:z" "${image}" ${cmd}

  

      elif [ -f /usr/bin/docker ]; then

          echo ""
@@ -34,14 +34,14 @@ 

          echo ""

  

          if groups | grep -wq "docker"; then

-             docker run --rm -it -v "$(pwd):/antora:z" "${image}" "${cmd}"

+             docker run --rm -it -v "$(pwd):/antora:z" "${image}" ${cmd}

          else

              echo "You might be asked for your password."

              echo "You can avoid this by adding your user to the 'docker' group,"

              echo "but be aware of the security implications."

              echo "See https://docs.docker.com/install/linux/linux-postinstall/"

              echo ""

-             sudo docker run --rm -it -v "$(pwd):/antora:z" "${image}" "${cmd}"

+             sudo docker run --rm -it -v "$(pwd):/antora:z" "${image}" ${cmd}

          fi

      else

          echo ""

Fixes:

$ ./build.sh

This build script is using Podman to run the build in an isolated environment.

antora: option '--html-url-extension-style <choice>' argument 'indexify site.yml' is invalid. Allowed choices are default, drop, indexify.

Patch works for me.

On Fedora 36 (branched) the preview web server serves website, but prints exceptions. They do not happen with the same file each time. Sometimes you must kill preview with Ctrl+c and restart it. The patch does not cause it. How to proceed with this?

$ ./preview.sh 

The preview is available at http://localhost:8080

Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
127.0.0.1 - - [05/Mar/2022 11:52:17] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [05/Mar/2022 11:52:17] "GET /pizza-factory/ HTTP/1.1" 200 -
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 59664)
Traceback (most recent call last):
  File "/usr/lib64/python3.10/socketserver.py", line 683, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/lib64/python3.10/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib64/python3.10/http/server.py", line 653, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/lib64/python3.10/socketserver.py", line 747, in __init__
    self.handle()
  File "/usr/lib64/python3.10/http/server.py", line 427, in handle
    self.handle_one_request()
  File "/usr/lib64/python3.10/http/server.py", line 415, in handle_one_request
    method()
  File "/usr/lib64/python3.10/http/server.py", line 660, in do_GET
    self.copyfile(f, self.wfile)
  File "/usr/lib64/python3.10/http/server.py", line 860, in copyfile
    shutil.copyfileobj(source, outputfile)
  File "/usr/lib64/python3.10/shutil.py", line 198, in copyfileobj
    fdst_write(buf)
  File "/usr/lib64/python3.10/socketserver.py", line 826, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
...

@sobek that indeed seems like an unrelated issue. I'm going to merge this PR; I'd suggest you start a thread on the forums here if the problem persists and hopefully someone will be able to help: https://discussion.fedoraproject.org/tag/docs

Pull-Request has been merged by pbokoc

2 years ago
Metadata