Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2880

Define interpreters for package modules

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.13.0, 3.12.2
    • Component/s: None
    • Labels:
      None

      Description

      We need agreement with Nick Anderson regarding where and how to define it best, and afterwards Vratislav Podzimek volunteered to implement it.

      Package modules in masterfiles/modules/packages are scripts - this is good.

      But they are executable via shebangs as the first line - this is bad for several reasons:

      • one script might get executed by different interpreters on different platforms (see for example header for apt_get module which is python3/2 module with #!/bin/sh shebang)
      • some platforms might not have concept of shebangs - moreover, for them every program you start must be a compiled binary file (hi Windows)

      Best solution for this is to put somewhere in policy rules that "this package module should be executed with this interpreter" (by default the file gets executed by itself) - then we can differentiate between platforms, OS versions, and interpreter availability.

      For example, for Windows (msiexec package module) it should be ${Cmd} /c, where Cmd holds path to cmd.exe and can be taken from environment variable like this:

       vars:
        "Cmd" string    => getenv("ComSpec", "100");
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vpodzime Vratislav Podzimek
                Reporter:
                Aleksei Aleksei Shpakovskii
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: