All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make coreutils 6.x+ install utility to honor STRIP env variable
@ 2009-03-04 23:50 Khem Raj
  2009-03-05  0:59 ` Michael 'Mickey' Lauer
  2009-03-05 10:21 ` Bernhard Reutner-Fischer
  0 siblings, 2 replies; 3+ messages in thread
From: Khem Raj @ 2009-03-04 23:50 UTC (permalink / raw)
  To: openembedded-devel

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

Hi

As reported in bug 5052 and also on irc, install calls strip directly. We should make it use STRIP
env variable which is set to <cross-strip> in OE env.

This is a patch which does that

OK for .dev ?

Thx
-Khem



[-- Attachment #2: coreutils-install-use-STRIP.patch --]
[-- Type: text/x-diff, Size: 858 bytes --]

Index: coreutils-6.0/src/install.c
===================================================================
--- coreutils-6.0.orig/src/install.c	2009-03-04 15:37:45.000000000 -0800
+++ coreutils-6.0/src/install.c	2009-03-04 15:38:57.000000000 -0800
@@ -526,7 +526,14 @@
 strip (char const *name)
 {
   int status;
-  pid_t pid = fork ();
+  pid_t pid;
+  char *strip_name;
+
+  strip_name = getenv ("STRIP");
+  if (strip_name == NULL)
+    strip_name = "strip";
+
+  pid = fork ();
 
   switch (pid)
     {
@@ -534,7 +541,7 @@
       error (EXIT_FAILURE, errno, _("fork system call failed"));
       break;
     case 0:			/* Child. */
-      execlp ("strip", "strip", name, NULL);
+      execlp (strip_name, "strip", name, NULL);
       error (EXIT_FAILURE, errno, _("cannot run strip"));
       break;
     default:			/* Parent. */

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

* Re: [PATCH] Make coreutils 6.x+ install utility to honor STRIP env variable
  2009-03-04 23:50 [PATCH] Make coreutils 6.x+ install utility to honor STRIP env variable Khem Raj
@ 2009-03-05  0:59 ` Michael 'Mickey' Lauer
  2009-03-05 10:21 ` Bernhard Reutner-Fischer
  1 sibling, 0 replies; 3+ messages in thread
From: Michael 'Mickey' Lauer @ 2009-03-05  0:59 UTC (permalink / raw)
  To: openembedded-devel

Very welcome, thanks.

Can you do the same for 7.1 while you're there?

(So that when we upgrade we already have this working)

-- 
:M:




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

* Re: [PATCH] Make coreutils 6.x+ install utility to honor STRIP env variable
  2009-03-04 23:50 [PATCH] Make coreutils 6.x+ install utility to honor STRIP env variable Khem Raj
  2009-03-05  0:59 ` Michael 'Mickey' Lauer
@ 2009-03-05 10:21 ` Bernhard Reutner-Fischer
  1 sibling, 0 replies; 3+ messages in thread
From: Bernhard Reutner-Fischer @ 2009-03-05 10:21 UTC (permalink / raw)
  To: openembedded-devel

On Wed, Mar 04, 2009 at 03:50:32PM -0800, Khem Raj wrote:
>Hi
>
>As reported in bug 5052 and also on irc, install calls strip directly. We should make it use STRIP
>env variable which is set to <cross-strip> in OE env.
>
>This is a patch which does that
>
>OK for .dev ?
>
>Thx
>-Khem
>
>

>Index: coreutils-6.0/src/install.c
>===================================================================
>--- coreutils-6.0.orig/src/install.c	2009-03-04 15:37:45.000000000 -0800
>+++ coreutils-6.0/src/install.c	2009-03-04 15:38:57.000000000 -0800
>@@ -526,7 +526,14 @@
> strip (char const *name)
> {
>   int status;
>-  pid_t pid = fork ();
>+  pid_t pid;
>+  char *strip_name;
>+
>+  strip_name = getenv ("STRIP");
>+  if (strip_name == NULL)
>+    strip_name = "strip";
>+
>+  pid = fork ();
> 
>   switch (pid)
>     {
>@@ -534,7 +541,7 @@
>       error (EXIT_FAILURE, errno, _("fork system call failed"));
>       break;
>     case 0:			/* Child. */
>-      execlp ("strip", "strip", name, NULL);
>+      execlp (strip_name, "strip", name, NULL);

perhaps it would be nicer to use the basename of strip_name instead of
hardcoding "strip" ?

>       error (EXIT_FAILURE, errno, _("cannot run strip"));

indicating the actual binary that failed may be nice, too.

My install(1) uses STRIPCMD and STRIPARGS, I suggest you add a way
to pass additional arguments to that strip, too.
Just a thought..
>       break;
>     default:			/* Parent. */



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

end of thread, other threads:[~2009-03-05 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-04 23:50 [PATCH] Make coreutils 6.x+ install utility to honor STRIP env variable Khem Raj
2009-03-05  0:59 ` Michael 'Mickey' Lauer
2009-03-05 10:21 ` Bernhard Reutner-Fischer

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.