| Summary: | Allow @sample keyword reference a symlink | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Jan Beich <jbeich> | ||||||
| Component: | Ports Framework | Assignee: | freebsd-ports-bugs (Nobody) <ports-bugs> | ||||||
| Status: | Closed Works As Intended | ||||||||
| Severity: | Affects Only Me | CC: | koobs, portmgr | ||||||
| Priority: | --- | Keywords: | feature, needs-qa, patch | ||||||
| Version: | Latest | ||||||||
| Hardware: | Any | ||||||||
| OS: | Any | ||||||||
| See Also: |
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196431 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=196435 |
||||||||
| Attachments: |
|
||||||||
I think @sample works as intented, if there is a symlink, the content should be copied so that it can be modified and the sample stay pristine. Also, I think the ports using @sample with symlinks should be fixed. What port does that ? My intention was to allow security/ca_root_nss ignore cert.pem if already exists. The port currently installs the following symlinks and would benefit from @sample or another way to not overwrite user certificates. /etc/ssl/cert.pem (not default, may change per bug 189811) /usr/local/etc/ssl/cert.pem (since ports r372629) /usr/local/openssl/cert.pem (soon, bug 196431) And some linux-* ports like linux-f10-fontconfig can allow users to override config files with a version taking into account differences between linux and native version, e.g. depending on bug 179400. Created attachment 151204 [details]
copy symlink itself instead of destination, v2
Added -h to chmod/cmp as only rm(1) in sample.ucl is an exception according to symlink(7).
+1 I like :) I understand replacing -f with -e, and replacing cmp -s with cmp -h -s, but I don't understand the rest of the patch Re-add meta after mid-air collision with antoine@. (In reply to Antoine Brodin from comment #5) > I understand replacing -f with -e, and replacing cmp -s with cmp -h -s, > but I don't understand the rest of the patch cp -R is a hack it uses the fact that when doing a cp -R, symlinks are copied instead of dereferenced. chmod -h is so that the chmod is applied to the the link and not the target. I still don't like it, I find it way better to install the target of the symlink so that it can be modified than copying the symlink which, if modified, will be overwritten on next upgrade. (In reply to Mathieu Arnold from comment #7) > I still don't like it, I find it way better to install the target of the > symlink so that it can be modified than copying the symlink which, if > modified, will be overwritten on next upgrade. Indeed, firing up a text editor on /etc/ssl/cert.pem would try to alter contents of symlink destination. It wasn't very clear in comment 1 what sample symlink content mean, the link with .sample suffix stripped or its destination. @sample in bug 196431 should work fine without the patch here. It'd install 3 copies of the same sample file but user can make one main and the rest point to it (e.g. bug 196435). |
Created attachment 151203 [details] copy symlink itself instead of destination A port may install one or more symlinks to default content. Sometimes a user already created a file instead of symlink with alternate contents. Otherwise, @sample would copy symlink into a regular file which is unintuitive.