Skip to content
Snippets Groups Projects
Unverified Commit 1601193e authored by Christian Heusel's avatar Christian Heusel Committed by GitHub
Browse files

likwid: Fix the perms script (#48666)


* likwid: Fix the perms script

The script loops over the path (which includes the prefix), but
additionally adds the prefix up front which results in duplicate paths
and a double "/" in the command like in the following one:

    chown root:root /opt/csg/spack/opt/spack/linux-debian12-zen2/gcc-12.2.0/likwid-5.4.1-xfc6quebnf2kosydl3ospaeoskxnxwhn//opt/csg/spack/opt/spack/linux-debian12-zen2/gcc-12.2.0/likwid-5.4.1-xfc6quebnf2kosydl3ospaeoskxnxwhn/sbin/likwid-accessD

Additionally the path is currently not quoted which can potentially
result in word splitting for weird paths.

Signed-off-by: default avatarChristian Heusel <christian@heusel.eu>

* likwid: Make the perm scripts' name unique

Also move it into the proper binary folder as per the Filesystem
Hierarchy Standard.

Signed-off-by: default avatarChristian Heusel <christian@heusel.eu>

---------

Signed-off-by: default avatarChristian Heusel <christian@heusel.eu>
parent 9c5b3ccb
No related branches found
No related tags found
No related merge requests found
...@@ -260,8 +260,8 @@ def install(self, spec, prefix): ...@@ -260,8 +260,8 @@ def install(self, spec, prefix):
@run_after("install") @run_after("install")
def caveats(self): def caveats(self):
if self.spec.satisfies("accessmode=accessdaemon"): if self.spec.satisfies("accessmode=accessdaemon"):
perm_script = "spack_perms_fix.sh" perm_script = "spack_likwid_fix_perms.sh.j2"
perm_script_path = join_path(self.spec.prefix, perm_script) perm_script_path = join_path(self.spec.prefix.bin, perm_script)
daemons = glob.glob(join_path(self.spec.prefix, "sbin", "*")) daemons = glob.glob(join_path(self.spec.prefix, "sbin", "*"))
with open(perm_script_path, "w") as f: with open(perm_script_path, "w") as f:
env = spack.tengine.make_environment(dirs=self.package_dir) env = spack.tengine.make_environment(dirs=self.package_dir)
......
#!/bin/sh -eu #!/bin/sh -eu
{% for cf in chowns %} {% for cf in chowns %}
chown root:root {{ prefix }}/{{ cf }} chown root:root "{{ cf }}"
{% endfor %} {% endfor %}
{% for sf in chmods %} {% for sf in chmods %}
chmod 4755 {{ prefix }}/{{ sf }} chmod 4755 "{{ sf }}"
{% endfor %} {% endfor %}
# end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment