Skip to contentSkip to conversation

Simplify sed script and make awk script more robust

PATCH In review Vladimir 'phcoder' Serbinenko 2 participants 3 messages May 30, 2009 – Jun 16, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 4/18 Simplify sed script and make awk script more robust

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

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
Makefile.in +1 -1
index cd79b0b..e00f9c3 100644
@@ -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; \
gencmdlist.sh +3 -1
index 5d3897c..7f25490 100644
@@ -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;}"
+
genmoddep.awk +1 -1
index c079b36..5b9bc62 100644
@@ -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 = ""
#1 lore raw
Quoted 2 lines · Vladimir 'phcoder' Serbinenko

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.

Signature · 2 lines
Regards,
Pavel Roskin
#2 lore raw
Quoted 8 lines · Pavel Roskin
Quoted 2 lines · Vladimir 'phcoder' Serbinenko

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

Quoted 12 lines

--
Regards,
Pavel Roskin

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko