Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc PR port-arm/54640: hack to work around conditional RAW_P...



details:   https://anonhg.NetBSD.org/src/rev/83fd91a3fdeb
branches:  trunk
changeset: 460775:83fd91a3fdeb
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Nov 03 12:03:35 2019 +0000

description:
PR port-arm/54640: hack to work around conditional RAW_PART definition in
arm/include/disklabel.h.

Recognize this special case and skip lines between #ifndef RAW_PART and
the next #endif.

diffstat:

 etc/MAKEDEV.awk |  17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r 0512c3b71b3f -r 83fd91a3fdeb etc/MAKEDEV.awk
--- a/etc/MAKEDEV.awk   Sun Nov 03 11:34:40 2019 +0000
+++ b/etc/MAKEDEV.awk   Sun Nov 03 12:03:35 2019 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -
 #
-#      $NetBSD: MAKEDEV.awk,v 1.27 2019/10/28 02:53:29 ozaki-r Exp $
+#      $NetBSD: MAKEDEV.awk,v 1.28 2019/11/03 12:03:35 martin Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -135,7 +135,18 @@
                                diskpartitions = $3
                        else if ($1 == "#define" && $2 == "OLDMAXPARTITIONS")
                                diskbackcompat = $3
-                       else if ($1 == "#define" && $2 == "RAW_PART")
+                       else if ($1 == "#ifndef" && $2 == "RAW_PART" &&
+                           RAWDISK_OFF) {
+                               # special case to ignore #ifndef RAW_PART
+                               # sections (e.g. in arm/include/disklabel.h,
+                               # when it is already set in
+                               # zaurus/include/disklabel.h)
+                               while (getline < inc) {
+                                       # skip all lines upto the next #endif
+                                       if ($1 == "#endif")
+                                               break;
+                               }
+                       } else if ($1 == "#define" && $2 == "RAW_PART")
                                RAWDISK_OFF = $3
                        else if ($1 == "#include" && 
                                 $2 ~ "<.*/disklabel.h>" &&
@@ -214,7 +225,7 @@
        print "# Generated from:"
 
        # MAKEDEV.awk (this script) RCS Id
-       ARCSID = "$NetBSD: MAKEDEV.awk,v 1.27 2019/10/28 02:53:29 ozaki-r Exp $"
+       ARCSID = "$NetBSD: MAKEDEV.awk,v 1.28 2019/11/03 12:03:35 martin Exp $"
        gsub(/\$/, "", ARCSID)
        print "#        " ARCSID
        



Home | Main Index | Thread Index | Old Index