[Parted-commits] GNU Parted Official Repository: Changes to
'stable-1.8.x'
Otavio Salvador
otavio at alioth.debian.org
Wed May 9 19:05:39 UTC 2007
configure.ac | 9 ++++++++
include/parted/Makefile.am | 9 ++++++--
libparted/labels/Makefile.am | 10 ++++++---
libparted/labels/dasd.c | 5 ----
libparted/labels/fdasd.c | 5 ----
libparted/labels/vtoc.c | 5 ----
parted/parted.c | 2 -
tests/Makefile.am | 3 +-
tests/t2000-mkfs.sh | 45 +++++++++++++++++++++++++++++++++++++++++++
9 files changed, 71 insertions(+), 22 deletions(-)
New commits:
commit e77bb0f0fe26c694e1786742ac24efad8bc8e6ef
Author: Otavio Salvador <otavio at ossystems.com.br>
Date: Wed May 9 16:03:39 2007 -0300
[parted] Fix script mode support on mkfs commandline command
Parted was lacking support to script mode on do_mkfs method hence
always failing.
Note: tests/t2000-mkfs.sh was created to avoid it to happen again
Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
(cherry picked from commit 20fd17ca725b0705e462d59604951ad7ea34497c)
diff --git a/parted/parted.c b/parted/parted.c
index 99b9f28..d16ad96 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -646,7 +646,7 @@ do_mkfs (PedDevice** dev)
if (!disk)
goto error;
- if (!_partition_warn_loss())
+ if (!opt_script_mode && !_partition_warn_loss())
goto error_destroy_disk;
if (!command_line_get_partition (_("Partition number?"), disk, &part))
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 044e126..2948ae2 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,7 @@
TESTS = \
t0000-basic.sh \
- t1000-mkpartfs.sh
+ t1000-mkpartfs.sh \
+ t2000-mkfs.sh
TESTS_ENVIRONMENT = \
PATH="`pwd`/../parted$(PATH_SEPARATOR)$$PATH"
diff --git a/tests/t2000-mkfs.sh b/tests/t2000-mkfs.sh
new file mode 100755
index 0000000..e47da8f
--- /dev/null
+++ b/tests/t2000-mkfs.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+# Copyright (C) 2007 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 2 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, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+test_description='Create some file systems using mkfs.'
+
+. $srcdir/test-lib.sh
+
+N=40M
+dev=loop-file
+test_expect_success \
+ 'create a file large enough to hold a fat32 file system' \
+ 'dd if=/dev/zero of=$dev bs=$N count=1 2> /dev/null'
+
+test_expect_success \
+ 'label the test disk' \
+ 'parted -s $dev mklabel msdos > out 2>&1'
+test_expect_success 'expect no output' '$compare out /dev/null'
+
+test_expect_success \
+ 'create an partition' \
+ 'parted -s $dev mkpart primary 1 40 > out 2>&1'
+
+test_expect_success \
+ 'create an msdos file system' \
+ 'parted -s $dev mkfs 1 fat32 > out 2>&1'
+
+test_expect_success 'expect no output' '$compare out /dev/null'
+
+test_done
commit acc28864bb858bcdd476facd4bd9a0f79c1cd680
Author: Debarshi Ray <rishi at gnu.org>
Date: Tue May 8 23:05:23 2007 +0530
Preventing compilation of DASD code on GNU Hurd systems through the use of AC_COMPILE_IFELSE and AM_CONDITIONAL, instead of #ifdef.
(cherry picked from commit 2b4fa6af6736ee2526da7f4ae6a173b29c321826)
diff --git a/configure.ac b/configure.ac
index 9b425df..df48796 100644
--- a/configure.ac
+++ b/configure.ac
@@ -436,6 +436,15 @@ AC_CHECK_HEADER([execinfo.h], [
])
])
+dnl Checks for #defines.
+AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+ #if defined __s390__ || defined __s390x__
+ # message s390 defined
+ #endif
+ ]])], [compile_for_s390="no"], [compile_for_s390="yes"])
+AM_CONDITIONAL([COMPILE_FOR_S390], [test "$compile_for_s390" = "yes"])
+
dnl check for "check", unit testing library/header
PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
if test "$have_scintilla" != "yes"; then
diff --git a/include/parted/Makefile.am b/include/parted/Makefile.am
index 3c9b5e5..dd0e1d4 100644
--- a/include/parted/Makefile.am
+++ b/include/parted/Makefile.am
@@ -1,3 +1,9 @@
+if COMPILE_FOR_S390
+S390_HDRS = fdasd.h vtoc.h
+else
+S390_HDRS =
+endif
+
partedincludedir = $(includedir)/parted
partedinclude_HEADERS = gnu.h \
@@ -13,8 +19,7 @@ partedinclude_HEADERS = gnu.h \
timer.h \
unit.h \
parted.h \
- fdasd.h \
- vtoc.h
+ $(S390_HDRS)
noinst_HEADERS = crc32.h \
endian.h
diff --git a/libparted/labels/Makefile.am b/libparted/labels/Makefile.am
index 5b0aec4..f4d7d14 100644
--- a/libparted/labels/Makefile.am
+++ b/libparted/labels/Makefile.am
@@ -3,14 +3,18 @@
#
# This file may be modified and/or distributed without restriction.
+if COMPILE_FOR_S390
+S390_SRCS = dasd.c fdasd.c vtoc.c
+else
+S390_SRCS =
+endif
+
partedincludedir = -I$(top_srcdir)/include
noinst_LTLIBRARIES = liblabels.la
liblabels_la_SOURCES = rdb.c \
bsd.c \
- dasd.c \
- fdasd.c \
- vtoc.c \
+ $(S390_SRCS) \
efi_crc32.c \
dos.c \
dvh.h \
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index fa7d000..f11bc52 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -47,9 +47,6 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
-/* S390 */
-#if defined (__s390__) || defined (__s390x__)
-
#define PARTITION_LINUX_SWAP 0x82
#define PARTITION_LINUX 0x83
#define PARTITION_LINUX_EXT 0x85
@@ -865,5 +862,3 @@ error:
ped_constraint_destroy (constraint_any);
return 0;
}
-
-#endif /* S390 */
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index 6755ee7..198bce2 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -29,9 +29,6 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
-/* S390 */
-#if defined (__s390__) || defined (__s390x__)
-
static int
getpos (fdasd_anchor_t *anc, int dsn)
{
@@ -1051,6 +1048,4 @@ fdasd_add_partition (fdasd_anchor_t *anc, unsigned int start,
return p;
}
-#endif /* S390 */
-
/* vim:set tabstop=4 shiftwidth=4 softtabstop=4: */
diff --git a/libparted/labels/vtoc.c b/libparted/labels/vtoc.c
index 15482c5..bd2c905 100644
--- a/libparted/labels/vtoc.c
+++ b/libparted/labels/vtoc.c
@@ -19,9 +19,6 @@
# define _(String) (String)
#endif /* ENABLE_NLS */
-/* S390 */
-#if defined (__s390__) || defined (__s390x__)
-
static const unsigned char EBCtoASC[256] =
{
/* 0x00 NUL SOH STX ETX *SEL HT *RNL DEL */
@@ -1155,5 +1152,3 @@ vtoc_set_freespace(format4_label_t *f4, format5_label_t *f5,
vtoc_reorganize_FMT5_extents (f5);
}
}
-
-#endif /* S390 */
More information about the Parted-commits
mailing list