Repository: spack/spack

Issue:
Installation issue: symlinks
symlinks will result in a checksum error.
The date of symlinks-1.4.tar.gz you want to download is October 9, 2009, which is older than September 24, 2020, when the PR for'symlinks' was submitted.
Therefore, it is unlikely that the checksum value will change after submitting the PR, but what should I do?


Discussion:
@darmac can you comment on this? It looks like you added this package and checksum in #18925.
Really? I tried checksum and looks nothing error:
```
[root@Estuary-CentOS8 packages]# spack checksum symlinks
==> Found 1 version of symlinks:
  
  1.4  http://www.ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz

==> Fetching http://www.ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz
#=O#-     #       #                                                                                                                                                                                                                             

    version('1.4', sha256='4818a3be253b53f2547fe51349652c87301794fc2ff4e3104850301ffe9843a0')
```

But when I tried `https` protocal, it's changed:
```
[root@Estuary-CentOS8 packages]# spack checksum symlinks
==> Found 1 version of symlinks:
  
  1.4  https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz

==> Fetching https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz
########################################################################################################################################################################################################################################## 100.0%

    version('1.4', sha256='b0bb689dd0a2c46d9a7dd111b053707aba7b9cf29c4f0bad32984b14bdbe0399')

```

So, should I change `http` to `https`?
thank you for your answer.

In my environment, the same result as https is returned with http.

The following OSS you added also has a checksum error.
http-get, http-ping, http-load, post

Can you try spack checksum with https protocol?
Can you try spack checksum with https protocol?
=>  I get the checksum `b0bb689dd0a2c46d9a7dd111b053707aba7b9cf29c4f0bad32984b14bdbe0399` by using `spack checksum` with symlinks changed to `https` protocol in `package.py`

But sometimes my environment will get different `sha256` with the others.
I'm not sure it's a regional issue or not.

So if you both get the wrong checksum, I can just change it and fix this issue for you.
@t-nojiri  @adamjstewart 
I modified package.py as below and tried the command.
$ diff -u package.py.org package.py
--- package.py.org      2021-01-04 11:58:33.000000000 +0900
+++ package.py  2021-02-02 15:40:02.000000000 +0900
@@ -9,10 +9,10 @@
 class Symlinks(MakefilePackage):
     """Scan or change symbolic links."""

-    homepage = "http://ibiblio.org/pub/Linux/utils/file"
-    url      = "http://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz"
+    homepage = "https://ibiblio.org/pub/Linux/utils/file"
+    url      = "https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz"

-    version('1.4', sha256='4818a3be253b53f2547fe51349652c87301794fc2ff4e3104850301ffe9843a0')
+#    version('1.4', sha256='4818a3be253b53f2547fe51349652c87301794fc2ff4e3104850301ffe9843a0')

     def edit(self, spec, prefix):
         filter_file('/usr/local', prefix, 'Makefile', string=True)

$ spack checksum symlinks
==> Found 1 version of symlinks:

  1.4  https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz

==> Fetching https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz
######################################################################### 100.0%

    version('1.4', sha256='b0bb689dd0a2c46d9a7dd111b053707aba7b9cf29c4f0bad32984b14bdbe0399')
OK, so we can use this patch?
```
diff --git a/var/spack/repos/builtin/packages/symlinks/package.py b/var/spack/repos/builtin/packages/symlinks/package.py
index 8c5f29c956..99257c5ac1 100644
--- a/var/spack/repos/builtin/packages/symlinks/package.py
+++ b/var/spack/repos/builtin/packages/symlinks/package.py
@@ -9,10 +9,10 @@
 class Symlinks(MakefilePackage):
     """Scan or change symbolic links."""
 
-    homepage = "http://ibiblio.org/pub/Linux/utils/file"
-    url      = "http://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz"
+    homepage = "https://ibiblio.org/pub/Linux/utils/file"
+    url      = "https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz"
 
-    version('1.4', sha256='4818a3be253b53f2547fe51349652c87301794fc2ff4e3104850301ffe9843a0')
+    version('1.4', sha256='b0bb689dd0a2c46d9a7dd111b053707aba7b9cf29c4f0bad32984b14bdbe0399')
 
     def edit(self, spec, prefix):
         filter_file('/usr/local', prefix, 'Makefile', string=True)
```
Can someone submit a PR? Doesn't matter who. In general, we should always prefer https, except for the packages needed to bootstrap curl.
For users with general privileges, the following error occurs.
install: cannot change ownership of './spack/opt/spack/linux-rhel8-thunderx2/gcc-8.3.1/symlinks-1.4-q276qpplxdtqyov4v7aji6rce2hlrcg3/bin/symlinks': Operation not permitted

Therefore, the following modifications are required.
     def edit(self, spec, prefix):
         filter_file('/usr/local', prefix, 'Makefile', string=True)
+        filter_file('-o root -g root', '', 'Makefile')


I will issue a PR.
Is that okay?
@t-nojiri  Thanks for that.

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/symlinks/package.py b/var/spack/repos/builtin/packages/symlinks/package.py
--- a/var/spack/repos/builtin/packages/symlinks/package.py
+++ b/var/spack/repos/builtin/packages/symlinks/package.py
@@ -9,13 +9,14 @@
 class Symlinks(MakefilePackage):
     """Scan or change symbolic links."""
 
-    homepage = "http://ibiblio.org/pub/Linux/utils/file"
-    url      = "http://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz"
+    homepage = "https://ibiblio.org/pub/Linux/utils/file"
+    url      = "https://ibiblio.org/pub/Linux/utils/file/symlinks-1.4.tar.gz"
 
-    version('1.4', sha256='4818a3be253b53f2547fe51349652c87301794fc2ff4e3104850301ffe9843a0')
+    version('1.4', sha256='b0bb689dd0a2c46d9a7dd111b053707aba7b9cf29c4f0bad32984b14bdbe0399')
 
     def edit(self, spec, prefix):
         filter_file('/usr/local', prefix, 'Makefile', string=True)
+        filter_file('-o root -g root', '', 'Makefile')
 
     def install(self, spec, prefix):
         mkdirp(prefix.bin)


Test patch: