FYI, I've just pushed this.
It sync's the new syntax-check rule from coreutils,
and then adjusts parted main programs to conform.
No behavior change.

>From 8d0af5e95b8d4beb947bda15f232085b1d6f3cbb Mon Sep 17 00:00:00 2001
From: Jim Meyering <[EMAIL PROTECTED]>
Date: Thu, 5 Jun 2008 09:10:57 +0200
Subject: [PATCH] * maint.mk: Merge from coreutils.

---
 maint.mk |   34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/maint.mk b/maint.mk
index d89cd76..b03354e 100644
--- a/maint.mk
+++ b/maint.mk
@@ -341,6 +341,18 @@ sc_system_h_headers: .re-list
                  1>&2;  exit 1; } || :;                                \
        fi

+# Ensure that each .c file containing a "main" function also
+# calls set_program_name.
+sc_program_name:
+       @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then          \
+         files=$$(grep -l '^main *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$')); \
+         grep -LE 'set_program_name *\(m?argv\[0\]\);' $$files         \
+             | grep . &&                                               \
+         { echo '$(ME): the above files do not call set_program_name'  \
+               1>&2; exit 1; } || :;                                   \
+       else :;                                                         \
+       fi
+
 # Require that the final line of each test-lib.sh-using test be this one:
 # (exit $fail); exit $fail
 # Note: this test requires GNU grep's --label= option.
@@ -444,15 +456,18 @@ update-NEWS-hash: NEWS
        perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
          $(srcdir)/cfg.mk

+epoch_date = 1970-01-01 00:00:00.000000000 +0000
 # Ensure that the c99-to-c89 patch applies cleanly.
 patch-check:
        rm -rf src-c89 [EMAIL PROTECTED] [EMAIL PROTECTED]
        cp -a src src-c89
        (cd src-c89; patch -p1 -V never --fuzz=0) < src/c99-to-c89.diff \
          > [EMAIL PROTECTED] 2>&1
-       if test "$$REGEN_PATCH" = yes; then \
+       if test "$(REGEN_PATCH)" = yes; then \
          diff -upr src src-c89 | sed 's,src-c89/,src/,' \
