bug-parted
[Top][All Lists]
Advanced

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

[PATCH 1/8] maint: pass newer "make syntax-check" tests from gnulib


From: Jim Meyering
Subject: [PATCH 1/8] maint: pass newer "make syntax-check" tests from gnulib
Date: Wed, 28 Apr 2010 22:45:33 +0200

I've updated to the latest from gnulib.
That provoked a few adjustments to pass new syntax checks.
It also prompted me to pull in and adapt the help-version unit test
from coreutils, which in turn provoked a few more changes.
Here's the result:

>From 23b5c920848b5d2f7ebb3d9adabf3f0fda27715a Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 19:14:17 +0200
Subject: [PATCH 1/8] maint: pass newer "make syntax-check" tests from gnulib

* cfg.mk (local-checks-to-skip): Add these, to pass "make syntax-check"
sc_error_message_uppercase, sc_error_message_period.
* libparted/fs/ext2/ext2.h: Remove "#if HAVE_INTTYPES_H" guard.
---
 cfg.mk                   |    2 ++
 libparted/fs/ext2/ext2.h |    4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index e303fa5..5c7f21f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -32,6 +32,8 @@ manual_title = Parted User's Manual
 # files -- otherwise, you'd need to have the upcoming version number
 # at the top of the file for each `make distcheck' run.
 local-checks-to-skip = \
+  sc_error_message_uppercase \
+  sc_error_message_period \
   sc_file_system \
   sc_prohibit_strcmp \
   sc_prohibit_atoi_atof \
diff --git a/libparted/fs/ext2/ext2.h b/libparted/fs/ext2/ext2.h
index 1616515..eb1f347 100644
--- a/libparted/fs/ext2/ext2.h
+++ b/libparted/fs/ext2/ext2.h
@@ -25,9 +25,7 @@
 #include <sys/types.h>
 #include "tune.h"

-#if HAVE_INTTYPES_H
-#  include <inttypes.h>
-#endif
+#include <inttypes.h>

 #if ENABLE_NLS
 #  include <libintl.h>
-- 
1.7.1.328.g9993c


>From 0afddb99927d9d59f91b1b145fff2941a1ff23b8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 19:16:49 +0200
Subject: [PATCH 2/8] maint: remove empty lines at end of file

This lets one more "syntax-check" test pass.
Run this command:
  git ls-files|grep -v gnulib|xargs perl -pi -0777 -e 's/\n\n+$/\n/'
---
 BUGS                                     |    1 -
 COPYING                                  |    1 -
 THANKS                                   |    1 -
 debug/test/HOWTO                         |    1 -
 debug/test/build_leak_list               |    1 -
 debug/test/test                          |    1 -
 debug/test/test_disk_bsd                 |    1 -
 debug/test/test_disk_dos                 |    1 -
 debug/test/test_disk_dvh                 |    1 -
 debug/test/test_disk_gpt                 |    1 -
 debug/test/test_disk_mac                 |    1 -
 debug/test/test_disk_pc98                |    1 -
 debug/test/test_disk_sun                 |    1 -
 debug/test/test_fs_ext2                  |    1 -
 debug/test/test_fs_fat                   |    1 -
 debug/test/test_fs_hfs                   |    1 -
 debug/test/test_fs_hfsplus               |    1 -
 debug/test/test_fs_linux_swap            |    1 -
 debug/test/test_fs_reiserfs              |    1 -
 debug/test/testrc                        |    1 -
 doc/API                                  |    2 --
 doc/FAT                                  |    2 --
 doc/USER.jp                              |    1 -
 doc/fdl.texi                             |    1 -
 doc/parted-pt_BR.texi                    |    1 -
 include/parted/constraint.h              |    1 -
 include/parted/device.h                  |    1 -
 include/parted/endian.h                  |    1 -
 include/parted/exception.h               |    1 -
 include/parted/geom.h                    |    1 -
 include/parted/unit.h                    |    2 --
 libparted.pc.in                          |    1 -
 libparted/ChangeLog.0                    |    1 -
 libparted/arch/gnu.c                     |    1 -
 libparted/cs/constraint.c                |    1 -
 libparted/exception.c                    |    1 -
 libparted/fs/amiga/affs.h                |    1 -
 libparted/fs/amiga/amiga.h               |    1 -
 libparted/fs/bfs/bfs.c                   |    2 --
 libparted/fs/bfs/bfs.h                   |    1 -
 libparted/fs/ext2/ext2_buffer.c          |    1 -
 libparted/fs/ext2/ext2_inode_relocator.c |    1 -
 libparted/fs/ext2/parted_io.h            |    1 -
 libparted/fs/fat/bootsector.c            |    1 -
 libparted/fs/fat/bootsector.h            |    1 -
 libparted/fs/fat/calc.h                  |    1 -
 libparted/fs/fat/clstdup.h               |    1 -
 libparted/fs/fat/count.c                 |    1 -
 libparted/fs/fat/fat.c                   |    1 -
 libparted/fs/fat/table.h                 |    1 -
 libparted/fs/ntfs/ntfs.c                 |    2 --
 libparted/fs/xfs/xfs.c                   |    1 -
 libparted/mbr.s                          |    1 -
 libparted/tests/common.h                 |    1 -
 parted/command.c                         |    1 -
 parted/command.h                         |    1 -
 parted/strlist.h                         |    1 -
 parted/table.h                           |    1 -
 scripts/update-po                        |    1 -
 59 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/BUGS b/BUGS
index e7d3999..8223300 100644
--- a/BUGS
+++ b/BUGS
@@ -4,4 +4,3 @@ http://www.gnu.org/software/parted/) for common bugs from the 
past
 and http://alioth.debian.org/parted/ for a bug tracker.

 =======================================================================
-
diff --git a/COPYING b/COPYING
index bf0f7d3..24afbe2 100644
--- a/COPYING
+++ b/COPYING
@@ -673,4 +673,3 @@ may consider it more useful to permit linking proprietary 
applications with
 the library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.  But first, please read
 <http://www.gnu.org/philosophy/why-not-lgpl.html>.
-
diff --git a/THANKS b/THANKS
index 466ccac..684c8e4 100644
--- a/THANKS
+++ b/THANKS
@@ -25,4 +25,3 @@ on Mac's
  * Ethan Benson <address@hidden> for lots of advice / testing on ppc
  * Charles Stevenson <address@hidden> - ppc stuff
  * heaps of people we left out!
-
diff --git a/debug/test/HOWTO b/debug/test/HOWTO
index 7d03a7e..0e782aa 100644
--- a/debug/test/HOWTO
+++ b/debug/test/HOWTO
@@ -238,4 +238,3 @@ doesn't segfault.
        The file system tests are mainly "do some operation on the
 file system, and check it's still got the same data", via diff(1).
 Also, it runs dosfsck(1) and e2fsck(1).
