[parted-devel] "config.h" to <config.h>

Jim Meyering jim at meyering.net
Wed Mar 7 01:30:11 CET 2007


"Debarshi 'Rishi' Ray" <debarshi.ray at gmail.com> wrote:
> Some of the files still have:
> #include "config.h"
>
> I would like to change them to:
> #include <config.h>
>
> Please find an example in the attachment. I have slightly rearranged
> <config.h> in a few cases to club it with other headers which are
> included using <> instead of """".

> diff --git a/debug/clearfat/clearfat.c b/debug/clearfat/clearfat.c
> index 4aba739..aaf808e 100644
> --- a/debug/clearfat/clearfat.c
> +++ b/debug/clearfat/clearfat.c
> @@ -17,12 +17,13 @@
>      Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
>  */
>
> -#include "config.h"
> -
> +#include <config.h>
>  #include <string.h>
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <getopt.h>
> +#include <locale.h>
> +
>  #include "closeout.h"
>  #include "configmake.h"
>  #include "error.h"
> @@ -30,8 +31,6 @@
>
>  #include "../../libparted/fs/fat/fat.h"
>
> -#include <locale.h>

Please do not mix changes like this (putting locale.h before fat.h,
which also does NLS-related things -- so this is particularly risky).
with a change like the "config.h" -> <config.h> one.

Any global change like this config-syntax one should be
as simple and mechanical as possible.  If you want to make
manual fix-up changes afterwards, it's fine to do it in a
separate delta.

For example, you could change them all with e.g.,

  grep -lr '^#include "config.h"' . \
   | xargs perl -pi -e 's/^#include "config\.h"/#include <config.h>/'

If you do that, also include the following change.
It enables the "make distcheck"-time test to ensure
no one introduces a new use of "config.h".

diff --git a/Makefile.cfg b/Makefile.cfg
index 52951de..e1bad2b 100644
--- a/Makefile.cfg
+++ b/Makefile.cfg
@@ -36,7 +36,6 @@ gpg_key_ID = D333CBA1
 local-checks-to-skip = \
   sc_file_system \
   sc_prohibit_atoi_atof \
-  sc_require_config_h \
   sc_system_h_headers \
   sc_space_tab \
   sc_tight_scope \



More information about the parted-devel mailing list