Remove backticks in top source directory

Reasoning is given in the update to README.coding_style.
pull/281/head
Nate Bargmann 2020-05-30 18:30:29 -05:00
rodzic 762ca51cba
commit 97f6b4319e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: F72625E2EDBED598
4 zmienionych plików z 42 dodań i 19 usunięć

Wyświetl plik

@ -143,6 +143,30 @@ The old file will be copied to 'moonmelter.c.orig' as a back up.
/* NOP unless x is true. */
while (!x);
* Avoid the use of backticks (`) to invoke a subshell, also known as the grave
accent, in shell scripts, configure.ac, any Makefile.am, or .m4 files we
maintain. While their use will likely be long supported, they do require
some care in use and can be difficult to read on the screen.
The preferred construct is to use parentheses to invoke a subshell and the
'$()' construct when the output of the command is intended to be captured in
a shell variable. This answer covers the reasoning well:
https://unix.stackexchange.com/a/126928
In Makefile.am files use the '$$()' construct to capture subshell command
output into a make variable.
Exceptions:
Files intended to be formatted in Markdown syntax use backticks as a
formatting cue. In these files such use is permitted.
There are a number of files sourced from the GNU Project where the
backtick is used extensively as an opening single quote character. As we
don't usually maintain these files except to update them as needed, these
rules are waived for those files.
4. Use of code formatting tools

Wyświetl plik

@ -314,7 +314,7 @@ optional as shown using the square brackets..
This will keep the binary output files separate from the source tree and aid
in development by reducing clutter in the source tree.
Once you've run `bootstrap', make sure you've got some recent config.guess
Once you've run 'bootstrap', make sure you've got some recent config.guess
and config.sub (needed to guess your system type). Anything of at least
year 2004 should be fine, unless you run some exotic hardware/software system
(modern Linux distributions and Cygwin keep these up to date):
@ -322,7 +322,7 @@ year 2004 should be fine, unless you run some exotic hardware/software system
./config.guess --version
./config.sub --version
The '--prefix' option to `configure' is optional and not shown as it defaults
The '--prefix' option to 'configure' is optional and not shown as it defaults
to /usr/local. Convention is that locally built packages be installed in
/usr/local away from distribution installed packages. The 'CFLAGS="-g -O0"'
environment variable generates less optimized binaries with the '-O0' while the
@ -361,8 +361,8 @@ for this target as neither the bindings or old documentation are generated
in a default build.
NOTE! If Hamlib has not been previously installed as a locally built
package you will need to make sure that `ldconfig' is configured correctly
and run periodically after `make install'. Most modern distributions have
package you will need to make sure that 'ldconfig' is configured correctly
and run periodically after 'make install'. Most modern distributions have
an /etc/ld.so.conf.d/ directory where local configuration can be made.
Later versions of Debian and derivatives have a file named 'libc.conf' in
this directory. The contents of libc.conf are:
@ -371,7 +371,7 @@ this directory. The contents of libc.conf are:
/usr/local/lib
If your system does not have such a file, one will need to be created and
then `ldconfig' will need to be run as the root user so that applications
then 'ldconfig' will need to be run as the root user so that applications
using the Hamlib libraries can find them.
@ -471,8 +471,8 @@ So far, Hamlib has been tested successfully under the following systems:
$ git commit -m "Initial release" Makefile.am mybackend.c mybackend.h
Note: The `-m' switch passes a short message to the Git repository
upon a commit. If a longer message is desired, do not use the `-m'
Note: The '-m' switch passes a short message to the Git repository
upon a commit. If a longer message is desired, do not use the '-m'
option. The editor specified in the EDITOR or VISUAL environment
variables will be started where a more detailed message may be
composed.
@ -498,12 +498,12 @@ So far, Hamlib has been tested successfully under the following systems:
3.6. In initrigs_<mybackend> of mybackend.c,
add "rig_register(&<mymodel>_caps);"
3.7. Run `make' if you have dependencies, or the following to regenerate
3.7. Run 'make' if you have dependencies, or the following to regenerate
the makefile:
$ automake mybackend/Makefile
$ CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=mybackend/Makefile ./config.status
Run `make' in topdir to rebuild all.
Run 'make' in topdir to rebuild all.
3.8. Commit your work (once tests are satisfactory):
$ git add .

Wyświetl plik

@ -739,7 +739,7 @@ AC_SUBST([BACKENDEPS])
## ---------------------------------- ##
for be in ${RIG_BACKEND_LIST} ; do
RIGDIR=`echo $be | awk -F "/" '{print $2}'`
RIGDIR=$(echo $be | awk -F "/" '{print $2}')
RIG_BACKENDEPS="${RIG_BACKENDEPS} \$(top_builddir)/rigs/${RIGDIR}/libhamlib-${RIGDIR}.la"
done
@ -754,7 +754,7 @@ AC_SUBST([RIG_BACKENDEPS])
# otherwise parallel 'make -jn' will fail
for be in ${ROT_BACKEND_LIST} ; do
ROTDIR=`echo $be | awk -F "/" '{print $2}'`
ROTDIR=$(echo $be | awk -F "/" '{print $2}')
ROT_BACKENDEPS="${ROT_BACKENDEPS} \$(top_builddir)/rotators/${ROTDIR}/libhamlib-${ROTDIR}.la"
done
@ -768,7 +768,7 @@ AC_SUBST([ROT_BACKENDEPS])
# otherwise parallel 'make -jn' will fail
for be in ${AMP_BACKEND_LIST} ; do
AMPDIR=`echo $be | awk -F "/" '{print $2}'`
AMPDIR=$(echo $be | awk -F "/" '{print $2}')
AMP_BACKENDEPS="${AMP_BACKENDEPS} \$(top_builddir)/amplifiers/${AMPDIR}/libhamlib-${AMPDIR}.la"
done

Wyświetl plik

@ -1,7 +1,7 @@
dnl Configure Paths for Hamlib
dnl Cloned from Alsa project http://www.alsa-project.org
dnl AM_PATH_HAMLIB([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for libhamlib, and define HAMLIB_LTDL,
dnl Test for libhamlib, and define HAMLIB_LTDL,
dnl HAMLIB_CFLAGS and HAMLIB_LIBS as appropriate.
dnl enables arguments --with-hamlib-prefix=
dnl --with-hamlib-inc-prefix=
@ -51,9 +51,9 @@ fi
dnl add the hamlib library
HAMLIB_LIBS="$HAMLIB_LIBS -lhamlib -lm -ldl"
LIBS=`echo $LIBS | sed 's/-lm//'`
LIBS=`echo $LIBS | sed 's/-ldl//'`
LIBS=`echo $LIBS | sed 's/ //'`
LIBS=$(echo $LIBS | sed 's/-lm//')
LIBS=$(echo $LIBS | sed 's/-ldl//')
LIBS=$(echo $LIBS | sed 's/ //')
#LIBS="$HAMLIB_LIBS $LIBS"
AC_MSG_RESULT($HAMLIB_LIBS)
@ -75,8 +75,8 @@ dnl Now that we know that we have the right version, let's see if we have the li
if test "x$hamlib_found" = "xyes" ; then
ifelse([$2], , :, [$2])
LIBS=`echo $LIBS | sed 's/-lhamlib//g'`
LIBS=`echo $LIBS | sed 's/ //'`
LIBS=$(echo $LIBS | sed 's/-lhamlib//g')
LIBS=$(echo $LIBS | sed 's/ //')
LIBS="-lhamlib $LIBS"
fi
if test "x$hamlib_found" = "xno" ; then
@ -93,4 +93,3 @@ AC_SUBST(HAMLIB_CFLAGS)
AC_SUBST(HAMLIB_LIBS)
AC_SUBST(HAMLIB_LTDL)
])