-
diff --git a/debug/test/build_leak_list b/debug/test/build_leak_list
index f217eff..845692d 100755
--- a/debug/test/build_leak_list
+++ b/debug/test/build_leak_list
@@ -9,4 +9,3 @@ mtrace $TEST_PARTED_BASE/parted/.libs/parted $MALLOC_TRACE \
        | sed 's/  at.*//' \
        | sed 's/^\(0x[0-9a-f]\+\) \+\(0x[0-9a-f]\+\) */ {\1, \2},/' \
        | less
-
diff --git a/debug/test/test b/debug/test/test
index 467b72c..42ebcb6 100755
--- a/debug/test/test
+++ b/debug/test/test
@@ -259,4 +259,3 @@ else
 fi

 main
-
diff --git a/debug/test/test_disk_bsd b/debug/test/test_disk_bsd
index 3bcf0f0..9206fae 100755
--- a/debug/test/test_disk_bsd
+++ b/debug/test/test_disk_bsd
@@ -91,4 +91,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_disk_dos b/debug/test/test_disk_dos
index 08c5d7f..4933ed4 100755
--- a/debug/test/test_disk_dos
+++ b/debug/test/test_disk_dos
@@ -170,4 +170,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_disk_dvh b/debug/test/test_disk_dvh
index 29caf1f..9e84aa3 100755
--- a/debug/test/test_disk_dvh
+++ b/debug/test/test_disk_dvh
@@ -91,4 +91,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_disk_gpt b/debug/test/test_disk_gpt
index 8e86f79..721891d 100755
--- a/debug/test/test_disk_gpt
+++ b/debug/test/test_disk_gpt
@@ -75,4 +75,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_disk_mac b/debug/test/test_disk_mac
index 1d0e894..09b1353 100755
--- a/debug/test/test_disk_mac
+++ b/debug/test/test_disk_mac
@@ -75,4 +75,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_disk_pc98 b/debug/test/test_disk_pc98
index 748424e..923d8be 100755
--- a/debug/test/test_disk_pc98
+++ b/debug/test/test_disk_pc98
@@ -99,4 +99,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_disk_sun b/debug/test/test_disk_sun
index b9d7e29..d65ec10 100755
--- a/debug/test/test_disk_sun
+++ b/debug/test/test_disk_sun
@@ -91,4 +91,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_fs_ext2 b/debug/test/test_fs_ext2
index 9bb9141..f1f2ec0 100755
--- a/debug/test/test_fs_ext2
+++ b/debug/test/test_fs_ext2
@@ -95,4 +95,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_fs_fat b/debug/test/test_fs_fat
index 7a51e4e..6eddecb 100755
--- a/debug/test/test_fs_fat
+++ b/debug/test/test_fs_fat
@@ -178,4 +178,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_fs_hfs b/debug/test/test_fs_hfs
index 9c4985c..cb0d3f1 100644
--- a/debug/test/test_fs_hfs
+++ b/debug/test/test_fs_hfs
@@ -88,4 +88,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_fs_hfsplus b/debug/test/test_fs_hfsplus
index d45fc3c..39652df 100644
--- a/debug/test/test_fs_hfsplus
+++ b/debug/test/test_fs_hfsplus
@@ -92,4 +92,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_fs_linux_swap b/debug/test/test_fs_linux_swap
index 2fb3028..512dded 100755
--- a/debug/test/test_fs_linux_swap
+++ b/debug/test/test_fs_linux_swap
@@ -66,4 +66,3 @@ main()
 }

 main
-
diff --git a/debug/test/test_fs_reiserfs b/debug/test/test_fs_reiserfs
index 69a1e60..7e1ffdf 100755
--- a/debug/test/test_fs_reiserfs
+++ b/debug/test/test_fs_reiserfs
@@ -95,4 +95,3 @@ main()
 }

 main
-
diff --git a/debug/test/testrc b/debug/test/testrc
index c4dff00..a2d154f 100644
--- a/debug/test/testrc
+++ b/debug/test/testrc
@@ -38,4 +38,3 @@ VERBOSE_LOGS=1

 # set this if you want to do malloc() debugging with mtrace
 #MALLOC_TRACE=malloc-trace
-
diff --git a/doc/API b/doc/API
index 70e89fa..ea83aaf 100644
--- a/doc/API
+++ b/doc/API
@@ -284,5 +284,3 @@ typedef void PedTimerHandler (PedTimer* timer, void* 
context);

 11.1   FIELDS
 --------------
-
-
diff --git a/doc/FAT b/doc/FAT
index 8b5dc91..9a3a991 100644
--- a/doc/FAT
+++ b/doc/FAT
@@ -757,5 +757,3 @@ libparted/fs_fat/resize.c (slightly edited):

                return 1;
        }
-
-
diff --git a/doc/USER.jp b/doc/USER.jp
index 7d747c4..35ede18 100644
--- a/doc/USER.jp
+++ b/doc/USER.jp
@@ -1784,4 +1784,3 @@ online ext2 resizer 
 ¤ì¤Æ¤¤¤Þ¤¹¡£
        http://devlinux.com/projects/reiserfs
   * yaboot (!)  http://ppclinux.apple.com/~benh/
-
diff --git a/doc/fdl.texi b/doc/fdl.texi
index b87f2ae..d9bbb83 100644
--- a/doc/fdl.texi
+++ b/doc/fdl.texi
@@ -400,4 +400,3 @@ to permit their use in free software.
 @c Local Variables:
 @c ispell-local-pdict: "ispell-dict"
 @c End:
-
diff --git a/doc/parted-pt_BR.texi b/doc/parted-pt_BR.texi
index de021ce..0aa8b3d 100644
--- a/doc/parted-pt_BR.texi
+++ b/doc/parted-pt_BR.texi
@@ -2896,4 +2896,3 @@ is extra information, not required for the identification 
of the book,
 e.g. its identity has already been established).

 @end ignore
-
diff --git a/include/parted/constraint.h b/include/parted/constraint.h
index df1ad29..6f0cca3 100644
--- a/include/parted/constraint.h
+++ b/include/parted/constraint.h
@@ -95,4 +95,3 @@ extern PedConstraint*
 ped_constraint_exact (const PedGeometry* geom);

 #endif /* PED_CONSTRAINT_H_INCLUDED */
-
diff --git a/include/parted/device.h b/include/parted/device.h
index 5ca3f12..0634465 100644
--- a/include/parted/device.h
+++ b/include/parted/device.h
@@ -163,4 +163,3 @@ extern void _ped_device_probe (const char* path);
 #endif /* PED_DEVICE_H_INCLUDED */

 /** @} */
-
diff --git a/include/parted/endian.h b/include/parted/endian.h
index 46c933f..0a471fc 100644
--- a/include/parted/endian.h
+++ b/include/parted/endian.h
@@ -83,4 +83,3 @@
 #endif /* !WORDS_BIGENDIAN */

 #endif /* PED_ENDIAN_H_INCLUDED */
-
diff --git a/include/parted/exception.h b/include/parted/exception.h
index 831b804..8378ca8 100644
--- a/include/parted/exception.h
+++ b/include/parted/exception.h
@@ -114,4 +114,3 @@ extern void                 ped_exception_leave_all ();
 #endif /* PED_EXCEPTION_H_INCLUDED */

 /** @} */
-
diff --git a/include/parted/geom.h b/include/parted/geom.h
index 1b34270..c7034e8 100644
--- a/include/parted/geom.h
+++ b/include/parted/geom.h
@@ -83,4 +83,3 @@ extern PedSector ped_geometry_map (const PedGeometry* dst,
 #endif /* PED_GEOM_H_INCLUDED */

 /** @} */
-
diff --git a/include/parted/unit.h b/include/parted/unit.h
index 18e8e37..b0c2bae 100644
--- a/include/parted/unit.h
+++ b/include/parted/unit.h
@@ -89,5 +89,3 @@ extern int ped_unit_parse_custom (const char* str, const 
PedDevice* dev,
 #endif /* PED_UNIT_H_INCLUDED */

 /** @} */
-
-
diff --git a/libparted.pc.in b/libparted.pc.in
index 0943bf0..3603926 100644
--- a/libparted.pc.in
+++ b/libparted.pc.in
@@ -8,4 +8,3 @@ Description: The GNU Parted disk partitioning shared library
 Version: @VERSION@
 Libs: -L${libdir} -lparted
 Cflags: -I${includedir}
-
diff --git a/libparted/ChangeLog.0 b/libparted/ChangeLog.0
index b064596..16c11c3 100644
--- a/libparted/ChangeLog.0
+++ b/libparted/ChangeLog.0
@@ -253,4 +253,3 @@ Free Software Foundation Inc.

 This file may be modified and/or distributed without restriction.  This is
 not an invitation to misrepresent the history of GNU Parted.
-
diff --git a/libparted/arch/gnu.c b/libparted/arch/gnu.c
index 22fc0d0..20b0958 100644
--- a/libparted/arch/gnu.c
+++ b/libparted/arch/gnu.c
@@ -887,4 +887,3 @@ PedArchitecture ped_gnu_arch = {
        dev_ops:        &gnu_dev_ops,
        disk_ops:       &gnu_disk_ops
 };
-
diff --git a/libparted/cs/constraint.c b/libparted/cs/constraint.c
index 2b0b6df..57f218d 100644
--- a/libparted/cs/constraint.c
+++ b/libparted/cs/constraint.c
@@ -527,4 +527,3 @@ ped_constraint_exact (const PedGeometry* geom)
 /**
  * @}
  */
-
diff --git a/libparted/exception.c b/libparted/exception.c
index 08a3613..4a310ba 100644
--- a/libparted/exception.c
+++ b/libparted/exception.c
@@ -309,4 +309,3 @@ ped_exception_leave_all ()
 }

 /** @} */
-
diff --git a/libparted/fs/amiga/affs.h b/libparted/fs/amiga/affs.h
index f487fae..61c38e1 100644
--- a/libparted/fs/amiga/affs.h
+++ b/libparted/fs/amiga/affs.h
@@ -17,4 +17,3 @@
     You should have received a copy of the GNU General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
-
diff --git a/libparted/fs/amiga/amiga.h b/libparted/fs/amiga/amiga.h
index c74611f..fe11ce5 100644
--- a/libparted/fs/amiga/amiga.h
+++ b/libparted/fs/amiga/amiga.h
@@ -68,4 +68,3 @@ struct AmigaIds {
 struct AmigaIds * _amiga_add_id (uint32_t id, struct AmigaIds *ids);
 void _amiga_free_ids (struct AmigaIds *ids);
 int _amiga_id_in_list (uint32_t id, struct AmigaIds *ids);
-
diff --git a/libparted/fs/bfs/bfs.c b/libparted/fs/bfs/bfs.c
index 9f0cde7..2ebc008 100644
--- a/libparted/fs/bfs/bfs.c
+++ b/libparted/fs/bfs/bfs.c
@@ -270,5 +270,3 @@ ped_file_system_bfs_done ()
 {
        ped_file_system_type_unregister (&bfs_type);
 }
-
-
diff --git a/libparted/fs/bfs/bfs.h b/libparted/fs/bfs/bfs.h
index 07d8a75..2fb75ab 100644
--- a/libparted/fs/bfs/bfs.h
+++ b/libparted/fs/bfs/bfs.h
@@ -44,4 +44,3 @@ struct BfsSpecific
 };

 #endif
-
diff --git a/libparted/fs/ext2/ext2_buffer.c b/libparted/fs/ext2/ext2_buffer.c
index c7b18ef..9bc5db8 100644
--- a/libparted/fs/ext2/ext2_buffer.c
+++ b/libparted/fs/ext2/ext2_buffer.c
@@ -444,4 +444,3 @@ int ext2_brelse(struct ext2_buffer_head *bh, int forget)
 }

 #endif /* !DISCOVER_ONLY */
-
diff --git a/libparted/fs/ext2/ext2_inode_relocator.c 
b/libparted/fs/ext2/ext2_inode_relocator.c
index 1922aaa..7332999 100644
--- a/libparted/fs/ext2/ext2_inode_relocator.c
+++ b/libparted/fs/ext2/ext2_inode_relocator.c
@@ -597,4 +597,3 @@ int ext2_inode_relocate(struct ext2_fs *fs, int newgroups)
        return 1;
 }
 #endif /* !DISCOVER_ONLY */
-
diff --git a/libparted/fs/ext2/parted_io.h b/libparted/fs/ext2/parted_io.h
index 339c8a0..76a4880 100644
--- a/libparted/fs/ext2/parted_io.h
+++ b/libparted/fs/ext2/parted_io.h
@@ -25,4 +25,3 @@
 void ext2_destroy_dev_handle(struct ext2_dev_handle *handle);

 #endif
-
diff --git a/libparted/fs/fat/bootsector.c b/libparted/fs/fat/bootsector.c
index 8a76c0a..b987918 100644
--- a/libparted/fs/fat/bootsector.c
+++ b/libparted/fs/fat/bootsector.c
@@ -450,4 +450,3 @@ fat_info_sector_write (const FatInfoSector* is, 
PedFileSystem *fs)
        return ped_geometry_sync (fs->geom);
 }
 #endif /* !DISCOVER_ONLY */
-
diff --git a/libparted/fs/fat/bootsector.h b/libparted/fs/fat/bootsector.h
index 97c86e6..5a12fdf 100644
--- a/libparted/fs/fat/bootsector.h
+++ b/libparted/fs/fat/bootsector.h
@@ -130,4 +130,3 @@ int fat_info_sector_generate (FatInfoSector* is, const 
PedFileSystem* fs);
 int fat_info_sector_write (const FatInfoSector* is, PedFileSystem* fs);

 #endif /* PED_FAT_BOOTSECTOR_H */