-           | grep -v '^Only in' > new-diff || : ; fi
+           | grep -vE '^(Only in|File )' \
+           | perl -pe 's/^((?:\+\+\+|---) \S+\t).*/$${1}$(epoch_date)/' \
+           > new-diff || : ; fi
        grep -v '^patching file ' [EMAIL PROTECTED] > [EMAIL PROTECTED] || :
        msg=ok; test -s [EMAIL PROTECTED] && msg='fuzzy patch' || : ;   \
        rm -f src-c89/*.o || msg='rm failed';                   \
@@ -768,6 +783,14 @@ emit_upload_commands:
        @echo =====================================
        @echo =====================================

+noteworthy = * Noteworthy changes in release ?.? (????-??-??) [?]
+define emit-commit-log
+  printf '%s\n' 'post-release administrivia' '' \
+    '* NEWS: Add header line for next release.' \
+    '* .prev-version: Record previous version.' \
+    '* cfg.mk (old_NEWS_hash): Auto-update.'
+endef
+
 .PHONY: alpha beta major
 alpha beta major: $(local-check) writable-files
        test $@ = major                                         \
@@ -783,6 +806,7 @@ alpha beta major: $(local-check) writable-files
        fi
        $(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
        echo $(VERSION) > $(prev_version_file)
-       $(VC) commit -m \
-         '$(prev_version_file): Record previous version: $(VERSION).' \
-         $(prev_version_file)
+       $(MAKE) update-NEWS-hash
+       perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
+       $(emit-commit-log) > .ci-msg
+       $(VC) commit -F .ci-msg
--
1.5.6.rc0.30.g7c3f3


>From 61ca18819ebe630f48564575a796ebcfac5ea957 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[EMAIL PROTECTED]>
Date: Thu, 5 Jun 2008 09:23:51 +0200
Subject: [PATCH] use gnulib's progname module

* bootstrap.conf (gnulib_modules): Add progname.
* debug/clearfat/clearfat.c: Include "progname.h".
(main): Call set_program_name rather than setting program_name.
* parted/parted.c: Likewise.
* partprobe/partprobe.c: Likewise.
* libparted/tests/disk.c: Include "progname.h" and call
set_program_name even though program_name isn't used, yet.
* libparted/tests/label.c: Likewise.
---
 bootstrap.conf            |    1 +
 debug/clearfat/clearfat.c |    8 +++-----
 libparted/tests/disk.c    |    2 ++
 libparted/tests/label.c   |    2 ++
 parted/parted.c           |    5 ++---
 partprobe/partprobe.c     |    8 +++-----
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index 351c6bd..c54fcea 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -50,6 +50,7 @@ gnulib_modules="
        malloc
        realloc
        rpmatch
+       progname
        safe-read
        stdbool
        useless-if-before-free
diff --git a/debug/clearfat/clearfat.c b/debug/clearfat/clearfat.c
index dd35798..7a4c61f 100644
--- a/debug/clearfat/clearfat.c
+++ b/debug/clearfat/clearfat.c
@@ -1,6 +1,6 @@
 /*
     clear_fat - a tool to clear unused space (for testing purposes)
-    Copyright (C) 2000, 2007 Free Software Foundation, Inc.
+    Copyright (C) 2000, 2007-2008 Free Software Foundation, Inc.

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
 #include "configmake.h"
 #include "error.h"
 #include "long-options.h"
+#include "progname.h"

 #include "../../libparted/fs/fat/fat.h"

@@ -52,9 +53,6 @@
 #define AUTHORS \
   "<http://parted.alioth.debian.org/cgi-bin/trac.cgi/browser/AUTHORS>"

-/* The name this program was run with. */
-char *program_name;
-
 void
 usage (int status)
 {
@@ -267,7 +265,7 @@ main (int argc, char* argv[])
        PedPartition*           part;
        PedFileSystem*          fs;

-        program_name = argv[0];
+        set_program_name (argv[0]);
         setlocale (LC_ALL, "");
         bindtextdomain (PACKAGE, LOCALEDIR);
         textdomain (PACKAGE);
diff --git a/libparted/tests/disk.c b/libparted/tests/disk.c
index 020bdc0..cf69b00 100644
--- a/libparted/tests/disk.c
+++ b/libparted/tests/disk.c
@@ -6,6 +6,7 @@
 #include <parted/parted.h>

 #include "common.h"
+#include "progname.h"

 static char* temporary_disk;

@@ -87,6 +88,7 @@ END_TEST
 int
 main (void)
 {
+        set_program_name (argv[0]);
         int number_failed;
         Suite* suite = suite_create ("Disk");
         TCase* tcase_duplicate = tcase_create ("Duplicate");
diff --git a/libparted/tests/label.c b/libparted/tests/label.c
index 54f40c3..aa825f9 100644
--- a/libparted/tests/label.c
+++ b/libparted/tests/label.c
@@ -6,6 +6,7 @@
 #include <parted/parted.h>

 #include "common.h"
+#include "progname.h"

 static char* temporary_disk;

@@ -149,6 +150,7 @@ END_TEST
 int
 main (void)
 {
+        set_program_name (argv[0]);
         int number_failed;
         Suite* suite = suite_create ("Disk Label");
         TCase* tcase_basic = tcase_create ("Create");
diff --git a/parted/parted.c b/parted/parted.c
index 4af72ac..9f79ea4 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -24,6 +24,7 @@
 #include "version-etc.h"
 #include "command.h"
 #include "ui.h"
+#include "progname.h"
 #include "table.h"

 #define AUTHORS \
@@ -99,8 +100,6 @@ static const char *const options_help [][2] = {
         {NULL,          NULL}
 };

-char *program_name;
-
 int     opt_script_mode = 0;
 int     pretend_input_tty = 0;
 int     opt_machine_mode = 0;
@@ -2470,7 +2469,7 @@ main (int argc, char** argv)
         PedDevice*      dev;
         int             status;

-        program_name = argv[0];
+        set_program_name (argv[0]);
         atexit (close_stdout);

         dev = _init (&argc, &argv);
diff --git a/partprobe/partprobe.c b/partprobe/partprobe.c
index d324167..75f7399 100644
--- a/partprobe/partprobe.c
+++ b/partprobe/partprobe.c
@@ -1,6 +1,6 @@
 /*
     partprobe - informs the OS kernel of partition layout
-    Copyright (C) 2001, 2002, 2007 Free Software Foundation, Inc.
+    Copyright (C) 2001, 2002, 2007-2008 Free Software Foundation, Inc.

     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -34,6 +34,7 @@

 #include "closeout.h"
 #include "configmake.h"
+#include "progname.h"
 #include "version-etc.h"

 #include <locale.h>
@@ -66,9 +67,6 @@ static struct option const long_options[] =
     {NULL, 0, NULL, 0}
   };

-
-char *program_name;
-
 /* initialized to 0 according to the language lawyers */
 static int     opt_no_inform;
 static int     opt_summary;
@@ -163,7 +161,7 @@ main (int argc, char* argv[])
 {
        int             status = 0;

-       program_name = argv[0];
+       set_program_name (argv[0]);

        setlocale (LC_ALL, "");
        bindtextdomain (PACKAGE, LOCALEDIR);
--
1.5.6.rc0.30.g7c3f3

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to