All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/18] Simplify sed script and make awk script more robust
@ 2009-05-30 14:44 Vladimir 'phcoder' Serbinenko
  2009-06-16  0:59 ` Pavel Roskin
  0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-05-30 14:44 UTC (permalink / raw)
  To: The development of GRUB 2

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

sed on apple's platform is more limited here is workaround. awk needs
a check not to make module depend on itself in some cases

-- 
Regards
Vladimir 'phcoder' Serbinenko

[-- Attachment #2: 04_sed.diff --]
[-- Type: text/x-patch, Size: 1445 bytes --]

diff --git a/Makefile.in b/Makefile.in
index cd79b0b..e00f9c3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -213,7 +213,7 @@ install-local: all
 	for file in $$list; do \
 	  if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \
 	  dest="`echo $$file | sed 's,include/,,'`"; \
-	  destdir="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \
+	  destdir="`echo $$dest | sed 's,[^/]*$$,,g'`"; \
 	  $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \
 	  if test -f "$$dir$$file"; then \
 	    $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \
diff --git a/gencmdlist.sh b/gencmdlist.sh
index 5d3897c..7f25490 100644
--- a/gencmdlist.sh
+++ b/gencmdlist.sh
@@ -17,4 +17,6 @@ module=$1
 
 grep -v "^#" | sed -n \
  -e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \
- -e "/\(grub_register_extcmd\|grub_register_command_p1\) *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}"
+ -e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" \
+ -e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}"
+
diff --git a/genmoddep.awk b/genmoddep.awk
index c079b36..5b9bc62 100644
--- a/genmoddep.awk
+++ b/genmoddep.awk
@@ -50,7 +50,7 @@ END {
     for (i in depmods) {
       depmod = depmods[i];
       # Ignore kernel, as always loaded.
-      if (depmod != "kernel")
+      if (depmod != "kernel" && depmod != mod)
 	uniqmods[depmod] = 1;
     }
     modlist = ""

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

* Re: [PATCH 4/18] Simplify sed script and make awk script more robust
  2009-05-30 14:44 [PATCH 4/18] Simplify sed script and make awk script more robust Vladimir 'phcoder' Serbinenko
@ 2009-06-16  0:59 ` Pavel Roskin
  2009-06-16 10:34   ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Roskin @ 2009-06-16  0:59 UTC (permalink / raw)
  To: The development of GRUB 2

On Sat, 2009-05-30 at 16:44 +0200, Vladimir 'phcoder' Serbinenko wrote:
> sed on apple's platform is more limited here is workaround. awk needs
> a check not to make module depend on itself in some cases

Sorry for not being able to review this series earlier.  This patch
doesn't seem to be properly explained.  It's not clear is you are
simplifying the expression without loss in functionality or you chose to
ignore some cases.

-- 
Regards,
Pavel Roskin



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

* Re: [PATCH 4/18] Simplify sed script and make awk script more robust
  2009-06-16  0:59 ` Pavel Roskin
@ 2009-06-16 10:34   ` Vladimir 'phcoder' Serbinenko
  0 siblings, 0 replies; 3+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-16 10:34 UTC (permalink / raw)
  To: The development of GRUB 2

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

On Tue, Jun 16, 2009 at 2:59 AM, Pavel Roskin <proski@gnu.org> wrote:

> On Sat, 2009-05-30 at 16:44 +0200, Vladimir 'phcoder' Serbinenko wrote:
> > sed on apple's platform is more limited here is workaround. awk needs
> > a check not to make module depend on itself in some cases
>
> Sorry for not being able to review this series earlier.  This patch
> doesn't seem to be properly explained.  It's not clear is you are
> simplifying the expression without loss in functionality or you chose to
> ignore some cases.

I simplify without the loss of functionality. First simplification is to
split a sed expression using (*|*) construction into two expressions and the
second is not to care about trailing /. Even if it's nicer to avoid double /
in filenames I believe it isn't a problem for any system

>
>
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

[-- Attachment #2: Type: text/html, Size: 1712 bytes --]

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

end of thread, other threads:[~2009-06-16 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-30 14:44 [PATCH 4/18] Simplify sed script and make awk script more robust Vladimir 'phcoder' Serbinenko
2009-06-16  0:59 ` Pavel Roskin
2009-06-16 10:34   ` Vladimir 'phcoder' Serbinenko

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.