-
diff --git a/libparted/fs/fat/calc.h b/libparted/fs/fat/calc.h
index 48ccba4..714bf19 100644
--- a/libparted/fs/fat/calc.h
+++ b/libparted/fs/fat/calc.h
@@ -75,4 +75,3 @@ extern FatCluster
 fat_sector_to_cluster (const PedFileSystem* fs, PedSector sector);

 #endif /* PED_FAT_CALC_H */
-
diff --git a/libparted/fs/fat/clstdup.h b/libparted/fs/fat/clstdup.h
index 359fd61..da3a2c0 100644
--- a/libparted/fs/fat/clstdup.h
+++ b/libparted/fs/fat/clstdup.h
@@ -25,4 +25,3 @@
 extern int fat_duplicate_clusters (FatOpContext* ctx, PedTimer* timer);

 #endif /* PED_FAT_CLSTDUP_H_INCLUDED */
-
diff --git a/libparted/fs/fat/count.c b/libparted/fs/fat/count.c
index 234c584..0db54f1 100644
--- a/libparted/fs/fat/count.c
+++ b/libparted/fs/fat/count.c
@@ -401,4 +401,3 @@ fat_is_fragment_active (PedFileSystem* fs, FatFragment frag)
 }

 #endif /* !DISCOVER_ONLY */
-
diff --git a/libparted/fs/fat/fat.c b/libparted/fs/fat/fat.c
index bf38206..efc8d79 100644
--- a/libparted/fs/fat/fat.c
+++ b/libparted/fs/fat/fat.c
@@ -887,4 +887,3 @@ ped_file_system_fat_done ()
        ped_file_system_type_unregister (&fat16_type);
        ped_file_system_type_unregister (&fat32_type);
 }
-
diff --git a/libparted/fs/fat/table.h b/libparted/fs/fat/table.h
index 0bfbffa..4e2058c 100644
--- a/libparted/fs/fat/table.h
+++ b/libparted/fs/fat/table.h
@@ -72,4 +72,3 @@ extern int fat_table_set_bad (FatTable* ft, FatCluster 
cluster);
 extern int fat_table_entry_size (FatType fat_type);

 #endif /* PED_FAT_TABLE_H_INCLUDED */
-
diff --git a/libparted/fs/ntfs/ntfs.c b/libparted/fs/ntfs/ntfs.c
index 67438f5..2bec288 100644
--- a/libparted/fs/ntfs/ntfs.c
+++ b/libparted/fs/ntfs/ntfs.c
@@ -97,5 +97,3 @@ ped_file_system_ntfs_done ()
 {
        ped_file_system_type_unregister (&ntfs_type);
 }
-
-
diff --git a/libparted/fs/xfs/xfs.c b/libparted/fs/xfs/xfs.c
index 0691d52..dc4374d 100644
--- a/libparted/fs/xfs/xfs.c
+++ b/libparted/fs/xfs/xfs.c
@@ -116,4 +116,3 @@ ped_file_system_xfs_done ()
 {
        ped_file_system_type_unregister (&xfs_type);
 }
-
diff --git a/libparted/mbr.s b/libparted/mbr.s
index 110bfdc..9d1d15e 100644
--- a/libparted/mbr.s
+++ b/libparted/mbr.s
@@ -83,4 +83,3 @@ found_bootable:

 error:
        jmp     error
-
diff --git a/libparted/tests/common.h b/libparted/tests/common.h
index 3fbad73..8798ecb 100644
--- a/libparted/tests/common.h
+++ b/libparted/tests/common.h
@@ -24,4 +24,3 @@ int _implemented_disk_label (const char* label);
  *
  */
 PedExceptionOption _test_exception_handler (PedException* e);
-
diff --git a/parted/command.c b/parted/command.c
index 52fb15c..4f6013c 100644
--- a/parted/command.c
+++ b/parted/command.c
@@ -139,4 +139,3 @@ command_run (Command* cmd, PedDevice** dev)
 {
        return cmd->method (dev);
 }
-
diff --git a/parted/command.h b/parted/command.h
index ea7547c..b90a55e 100644
--- a/parted/command.h
+++ b/parted/command.h
@@ -46,4 +46,3 @@ extern void command_print_help (Command* cmd);
 extern int command_run (Command* cmd, PedDevice** dev);

 #endif /* COMMAND_H_INCLUDED */
-
diff --git a/parted/strlist.h b/parted/strlist.h
index 3bc4656..c62a3a6 100644
--- a/parted/strlist.h
+++ b/parted/strlist.h
@@ -64,4 +64,3 @@ extern StrList* str_list_match (const StrList* list, const 
char* str);
 extern int str_list_length (const StrList* list);

 #endif /* STRLIST_H_INCLUDED */
-
diff --git a/parted/table.h b/parted/table.h
index 8b8e739..1d42498 100644
--- a/parted/table.h
+++ b/parted/table.h
@@ -49,4 +49,3 @@ void table_add_row (Table* t, wchar_t** row);
 void table_add_row_from_strlist (Table* t, StrList* list);

 wchar_t* table_render(Table* t);
-
diff --git a/scripts/update-po b/scripts/update-po
index a8e5af2..0937632 100755
--- a/scripts/update-po
+++ b/scripts/update-po
@@ -87,4 +87,3 @@ case `wget --help` in
 esac

 get_translations po $package
-
-- 
1.7.1.328.g9993c


>From 2c922ad81e4e81e5c67f73b7adc68118cb621d28 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 19:20:21 +0200
Subject: [PATCH 3/8] tests: improved portability

* tests/test-lib.sh: Don't use test's -a option.
---
 tests/test-lib.sh |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index 3deec79..4c08288 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -140,7 +140,8 @@ test_expect_failure () {
        then
                say >&3 "expecting failure: $2"
                test_run_ "$2"
-               if [ "$?" = 0 -a "$eval_ret" != 0 -a "$eval_ret" -lt 129 ]
+               if test "$?" = 0 && test "$eval_ret" != 0 \
+                     && test "$eval_ret" -lt 129
                then
                        test_ok_ "$1"
                else
@@ -157,7 +158,7 @@ test_expect_success () {
        then
                say >&3 "expecting success: $2"
                test_run_ "$2"
-               if [ "$?" = 0 -a "$eval_ret" = 0 ]
+               if test "$?" = 0 && test "$eval_ret" = 0
                then
                        test_ok_ "$1"
                else
@@ -174,7 +175,7 @@ test_expect_code () {
        then
                say >&3 "expecting exit code $1: $3"
                test_run_ "$3"
-               if [ "$?" = 0 -a "$eval_ret" = "$1" ]
+               if test "$?" = 0 && test "$eval_ret" = "$1"
                then
                        test_ok_ "$2"
                else
-- 
1.7.1.328.g9993c


>From 79dd43f037dc41363525ec782f11f429b633520d Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 18:35:27 +0200
Subject: [PATCH 4/8] build: update gnulib submodule to latest

---
 gnulib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnulib b/gnulib
index e046ffb..092a816 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit e046ffb123d352dec87f91fc638490572ef4d31d
+Subproject commit 092a81622804491f13fb73f4df610db0db45b35a
-- 
1.7.1.328.g9993c


>From de6b65cc448b5683693fff18cc85742650552d1e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 19:42:44 +0200
Subject: [PATCH 5/8] tests: rename generated init.sh to old-init.sh

* tests/Makefile.am (old-init.sh): Rename from init.sh.
* libparted/tests/Makefile.am: Likewise.
* tests/test-lib.sh: Rename sole use.
* .gitignore: Rename here, too.
---
 .gitignore                  |    2 +-
 libparted/tests/Makefile.am |    6 +++---
 tests/Makefile.am           |    6 +++---
 tests/test-lib.sh           |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index 609109c..080740d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,7 +49,7 @@ partprobe/partprobe
 po/.reference
 stamp-h1
 tags
-tests/init.sh
+tests/old-init.sh
 tests/print-align
 tests/t*.sh.log
 tests/test-suite.log
diff --git a/libparted/tests/Makefile.am b/libparted/tests/Makefile.am
index b433c83..2a60023 100644
--- a/libparted/tests/Makefile.am
+++ b/libparted/tests/Makefile.am
@@ -23,9 +23,9 @@ symlink_SOURCES = common.h common.c symlink.c

 MAINTAINERCLEANFILES = Makefile.in

-CLEANFILES = init.sh
-all: init.sh
-init.sh: Makefile.in
+CLEANFILES = old-init.sh
+all: old-init.sh
+old-init.sh: Makefile.in
        rm -f address@hidden $@
        echo 'PARTED_USABLE_TEST_DIR="$(PARTED_USABLE_TEST_DIR)"' > 
address@hidden
        echo 'abs_top_srcdir="$(abs_top_srcdir)"' >> address@hidden
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2388ec3..ce79f4a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -58,9 +58,9 @@ parted_dir = $(abs_top_builddir)/parted
 pp_dir = $(abs_top_builddir)/partprobe
 sep = $(PATH_SEPARATOR)

-CLEANFILES = init.sh
-all: init.sh
-init.sh: Makefile.in
+CLEANFILES = old-init.sh
+all: old-init.sh
+old-init.sh: Makefile.in
        rm -f address@hidden $@
        echo 'PARTED_USABLE_TEST_DIR="$(PARTED_USABLE_TEST_DIR)"' > 
address@hidden
        echo 'abs_top_srcdir="$(abs_top_srcdir)"' >> address@hidden
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index 4c08288..8ed9b01 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -9,7 +9,7 @@ TZ=UTC
 export LANG LC_ALL TZ
 export PARTED_SUPPRESS_FILE_SYSTEM_MANIPULATION_WARNING=1

-. ./init.sh || { echo >&2 you must run make first; exit 1; }
+. ./old-init.sh || { echo >&2 you must run make first; exit 1; }

 # Protect ourselves from common misconfiguration to export
 # CDPATH into the environment
-- 
1.7.1.328.g9993c


>From 91abdf3f14cbe172586f52f4671adb5f3c11506a Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 22:18:51 +0200
Subject: [PATCH 6/8] tests: use gnulib's init.sh

* tests/init.sh: New file, from gnulib.
---
 tests/init.sh |  357 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 357 insertions(+), 0 deletions(-)
 create mode 100644 tests/init.sh

diff --git a/tests/init.sh b/tests/init.sh
new file mode 100644
index 0000000..512e876
--- /dev/null
+++ b/tests/init.sh
@@ -0,0 +1,357 @@
+# source this file; set up for tests
+
+# Copyright (C) 2009, 2010 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Using this file in a test
+# =========================
+#
+# The typical skeleton of a test looks like this:
+#
+#   #!/bin/sh
+#   : ${srcdir=.}
+#   . "$srcdir/init.sh"; path_prepend_ .
+#   Execute some commands.
+#   Note that these commands are executed in a subdirectory, therefore you
+#   need to prepend "../" to relative filenames in the build directory.
+#   Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
+#   Use the skip_ and fail_ functions to print a diagnostic and then exit
+#   with the corresponding exit code.
+#   Exit $?
+
+# Executing a test that uses this file
+# ====================================
+#
+# Running a single test:
+#   $ make check TESTS=test-foo.sh
+#
+# Running a single test, with verbose output:
+#   $ make check TESTS=test-foo.sh VERBOSE=yes
+#
+# Running a single test, with single-stepping:
+#   1. Go into a sub-shell:
+#   $ bash
+#   2. Set relevant environment variables from TESTS_ENVIRONMENT in the
+#      Makefile:
+#   $ export srcdir=../../tests # this is an example
+#   3. Execute the commands from the test, copy&pasting them one by one:
+#   $ . "$srcdir/init.sh"; path_prepend_ .
+#   ...
+#   4. Finally
+#   $ exit
+
+# We require $(...) support unconditionally.
+# We require a few additional shell features only when $EXEEXT is nonempty,
+# in order to support automatic $EXEEXT emulation:
+# - hyphen-containing alias names
+# - we prefer to use ${var#...} substitution, rather than having
+#   to work around lack of support for that feature.
+# The following code attempts to find a shell with support for these features
+# and re-exec's it.  If not, it skips the current test.
+
+gl_shell_test_script_='
+test $(echo y) = y || exit 1
+test -z "$EXEEXT" && exit 0
+shopt -s expand_aliases
+alias a-b="echo zoo"
+v=abx
+     test ${v%x} = ab \
+  && test ${v#a} = bx \
+  && test $(a-b) = zoo
+'
+
+if test "x$1" = "x--no-reexec"; then
+  shift
+else
+  for re_shell_ in "${CONFIG_SHELL:-no_shell}" /bin/sh bash dash zsh pdksh fail
+  do
+    test "$re_shell_" = no_shell && continue
+    test "$re_shell_" = fail && skip_ failed to find an adequate shell
+    if "$re_shell_" -c "$gl_shell_test_script_" 2>/dev/null; then
+      exec "$re_shell_" "$0" --no-reexec "$@"
+      echo "$ME_: exec failed" 1>&2
+      exit 127
+    fi
+  done
+fi
+
+test -n "$EXEEXT" && shopt -s expand_aliases
+
+# We use a trap below for cleanup.  This requires us to go through
+# hoops to get the right exit status transported through the handler.
+# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function.
+Exit () { set +e; (exit $1); exit $1; }
+
+# Print warnings (e.g., about skipped and failed tests) to this file number.
+# Override by defining to say, 9, in init.cfg, and putting say,
+# "export ...ENVVAR_SETTINGS...; exec 9>&2; $(SHELL)" in the definition
+# of TESTS_ENVIRONMENT in your tests/Makefile.am file.
+# This is useful when using automake's parallel tests mode, to print
+# the reason for skip/failure to console, rather than to the .log files.
+: ${stderr_fileno_=2}
+
+warn_() { echo "$@" 1>&$stderr_fileno_; }
+fail_() { warn_ "$ME_: failed test: $@"; Exit 1; }
+skip_() { warn_ "$ME_: skipped test: $@"; Exit 77; }
+framework_failure_() { warn_ "$ME_: set-up failure: $@"; Exit 1; }
+
+# This is a stub function that is run upon trap (upon regular exit and
+# interrupt).  Override it with a per-test function, e.g., to unmount
+# a partition, or to undo any other global state changes.
+cleanup_() { :; }
+
+if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+  compare() { diff -u "$@"; }
+elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
+  compare() { cmp -s "$@"; }
+else
+  compare() { cmp "$@"; }
+fi
+
+# An arbitrary prefix to help distinguish test directories.
+testdir_prefix_() { printf gt; }
+
+# Run the user-overridable cleanup_ function, remove the temporary
+# directory and exit with the incoming value of $?.
+remove_tmp_()
+{
+  __st=$?
+  cleanup_
+  # cd out of the directory we're about to remove
+  cd "$initial_cwd_" || cd / || cd /tmp
+  chmod -R u+rwx "$test_dir_"
+  # If removal fails and exit status was to be 0, then change it to 1.
+  rm -rf "$test_dir_" || { test $__st = 0 && __st=1; }
+  exit $__st
+}
+
+# Given a directory name, DIR, if every entry in it that matches *.exe
+# contains only the specified bytes (see the case stmt below), then print
+# a space-separated list of those names and return 0.  Otherwise, don't
+# print anything and return 1.  Naming constraints apply also to DIR.
+find_exe_basenames_()
+{
+  feb_dir_=$1
+  feb_fail_=0
+  feb_result_=
+  feb_sp_=
+  for feb_file_ in $feb_dir_/*.exe; do
+    case $feb_file_ in
+      *[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
+      *) # Remove leading file name components as well as the .exe suffix.
+         feb_file_=${feb_file_##*/}
+         feb_file_=${feb_file_%.exe}
+         feb_result_="$feb_result_$feb_sp_$feb_file_";;
+    esac
+    feb_sp_=' '
+  done
+  test $feb_fail_ = 0 && printf %s "$feb_result_"
+  return $feb_fail_
+}
+
+# Consider the files in directory, $1.
+# For each file name of the form PROG.exe, create an alias named
+# PROG that simply invokes PROG.exe, then return 0.  If any selected
+# file name or the directory name, $1, contains an unexpected character,
+# define no function and return 1.
+create_exe_shims_()
+{
+  case $EXEEXT in
+    '') return 0 ;;
+    .exe) ;;
+    *) echo "$0: unexpected \$EXEEXT value: $EXEEXT" 1>&2; return 1 ;;
+  esac
+
+  base_names_=`find_exe_basenames_ $1` \
+    || { echo "$0 (exe_shim): skipping directory: $1" 1>&2; return 1; }
+
+  if test -n "$base_names_"; then
+    for base_ in $base_names_; do
+      alias "$base_"="$base_$EXEEXT"
+    done
+  fi
+
+  return 0
+}
+
+# Use this function to prepend to PATH an absolute name for each
+# specified, possibly-$initial_cwd_-relative, directory.
+path_prepend_()
+{
+  while test $# != 0; do
+    path_dir_=$1
+    case $path_dir_ in
+      '') fail_ "invalid path dir: '$1'";;
+      /*) abs_path_dir_=$path_dir_;;
+      *) abs_path_dir_=`cd "$initial_cwd_/$path_dir_" && echo "$PWD"` \
+           || fail_ "invalid path dir: $path_dir_";;
+    esac
+    case $abs_path_dir_ in
+      *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
+    esac
+    PATH="$abs_path_dir_:$PATH"
+
+    # Create an alias, FOO, for each FOO.exe in this directory.
+    create_exe_shims_ "$abs_path_dir_" \
+      || fail_ "something failed (above): $abs_path_dir_"
+    shift
+  done
+  export PATH
+}
+
+setup_()
+{
+  test "$VERBOSE" = yes && set -x
+
+  initial_cwd_=$PWD
+  ME_=`expr "./$0" : '.*/\(.*\)$'`
+
+  pfx_=`testdir_prefix_`
+  test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
+    || fail_ "failed to create temporary directory in $initial_cwd_"
+  cd "$test_dir_"
+
+  # These trap statements ensure that the temporary directory, $test_dir_,
+  # is removed upon exit as well as upon receipt of any of the listed signals.
+  trap remove_tmp_ 0
+  for sig_ in 1 2 3 13 15; do
+    eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+  done
+}
+
+# Create a temporary directory, much like mktemp -d does.
+# Written by Jim Meyering.
+#
+# Usage: mktempd_ /tmp phoey.XXXXXXXXXX
+#
+# First, try to use the mktemp program.
+# Failing that, we'll roll our own mktemp-like function:
+#  - try to get random bytes from /dev/urandom
+#  - failing that, generate output from a combination of quickly-varying
+#      sources and gzip.  Ignore non-varying gzip header, and extract
+#      "random" bits from there.
+#  - given those bits, map to file-name bytes using tr, and try to create
+#      the desired directory.
+#  - make only $MAX_TRIES_ attempts
+
+# Helper function.  Print $N pseudo-random bytes from a-zA-Z0-9.
+rand_bytes_()
+{
+  n_=$1
+
+  # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first?
+  # But if they have openssl, they probably have mktemp, too.
+
+  chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+  dev_rand_=/dev/urandom
+  if test -r "$dev_rand_"; then
+    # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
+    dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
+      | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+    return
+  fi
+
+  n_plus_50_=`expr $n_ + 50`
+  cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
+  data_=` (eval "$cmds_") 2>&1 | gzip `
+
+  # Ensure that $data_ has length at least 50+$n_
+  while :; do
+    len_=`echo "$data_"|wc -c`
+    test $n_plus_50_ -le $len_ && break;
+    data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip `
+  done
+
+  echo "$data_" \
+    | dd bs=1 skip=50 count=$n_ 2>/dev/null \
+    | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+}
+
+mktempd_()
+{
+  case $# in
+  2);;
+  *) fail_ "Usage: $ME DIR TEMPLATE";;
+  esac
+
+  destdir_=$1
+  template_=$2
+
+  MAX_TRIES_=4
+
+  # Disallow any trailing slash on specified destdir:
+  # it would subvert the post-mktemp "case"-based destdir test.
+  case $destdir_ in
+  /) ;;
+  */) fail_ "invalid destination dir: remove trailing slash(es)";;
+  esac
+
+  case $template_ in
+  *XXXX) ;;
+  *) fail_ "invalid template: $template_ (must have a suffix of at least 4 
X's)";;
+  esac
+
+  fail=0
+
+  # First, try to use mktemp.
+  d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
+    || fail=1
+
+  # The resulting name must be in the specified directory.
+  case $d in "$destdir_"*);; *) fail=1;; esac
+
+  # It must have created the directory.
+  test -d "$d" || fail=1
+
+  # It must have 0700 permissions.  Handle sticky "S" bits.
+  perms=`ls -dgo "$d" 2>/dev/null|tr S -` || fail=1
+  case $perms in drwx------*) ;; *) fail=1;; esac
+
+  test $fail = 0 && {
+    echo "$d"
+    return
+  }
+
+  # If we reach this point, we'll have to create a directory manually.
+
+  # Get a copy of the template without its suffix of X's.
+  base_template_=`echo "$template_"|sed 's/XX*$//'`
+
+  # Calculate how many X's we've just removed.
+  template_length_=`echo "$template_" | wc -c`
+  nx_=`echo "$base_template_" | wc -c`
+  nx_=`expr $template_length_ - $nx_`
+
+  err_=
+  i_=1
+  while :; do
+    X_=`rand_bytes_ $nx_`
+    candidate_dir_="$destdir_/$base_template_$X_"
+    err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
+      && { echo "$candidate_dir_"; return; }
+    test $MAX_TRIES_ -le $i_ && break;
+    i_=`expr $i_ + 1`
+  done
+  fail_ "$err_"
+}
+
+# If you want to override the testdir_prefix_ function,
+# or to add more utility functions, use this file.
+test -f "$srcdir/init.cfg" \
+  && . "$srcdir/init.cfg"
+
+setup_ "$@"
-- 
1.7.1.328.g9993c


>From 780f716c41c5f60bfb296b81501eb23c5bcee04b Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 22:26:41 +0200
Subject: [PATCH 7/8] ui: make --help tell where to report bugs

* parted/ui.c (help_msg): Tell where to report bugs.
---
 parted/ui.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/parted/ui.c b/parted/ui.c
index 04fc733..d6ef7cd 100644
--- a/parted/ui.c
+++ b/parted/ui.c
@@ -1517,6 +1517,7 @@ help_msg ()
         fputs (_("COMMANDs:"), stdout);
         putchar ('\n');
         print_commands_help ();
+        printf (_("\nReport bugs to %s\n"), PACKAGE_BUGREPORT);
         exit (EXIT_SUCCESS);
 }

-- 
1.7.1.328.g9993c


>From efa2c2b12a283334968d53df2f5cc1a1c127b478 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 28 Apr 2010 19:27:16 +0200
Subject: [PATCH 8/8] tests: add help-version test (from coreutils)

* tests/help-version: New file
* tests/Makefile.am (TESTS_ENVIRONMENT): Pass built_programs and VERSION
to test scripts -- both are required by help-version.
(TESTS): Add help-version.
---
 tests/Makefile.am  |    3 +
 tests/help-version |  273 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 276 insertions(+), 0 deletions(-)
 create mode 100755 tests/help-version

diff --git a/tests/Makefile.am b/tests/Makefile.am
index ce79f4a..dfba691 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -2,6 +2,7 @@ XFAIL_TESTS = \
   t3200-type-change.sh

 TESTS = \
+  help-version \
   t0000-basic.sh \
   t0001-tiny.sh \
   t0010-script-no-ctrl-chars.sh \
@@ -96,6 +97,7 @@ TESTS_ENVIRONMENT =                           \
   abs_top_builddir='$(abs_top_builddir)'       \
   abs_top_srcdir='$(abs_top_srcdir)'           \
   abs_srcdir='$(abs_srcdir)'                   \
+  built_programs=parted                                \
   srcdir='$(srcdir)'                           \
   top_srcdir='$(top_srcdir)'                   \
   CC='$(CC)'                                   \
@@ -108,6 +110,7 @@ TESTS_ENVIRONMENT =                         \
   PREFERABLY_POSIX_SHELL='$(PREFERABLY_POSIX_SHELL)' \
   REPLACE_GETCWD=$(REPLACE_GETCWD)             \
   PATH='$(abs_top_builddir)/parted$(PATH_SEPARATOR)'"$$PATH" \
+  VERSION=$(VERSION)                           \
   ; shell_or_perl_

 VERBOSE = yes
diff --git a/tests/help-version b/tests/help-version
new file mode 100755
index 0000000..9d04a49
--- /dev/null
+++ b/tests/help-version
@@ -0,0 +1,273 @@
+#! /bin/sh
+# Make sure all these programs work properly
+# when invoked with --help or --version.
+
+# Copyright (C) 2000-2010 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
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Ensure that $SHELL is set to *some* value and exported.
+# This is required for dircolors, which would fail e.g., when
+# invoked via debuild (which removes SHELL from the environment).
+test "x$SHELL" = x && SHELL=/bin/sh
+export SHELL
+
+: ${srcdir=.}
+. $srcdir/init.sh
+
+expected_failure_status_chroot=125
+expected_failure_status_env=125
+expected_failure_status_nice=125
+expected_failure_status_nohup=125
+expected_failure_status_stdbuf=125
+expected_failure_status_su=125
+expected_failure_status_timeout=125
+expected_failure_status_printenv=2
+expected_failure_status_tty=3
+expected_failure_status_sort=2
+expected_failure_status_expr=3
+expected_failure_status_lbracket=2
+expected_failure_status_dir=2
+expected_failure_status_ls=2
+expected_failure_status_vdir=2
+
+expected_failure_status_cmp=2
+expected_failure_status_zcmp=2
+expected_failure_status_sdiff=2
+expected_failure_status_diff3=2
+expected_failure_status_diff=2
+expected_failure_status_zdiff=2
+expected_failure_status_zgrep=2
+expected_failure_status_zegrep=2
+expected_failure_status_zfgrep=2
+
+expected_failure_status_grep=2
+expected_failure_status_egrep=2
+expected_failure_status_fgrep=2
+
+test "$built_programs" \
+  || fail_ "built_programs not specified!?!"
+
+test "$VERSION" \
+  || fail_ "set envvar VERSION; it is required for a PATH sanity-check"
+
+# Extract version from --version output of the first program
+for i in $built_programs; do
+  v=$(env $i --version | sed -n '1s/.* //p;q')
+  break
+done
+
+# Ensure that it matches $VERSION.
+test "x$v" = "x$VERSION" \
+  || fail_ "--version-\$VERSION mismatch"
+
+for lang in C fr da; do
+  for i in $built_programs; do
+
+    # Skip `test'; it doesn't accept --help or --version.
+    test $i = test && continue;
+
+    # false fails even when invoked with --help or --version.
+    if test $i = false; then
+      env LC_MESSAGES=$lang $i --help >/dev/null && fail=1
+      env LC_MESSAGES=$lang $i --version >/dev/null && fail=1
+      continue
+    fi
+
+    # The just-built install executable is always named `ginstall'.
+    test $i = install && i=ginstall
+
+    # Make sure they exit successfully, under normal conditions.
+    env $i --help    > h-$i     || fail=1
+    env $i --version >/dev/null || fail=1
+
+    # Make sure they mention the bug-reporting address in --help output.
+    grep "$PACKAGE_BUGREPORT" h-$i > /dev/null || fail=1
+    rm -f h-$i
+
+    # Make sure they fail upon `disk full' error.
+    if test -w /dev/full && test -c /dev/full; then
+      env $i --help    >/dev/full 2>/dev/null && fail=1
+      env $i --version >/dev/full 2>/dev/null && fail=1
+      status=$?
+      test $i = [ && prog=lbracket || prog=$i
+      eval "expected=\$expected_failure_status_$prog"
+      test x$expected = x && expected=1
+      if test $status = $expected; then
+        : # ok
+      else
+        fail=1
+        echo "*** $i: bad exit status \`$status' (expected $expected)," 1>&2
+        echo "  with --help or --version output redirected to /dev/full" 1>&2
+      fi
+    fi
+  done
+done
+
+bigZ_in=bigZ-in.Z
+zin=zin.gz
+zin2=zin2.gz
+
+tmp=tmp-$$
+tmp_in=in-$$
+tmp_in2=in2-$$
+tmp_dir=dir-$$
+tmp_out=out-$$
+mkdir $tmp || fail=1
+cd $tmp || fail=1
+
+comm_setup () { args="$tmp_in $tmp_in"; }
+csplit_setup () { args="$tmp_in //"; }
+cut_setup () { args='-f 1'; }
+join_setup () { args="$tmp_in $tmp_in"; }
+tr_setup () { args='a a'; }
+
+chmod_setup () { args="a+x $tmp_in"; }
+# Punt on these.
+chgrp_setup () { args=--version; }
+chown_setup () { args=--version; }
+mkfifo_setup () { args=--version; }
+mknod_setup () { args=--version; }
+# Punt on uptime, since it fails (e.g., failing to get boot time)
+# on some systems, and we shouldn't let that stop `make check'.
+uptime_setup () { args=--version; }
+
+# Create a file in the current directory, not in $TMPDIR.
+mktemp_setup () { args=mktemp.XXXX; }
+
+cmp_setup () { args="$tmp_in $tmp_in2"; }
+
+# Tell dd not to print the line with transfer rate and total.
+# The transfer rate would vary between runs.
+dd_setup () { args=status=noxfer; }
+
+zdiff_setup () { args="$zin $zin2"; }
+zcmp_setup () { args="$zin $zin2"; }
+zcat_setup () { args=$zin; }
+gunzip_setup () { args=$zin; }
+zmore_setup () { args=$zin; }
+zless_setup () { args=$zin; }
+znew_setup () { args=$bigZ_in; }
+zforce_setup () { args=$zin; }
+zgrep_setup () { args="z $zin"; }
+zegrep_setup () { args="z $zin"; }
+zfgrep_setup () { args="z $zin"; }
+gzexe_setup () { args=$tmp_in; }
+
+# We know that $tmp_in contains a "0"
+grep_setup () { args="0 $tmp_in"; }
+egrep_setup () { args="0 $tmp_in"; }
+fgrep_setup () { args="0 $tmp_in"; }
+
+diff_setup () { args="$tmp_in $tmp_in2"; }
+sdiff_setup () { args="$tmp_in $tmp_in2"; }
+diff3_setup () { args="$tmp_in $tmp_in2 $tmp_in2"; }
+cp_setup () { args="$tmp_in $tmp_in2"; }
+ln_setup () { args="$tmp_in ln-target"; }
+ginstall_setup () { args="$tmp_in $tmp_in2"; }
+mv_setup () { args="$tmp_in $tmp_in2"; }
+mkdir_setup () { args=$tmp_dir/subdir; }
+rmdir_setup () { args=$tmp_dir; }
+rm_setup () { args=$tmp_in; }
+shred_setup () { args=$tmp_in; }
+touch_setup () { args=$tmp_in2; }
+truncate_setup () { args="--reference=$tmp_in $tmp_in2"; }
+
+basename_setup () { args=$tmp_in; }
+dirname_setup () { args=$tmp_in; }
+expr_setup () { args=foo; }
+
+# Punt, in case GNU `id' hasn't been installed yet.
+groups_setup () { args=--version; }
+
+pathchk_setup () { args=$tmp_in; }
+yes_setup () { args=--version; }
+logname_setup () { args=--version; }
+nohup_setup () { args=--version; }
+printf_setup () { args=foo; }
+seq_setup () { args=10; }
+sleep_setup () { args=0; }
+su_setup () { args=--version; }
+stdbuf_setup () { args="-oL true"; }
+timeout_setup () { args=--version; }
+
+# I'd rather not run sync, since it spins up disks that I've
+# deliberately caused to spin down (but not unmounted).
+sync_setup () { args=--version; }
+
+test_setup () { args=foo; }
+
+# This is necessary in the unusual event that there is
+# no valid entry in /etc/mtab.
+df_setup () { args=/; }
+
+# This is necessary in the unusual event that getpwuid (getuid ()) fails.
+id_setup () { args=-u; }
+
+# Use env to avoid invoking built-in sleep of Solaris 11's /bin/sh.
+kill_setup () {
+  env sleep 10m &
+  args=$!
+}
+
+link_setup () { args="$tmp_in link-target"; }
+unlink_setup () { args=$tmp_in; }
+
+readlink_setup () {
+  ln -s . slink
+  args=slink;
+}
+
+stat_setup () { args=$tmp_in; }
+unlink_setup () { args=$tmp_in; }
+lbracket_setup () { args=": ]"; }
+
+parted_setup () { args="-s $tmp_in mklabel gpt"
+  dd if=/dev/null of=$tmp_in seek=2000; }
+
+# Ensure that each program "works" (exits successfully) when doing
+# something more than --help or --version.
+for i in $built_programs; do
+  # Skip these.
+  case $i in chroot|stty|tty|false|chcon|runcon) continue;; esac
+
+  rm -rf $tmp_in $tmp_in2 $tmp_dir $tmp_out $bigZ_in $zin $zin2
+  echo z |gzip > $zin
+  cp $zin $zin2
+  cp $zin $bigZ_in
+
+  # This is sort of kludgey: use numbers so this is valid input for factor,
+  # and two tokens so it's valid input for tsort.
+  echo 2147483647 0 > $tmp_in
+  # Make $tmp_in2 identical. Then, using $tmp_in and $tmp_in2 as arguments
+  # to the likes of cmp and diff makes them exit successfully.
+  cp $tmp_in $tmp_in2
+  mkdir $tmp_dir
+  # echo ================== $i
+  test $i = [ && prog=lbracket || prog=$i
+  if type ${prog}_setup > /dev/null 2>&1; then
+    ${prog}_setup
+  else
+    args=
+  fi
+  if env $i $args < $tmp_in > $tmp_out; then
+    : # ok
+  else
+    echo FAIL: $i
+    fail=1
+  fi
+  rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir
+done
+
+Exit $fail
-- 
1.7.1.328.g9993c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]