All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] build: let sed use posix ERE instead of GNU extension
@ 2015-06-22 12:09 Natanael Copa
  2015-06-22 14:20 ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Natanael Copa @ 2015-06-22 12:09 UTC (permalink / raw)
  To: linux-modules; +Cc: Natanael Copa

Use POSIX Extended Regular Expression (ERE) instead of the GNU extension
\| in the install-exec-hook. This makes it create the symlink properly
with busybox sed built with musl libc. It will silently create a broken
symlink otherwise.
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 6679deb..4978b26 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -107,7 +107,8 @@ install-exec-hook:
 	if test "$(libdir)" != "$(rootlibdir)"; then \
 		$(MKDIR_P) $(DESTDIR)$(rootlibdir) && \
 		so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
-		so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
+		so_img_rel_target_prefix=$$(echo $(libdir) | sed -E 's,(^/|)[^/][^/]*,..,g') && \
+
 		ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
 		mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
 	fi
-- 
2.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] build: let sed use posix ERE instead of GNU extension
  2015-06-22 12:09 [PATCH] build: let sed use posix ERE instead of GNU extension Natanael Copa
@ 2015-06-22 14:20 ` Lucas De Marchi
  2015-06-22 14:30   ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2015-06-22 14:20 UTC (permalink / raw)
  To: Natanael Copa; +Cc: linux-modules

Hi,

On Mon, Jun 22, 2015 at 9:09 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
> Use POSIX Extended Regular Expression (ERE) instead of the GNU extension
> \| in the install-exec-hook. This makes it create the symlink properly
> with busybox sed built with musl libc. It will silently create a broken
> symlink otherwise.


Oh... so you are running "make install" in a system with only busybox
built with musl? :-o

Anyway, this change seems sane enough so it's applied.

-- 
Lucas De Marchi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] build: let sed use posix ERE instead of GNU extension
  2015-06-22 14:20 ` Lucas De Marchi
@ 2015-06-22 14:30   ` Lucas De Marchi
  2015-06-24 12:11     ` Natanael Copa
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2015-06-22 14:30 UTC (permalink / raw)
  To: Natanael Copa; +Cc: linux-modules

On Mon, Jun 22, 2015 at 11:20 AM, Lucas De Marchi
<lucas.de.marchi@gmail.com> wrote:
> Hi,
>
> On Mon, Jun 22, 2015 at 9:09 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
>> Use POSIX Extended Regular Expression (ERE) instead of the GNU extension
>> \| in the install-exec-hook. This makes it create the symlink properly
>> with busybox sed built with musl libc. It will silently create a broken
>> symlink otherwise.
>
>
> Oh... so you are running "make install" in a system with only busybox
> built with musl? :-o
>
> Anyway, this change seems sane enough so it's applied.

when pushing the CI alerted me it was failing.

        Makefile.am:111: error: blank line following trailing backslash

I fixed this up myself, but now I'm wondering if this has been at
least compile-tested.

-- 
Lucas De Marchi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] build: let sed use posix ERE instead of GNU extension
  2015-06-22 14:30   ` Lucas De Marchi
@ 2015-06-24 12:11     ` Natanael Copa
  0 siblings, 0 replies; 4+ messages in thread
From: Natanael Copa @ 2015-06-24 12:11 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

On Mon, 22 Jun 2015 11:30:40 -0300
Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:

> On Mon, Jun 22, 2015 at 11:20 AM, Lucas De Marchi
> <lucas.de.marchi@gmail.com> wrote:
> > Hi,
> >
> > On Mon, Jun 22, 2015 at 9:09 AM, Natanael Copa <ncopa@alpinelinux.org> wrote:
> >> Use POSIX Extended Regular Expression (ERE) instead of the GNU extension
> >> \| in the install-exec-hook. This makes it create the symlink properly
> >> with busybox sed built with musl libc. It will silently create a broken
> >> symlink otherwise.
> >
> >
> > Oh... so you are running "make install" in a system with only busybox
> > built with musl? :-o

yes. i think i have built 1000+ packages with busybox sed only.

> > Anyway, this change seems sane enough so it's applied.
> 
> when pushing the CI alerted me it was failing.
> 
>         Makefile.am:111: error: blank line following trailing backslash
> 
> I fixed this up myself, but now I'm wondering if this has been at
> least compile-tested.
> 

My bad. sorry about that.

I did "unit" test it, eg copy paste and tested that the sed line worked
with both GNU sed and busybox sed.

I have now also compile and make install tested it. It works as
expected after removing the blank line.


ncopa-desktop:~/src/kmod$ ls -l /tmp/kmod/lib/
total 448
lrwxrwxrwx 1 ncopa ncopa     17 Jun 23 13:52 libkmod.so.2 -> libkmod.so.2.2.11
-rwxr-xr-x 1 ncopa ncopa 454880 Jun 23 13:52 libkmod.so.2.2.11
ncopa-desktop:~/src/kmod$ ls -l /tmp/kmod/usr/lib/
total 8
-rwxr-xr-x 1 ncopa ncopa  903 Jun 23 13:52 libkmod.la
lrwxrwxrwx 1 ncopa ncopa   27 Jun 23 13:52 libkmod.so -> ../../lib/libkmod.so.2.2.11
drwxr-xr-x 2 ncopa ncopa 4096 Jun 23 13:52 pkgconfig

Thanks!

-nc

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-24 12:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22 12:09 [PATCH] build: let sed use posix ERE instead of GNU extension Natanael Copa
2015-06-22 14:20 ` Lucas De Marchi
2015-06-22 14:30   ` Lucas De Marchi
2015-06-24 12:11     ` Natanael Copa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.