Re: [PATCH] sim: common: modernize gennltvals.sh

Mike Frysinger via Gdb-patches
2021-01-18T17:10:04Z

On 18 Jan 2021 10:00, Andrew Burgess wrote:
> * Mike Frysinger via Gdb-patches [2021-01-17 05:10:44 -0500]:
> > It's not 1996 anymore, so stop writing shell code like it is, and
> > --- a/sim/common/gennltvals.sh
> > +++ b/sim/common/gennltvals.sh
> > @@ -1,33 +1,135 @@
> > #! /bin/sh
> > -# Generate nltvals.def, a file that describes various newlib/libgloss
> > -# target values used by the host/target interface.
> > +# Copyright (C) 1996-2021 Free Software Foundation, Inc.
> > #
> > -# Syntax: /bin/sh gennltvals.sh shell srcroot cpp
> > -
> > -shell=$1
> > -srcroot=$2
> > -cpp=$3
> > -
> > -srccom=$srcroot/sim/common
> > -if [ -d "${srcroot}/newlib" ]; then
> > - # If newlib is manually in the same source tree, use it.
> > - newlibroot=${srcroot}
> > -else
> > - # Else assume it's alongside the gdb/binutils repo.
> > - newlibroot=${srcroot}/../newlib
> > -fi
> > -
> > -echo '/* Newlib/libgloss macro values needed by remote target support. */'
> > -echo '/* This file is machine generated by gennltvals.sh. */'
> > -
> > -$shell ${srccom}/gentvals.sh "" errno ${newlibroot}/newlib/libc/include \
> > - "errno.h sys/errno.h" 'E[[:upper:][:digit:]]*' "${cpp}"
> > -
> > -$shell ${srccom}/gentvals.sh "" signal ${newlibroot}/newlib/libc/include \
> > - "signal.h sys/signal.h" 'SIG[[:upper:][:digit:]]*' "${cpp}"
> > -
> > -$shell ${srccom}/gentvals.sh "" open ${newlibroot}/newlib/libc/include \
> > - "fcntl.h sys/fcntl.h sys/_default_fcntl.h" 'O_[[:upper:][:digit:]]*' "${cpp}"
>
> Shouldn't there be a Copyright line here. The old one was 1996-2021,
> I guess even though this is a significant rewrite, its probably close
> enough that the old date range should still apply.

there is one already ... look at the top of this diff.
this hunk isn't a pure delete as git notices the first 3 lines.
-mike