Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install: support old ln versions without the -r option #154

Merged
merged 1 commit into from
Sep 18, 2019
Merged

install: support old ln versions without the -r option #154

merged 1 commit into from
Sep 18, 2019

Conversation

casantos
Copy link
Contributor

Oldish enterprise-class distributions have too old versions of
coreutils, with ln not supporting -r.

So we fake it.

ln -r would create minimalist relative paths, but they are not
trivial to generate. Instead, we always create paths relative to the
root, i.e.:

ln -s -r /usr/bin/foo /usr/sbin/foo

would create: /usr/sbin/foo -> ../bin/foo
while we do : /usr/sbin/foo -> ../../usr/bin/foo

Signed-off-by: Olivier Schonken olivier.schonken@gmail.com

@tillkamppeter
Copy link
Member

tillkamppeter commented Sep 16, 2019

There should be some switch in ./configure to detect whether "ln -r" is availableand then be used "ln -r" or the alternative/workaround.
Does your workaround work for any combination of CUPS and cups-filters being in /usr or /usr/local?

@casantos
Copy link
Contributor Author

There should be some switch in ./configure to detect whether "ln -r" is availableand then be used "ln -r" or the alternative/workaround.

I agree but at the moment I'm focusing on the functionality.

Does your workaround work for any combination of CUPS and cups-filters being in /usr or /usr/local?

I just submitted an update that uses a shell script to mimic ln -r. It meets that requirement.

@casantos casantos changed the title install: don't use ln -r install: support old ln versions without the -r option Sep 18, 2019
@casantos
Copy link
Contributor Author

New version, with logic to detect if ln supports -r.

Makefile.am Outdated
endif
if ENABLE_BRAILLE
$(LN_S) -f imagetobrf $(DESTDIR)$(pkgfilterdir)/imagetoubrl
$(LN_S) -f imagetobrf $(DESTDIR)$(pkgfilterdir)/imagetoubrlR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change good for? Looks like a typo.

Makefile.am Outdated
@@ -1009,7 +1009,7 @@ endif
install-data-hook:
if RCLINKS
for level in $(RCLEVELS); do \
$(INSTALL) -d -m 755 $(DESTDIR)$(INITDIR)/rc$${level}.d; \
$(INSTALL) -d -m 755 $(DESTDIR)$(INITDIR)/rc$${level}.d; \R
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change good for? Looks like a typo.

@tillkamppeter
Copy link
Member

Thank you for the update. I have added 2 comments to your commit. There seem to be random typos in it.

@tillkamppeter
Copy link
Member

Fixes #49.

Oldish enterprise-class Linux distributions have outdated versions of
coreutils whose ln command do not support the -r option. Also non-Linux
systems like FreeBSD don't support that option. Use a shell script that
mimics the missing functionality.

The script creates minimalist relative paths, like ln -r does, but in
order to simplify the logic, it requires that the arguments be absolute
paths and do not end with '/'. This is enough for our purposes.

Add configuration logic to detect if ln supports the -r option, based on
the logic used by Autoconf to check if ln supports the -s option.

Signed-off-by: Carlos Santos <unixmania@gmail.com>
@casantos
Copy link
Contributor Author

casantos commented Sep 18, 2019 via email

@tillkamppeter
Copy link
Member

Thank you very much for your contribution. I have merged it now.

@casantos casantos deleted the fix-old-ln branch September 18, 2019 16:31
woodsts pushed a commit to woodsts/buildroot that referenced this pull request Sep 21, 2019
The patch used previously to support versions of ln lacking the '-r'
option generated broken links:

    $ file target/usr/lib/cups/backend/driverless
    target/usr/lib/cups/backend/driverless: broken symbolic link to ../../usr/lib/cups/driver/driverless

Add a squashing of two patches already applied upstream that provide a
better solution:

    OpenPrinting/cups-filters#154
    OpenPrinting/cups-filters#157

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this pull request Sep 30, 2019
The patch used previously to support versions of ln lacking the '-r'
option generated broken links:

    $ file target/usr/lib/cups/backend/driverless
    target/usr/lib/cups/backend/driverless: broken symbolic link to ../../usr/lib/cups/driver/driverless

Add a squashing of two patches already applied upstream that provide a
better solution:

    OpenPrinting/cups-filters#154
    OpenPrinting/cups-filters#157

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit f80ec79)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this pull request Sep 30, 2019
The patch used previously to support versions of ln lacking the '-r'
option generated broken links:

    $ file target/usr/lib/cups/backend/driverless
    target/usr/lib/cups/backend/driverless: broken symbolic link to ../../usr/lib/cups/driver/driverless

Add a squashing of two patches already applied upstream that provide a
better solution:

    OpenPrinting/cups-filters#154
    OpenPrinting/cups-filters#157

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit f80ec79)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this pull request Sep 30, 2019
The patch used previously to support versions of ln lacking the '-r'
option generated broken links:

    $ file target/usr/lib/cups/backend/driverless
    target/usr/lib/cups/backend/driverless: broken symbolic link to ../../usr/lib/cups/driver/driverless

Add a squashing of two patches already applied upstream that provide a
better solution:

    OpenPrinting/cups-filters#154
    OpenPrinting/cups-filters#157

Signed-off-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit f80ec79)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants