OSDN Git Service

android-x86/external-parted.git
17 years agoRead an msdos partition table from a device with 2K sectors.
Jim Meyering [Wed, 30 May 2007 13:55:30 +0000 (15:55 +0200)]
Read an msdos partition table from a device with 2K sectors.

* libparted/labels/dos.c: Include <stdbool.h>.
(msdos_probe): Don't hard-code 512.
Use read_sector, not ped_device_read.
Adapt to changed type of "part_table".
Now that "label" is malloc'd, be sure to free it before returning.
(read_table): Likewise.

17 years agoFix "make distcheck" failure due to not finding usable partition
Jim Meyering [Wed, 30 May 2007 21:19:04 +0000 (23:19 +0200)]
Fix "make distcheck" failure due to not finding usable partition
* m4/o-direct.m4: Require that read as well as write succeed.
Require that both work with blocks of size 512 as well as 4096.
Reiserfs3 doesn't support 512-byte reads.
Allow the user running the test to specify the first directory
to test via the PARTED_TMPDIR envvar, in case none of the dirs
checked by default is usable.

17 years agoFix configure-with-nls vs. wchar.h/wcsdup problem differently.
Jim Meyering [Wed, 30 May 2007 13:40:50 +0000 (15:40 +0200)]
Fix configure-with-nls vs. wchar.h/wcsdup problem differently.
* parted/table.c: Include <config.h> *before* all other #include
directives.  Remove explicit declaration of wcsdup.  Now, we'll
get the one from <wchar.h>.

17 years agoparted/table.c: Fix a warning when compiling with translation support
Otavio Salvador [Wed, 30 May 2007 03:17:43 +0000 (00:17 -0300)]
parted/table.c: Fix a warning when compiling with translation support

,----[ Output when compiling with translation support ]
|...
| table.c: In function 'table_add_row_from_strlist':
| table.c:168: warning: implicit declaration of function 'wcsdup'
| table.c:168: warning: assignment makes pointer from integer without a cast
`----

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years agofdasd label: Move formatting out of translatable strings.
Benno Schulenberg [Tue, 29 May 2007 18:02:25 +0000 (20:02 +0200)]
fdasd label: Move formatting out of translatable strings.

Also gettextize several missed messages, and simplify some of them.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years agovtoc label: Move formatting out of translatable strings.
Benno Schulenberg [Tue, 29 May 2007 17:55:52 +0000 (19:55 +0200)]
vtoc label: Move formatting out of translatable strings.

Also gettextize a few missed messages, and remove some whitespace.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years agoAvoid a leak.
Jim Meyering [Tue, 29 May 2007 19:30:40 +0000 (21:30 +0200)]
Avoid a leak.

* parted/parted.c (do_print): Use separate variables for the header
and for individual rows.  Free each when done.
* parted/table.c (table_add_row_from_strlist): Insert a newly
allocated copy of each string, so that the caller can free
the argument corresponding to the "list" parameter.
* tests/t0100-print.sh: New test for this.
* tests/Makefile.am (TESTS): Add t0100-print.sh.

17 years agoMove a test/utility function into test-lib.sh.
Jim Meyering [Tue, 29 May 2007 18:29:47 +0000 (20:29 +0200)]
Move a test/utility function into test-lib.sh.

* tests/t3000-constraints.sh (emit_superuser_warning): Move this
function to...
* tests/test-lib.sh (emit_superuser_warning): ...here.
* tests/t0000-basic.sh: Use the function instead of open-coding it.

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years agoOn IRC, xeos reported test failures in t0000 and t2000
Jim Meyering [Tue, 29 May 2007 15:36:41 +0000 (17:36 +0200)]
On IRC, xeos reported test failures in t0000 and t2000
with diffs like this:

  -/home/xeos/projects/parted/parted/.libs/lt-parted: invalid token: msdos
  +parted: invalid token: msdos

Here's the patch I expect to apply.
It also removes an inter-part dependency by moving the creation
of the "o2" temporary file into the test where it's used.

Some of this duplication should be factored out, eventually...

17 years agoDiagnose invalid command arguments.
Jim Meyering [Sat, 26 May 2007 04:59:34 +0000 (06:59 +0200)]
Diagnose invalid command arguments.

This started because I objected to parted failing with no diagnostic
when given an invalid file system type:

    $ /sbin/parted -s $dev mklabel loop mkpartfs hfsplus 0 1.4
    WARNING: You are not superuser.  Watch out for permissions.
    [Exit 1]

With the changes below, it does this:

    $ ./parted -s $dev mklabel loop mkpartfs hfsplus 0 1.4
    ./parted: invalid token: hfsplus
    [Exit 1]

The following may look like a simple change, but looks are deceptive...
For example, if you try to diagnose via ped_exception_throw instead
of "error", you'll find that the mere fact of diagnosing the problem
introduces new ones because of how the exception handler manipulates the
global command line buffer containing the token we're complaining about.

But this isn't library code, so using error() is fine.

Diagnose invalid command arguments.
When a command argument doesn't match the expected candidate values,
parted would silently exit (in script mode) or simply act as if that
value and any following ones had not been specified (in interactive
mode).  With this change, it complains about the "invalid token",
and in script mode (where there hasn't been a prompt to give context)
sometimes tells what type of token it was expecting.
* parted/ui.c: Include "error.h".
(command_line_get_word): If the user's "token" wasn't a good enough
match, give a diagnostic.  In script mode, return NULL so that the
callers can give additional information.
* tests/t2000-mkfs.sh: New test for the above.
* tests/t0000-basic.sh: Expect the new diagnostic when "msdos" is
treated as an unrecognized first token after "mklabel".  This happens
when trying to label a disk that already has a label.
* tests/t1100-busy-label.sh: Likewise.

17 years agoUse xmalloc and xrealloc, rather than unchecked malloc and realloc.
Jim Meyering [Fri, 25 May 2007 17:40:56 +0000 (19:40 +0200)]
Use xmalloc and xrealloc, rather than unchecked malloc and realloc.
* parted/table.c: Use gnulib's xmalloc and realloc.
Remove anachronistic casts of malloc/realloc return value.
Change "sizeof(type)" to safer "sizeof(*var)" (one of the former
was wrong, but in a harmless way).

17 years agoFix off-by-one error in previous change.
Jim Meyering [Fri, 25 May 2007 17:13:28 +0000 (19:13 +0200)]
Fix off-by-one error in previous change.
* parted/strlist.c (str_list_print_wrap): Don't output a space unconditionally.

17 years agoRemove a silly (and dangerous) function.
Jim Meyering [Fri, 25 May 2007 16:45:39 +0000 (18:45 +0200)]
Remove a silly (and dangerous) function.

This change has no effect, except in a low-memory condition,
where the old code would dereference NULL, the new code no
longer performs that malloc.

* parted/strlist.c (get_spaces): Remove this function.
Not only is it useless, but it also has an unchecked malloc.
(str_list_print_wrap): Don't allocate and initialize a string
just to print a sequence of N spaces.

17 years agodoc/parted.texi (Static binaries): Correct an invalid example.
Jim Meyering [Fri, 25 May 2007 11:58:15 +0000 (13:58 +0200)]
doc/parted.texi (Static binaries): Correct an invalid example.
One cannot specify "primary" for a partition on a loop device.

17 years agoDiagnose "ext2 FS too small" rather than triggering an assertion.
Jim Meyering [Thu, 24 May 2007 18:00:22 +0000 (20:00 +0200)]
Diagnose "ext2 FS too small" rather than triggering an assertion.
* libparted/fs/ext2/ext2_mkfs.c (ext2_mkfs): An overlapping ext2
partition request could still lead to a bug: constraint-resolution
code would produce a single-sector candidate "range", and that
would cause the ext2 fs-creation code to misbehave.  Now, it
properly detects and reports the FS as being too small.
* tests/t3000-constraints.sh: New test for the above.
* tests/Makefile.am (TESTS): Add t3000-constraints.sh.

17 years agoFix typo in privs-required test setup.
Jim Meyering [Thu, 24 May 2007 16:21:43 +0000 (18:21 +0200)]
Fix typo in privs-required test setup.
* tests/test-lib.sh: Fix typo: s/\$parted/$parted_/.

17 years agoDon't fail all tests when "." lacks O_DIRECT support.
Jim Meyering [Wed, 23 May 2007 20:28:53 +0000 (22:28 +0200)]
Don't fail all tests when "." lacks O_DIRECT support.

I often build tools on a tmpfs file system (it's faster), and
found that parted tests always failed there.  That's because it tries
to open the "device" (a file) with O_DIRECT, and at least the linux tmpfs
driver always fails with EINVAL in that case.

So here's a patch that makes it work.
Since the test may require writing in a directory like /tmp,
to which others typically have write access, it is particularly
careful about security (see the mkdtemp script below), in case
"make check" is run by e.g., root.

Don't fail all tests when "." lacks O_DIRECT support.
Before, running "make check" on a file system that doesn't support
O_DIRECT (e.g. tmpfs), would always fail.  Now, it works, as long as
the test machinery can find a writable directory in which open with
O_DIRECT *does* work.
* m4/o-direct.m4: New file.  Find a directory/FS with O_DIRECT support.
* configure.ac: Use the new macro.
* libparted/tests/t1000-label.sh: New file.  Wrap the binary, so
it can take advantage of the code that finds O_DIRECT supporting FS.
* tests/mkdtemp: New file.  Required, since when running tests as
root, we may have to create a temporary directory in a directory
like /tmp that's writable by others.
* tests/Makefile.am (EXTRA_DIST): Add mkdtemp.
* tests/test-lib.sh: When creating test subdir, and setting up "trap",
use the directory specified in $PARTED_USABLE_TEST_DIR.
Don't set PATH here.  Now, that's done via the generated, and always-
sourced, init.sh.  As a result, invoke parted via its full file name.

17 years agoMake all tests get their initialization from the same place.
Jim Meyering [Sat, 19 May 2007 09:10:20 +0000 (11:10 +0200)]
Make all tests get their initialization from the same place.
* tests/t2000-mkfs.sh: Get initialization via ". ./init.sh",
not via ". ./test-lib.sh".
* Makefile.maint (sc_test_init): New test, to ensure we stay consistent.

17 years ago* tests/Makefile.am (init.sh): Make this generated file read-only.
Jim Meyering [Sat, 19 May 2007 06:49:40 +0000 (08:49 +0200)]
* tests/Makefile.am (init.sh): Make this generated file read-only.

17 years agomkpartfs ext2 2 10 would erroneously report "file system too small"
Jim Meyering [Fri, 18 May 2007 13:52:00 +0000 (15:52 +0200)]
mkpartfs ext2 2 10 would erroneously report "file system too small"
for some small (single-group) partitions.  It would also fail to
report "file system too small" in some cases, and instead continue
on to into inode-allocation code where it'd report "File system full!"
* libparted/fs/ext2/ext2_mkfs.c (compute_block_counts): New function,
factored out of...
(ext2_mkfs): ...here.  Call compute_block_counts rather than
open-coded it.  When decrementing numblocks, call compute_block_counts
again, to recompute all of the derived values.
Require at least 14 free blocks in a 16-inode-per-group partition.
* tests/t1500-small-ext2.sh: New file.  Test for the above.
* tests/Makefile.am (TESTS): Add t1500-small-ext2.sh.

17 years agoAvoid spurious test failures due to buggy ncurses-5.6.
Jim Meyering [Thu, 17 May 2007 11:21:00 +0000 (13:21 +0200)]
Avoid spurious test failures due to buggy ncurses-5.6.
* tests/test-lib.sh: Also unset TERM.

17 years agopartprobe: new option: --dry-run, synonym for now-deprecated --no-update; improve...
Benno Schulenberg [Wed, 16 May 2007 20:28:35 +0000 (22:28 +0200)]
partprobe: new option: --dry-run, synonym for now-deprecated --no-update; improve its description

17 years agoTest commit
Anant Narayanan [Wed, 16 May 2007 02:56:37 +0000 (08:26 +0530)]
Test commit

17 years agoRemoved clean.sh script. Using git now, we don't need it anymore (git clean -d -x).
David Cantrell [Wed, 9 May 2007 20:45:38 +0000 (16:45 -0400)]
Removed clean.sh script. Using git now, we don't need it anymore (git clean -d -x).

17 years agoUse gnulib xmalloc() and xrealloc().
David Cantrell [Wed, 9 May 2007 19:15:47 +0000 (15:15 -0400)]
Use gnulib xmalloc() and xrealloc().

17 years agoFix exception handling in mkpart and mkpartfs
Flavio Leitner [Mon, 14 May 2007 10:04:18 +0000 (12:04 +0200)]
Fix exception handling in mkpart and mkpartfs

Parted mkpart and mkpartfs commands does:
...
   ped_exception_fetch_all();
   if (!ped_disk_add_partition (disk, part, final_constraint)) {
 ped_exception_leave_all();
...
   }
...
In mkpart if the ped_disk_add_partition() returns true it skips
ped_exception_leave_all() leaving ex_fetch_count = 1.

In mkpartfs if the ped_disk_add_partition() returns false it will
call ped_exception_leave_all() leaving ex_fetch_count negative.

The wrong count in ex_fetch_count will prevent next commands to
correctly handle exceptions, failing to prompt users for example.

Note: test script t2000-mkfs.sh improved to verify against this issue.

Signed-off-by: Flavio Leitner <flavio.leitner@gmail.com>
Signed-off-by: Jim Meyering <jim@meyering.net>
17 years ago* tests/t1100-busy-label.sh: Quote uses of $dev, in case
Jim Meyering [Fri, 11 May 2007 17:15:05 +0000 (19:15 +0200)]
* tests/t1100-busy-label.sh: Quote uses of $dev, in case
the user's device name contains a shell meta-character.

SCALAR(0x7f6040)

17 years agoWhen labeling a disk in --script mode, fail if it is in use.
Jim Meyering [Fri, 11 May 2007 15:27:47 +0000 (17:27 +0200)]
When labeling a disk in --script mode, fail if it is in use.
* parted/parted.c (_disk_warn_busy): In script mode,
throw a "PED_EXCEPTION_ERROR", not a warning.
(do_mklabel): Guard only the _disk_warn_loss call with
"if (!opt_script_mode...", not the _disk_warn_loss call.
* tests/t1100-busy-label.sh: New file.  Test the above,
in interactive mode as well as in script mode.  Requires
root privilege (to mount a fs), and an actual block device.
* tests/Makefile.am (TESTS): Add t1100-busy-label.sh.
* tests/test-lib.sh: Add infrastructure to support new
privileges_required_=1 and erasable_device_required_=1
settings used by t1100.

17 years agoNo longer require "srcdir=." when running a test manually.
Jim Meyering [Fri, 11 May 2007 15:20:09 +0000 (17:20 +0200)]
No longer require "srcdir=." when running a test manually.
* tests/Makefile.am (init.sh): New rule, so one doesn't have to
set "srcdir=." when running a test manually.
* .gitignore: Ignore new generated file: tests/init.sh.
* tests/t0000-basic.sh: Source new init.sh, rather than test-lib.sh.
* tests/t1000-mkpartfs.sh: Likewise.
* tests/t2000-mkfs.sh: Likewise.
* tests/test-lib.sh: Remove useless srcdir-setting code.

17 years ago[parted] Fix script mode support on mkfs commandline command
Otavio Salvador [Wed, 9 May 2007 19:03:39 +0000 (16:03 -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@ossystems.com.br>
17 years agoPreventing compilation of DASD code on GNU Hurd systems through the use of AC_COMPILE...
Debarshi Ray [Tue, 8 May 2007 17:35:23 +0000 (23:05 +0530)]
Preventing compilation of DASD code on GNU Hurd systems through the use of AC_COMPILE_IFELSE and AM_CONDITIONAL, instead of #ifdef.

17 years agoRewrite integration tests to use a new framework (git's).
Jim Meyering [Mon, 7 May 2007 16:42:38 +0000 (18:42 +0200)]
Rewrite integration tests to use a new framework (git's).
* tests/t1000-mkpartfs.sh: New file.
* tests/t0000-basic.sh: New file.
* tests/test-lib.sh: New file.  Derived from git's t/test-lib.sh.
* tests/lang-default, tests/priv-check: Remove files.
* tests/Makefile.am (EXTRA_DIST): Add test-lib.sh.
Remove lang-default and priv-check; no longer used.
* tests/part-01, tests/label-01: Remove files.
* tests/part-02, tests/label-02: Likewise.

17 years agoMerge branch 'inhibit-word-wrap'
Jim Meyering [Mon, 7 May 2007 15:09:37 +0000 (17:09 +0200)]
Merge branch 'inhibit-word-wrap'

17 years agoMerge branch 'include-limits-h-for-CHAR_MAX'
Jim Meyering [Mon, 7 May 2007 15:05:31 +0000 (17:05 +0200)]
Merge branch 'include-limits-h-for-CHAR_MAX'

17 years agoMake ---pretend-input-tty inhibit output word-wrap.
Jim Meyering [Mon, 7 May 2007 14:51:29 +0000 (16:51 +0200)]
Make ---pretend-input-tty inhibit output word-wrap.
* parted/ui.c (screen_width): Use effectively-unlimited screen width
with ---pretend-input-tty, just as for '--script' mode.

17 years agoSuppress "you are not superuser..." warning in script mode.
Jim Meyering [Mon, 7 May 2007 14:45:27 +0000 (16:45 +0200)]
Suppress "you are not superuser..." warning in script mode.
* parted/parted.c (_init): Do not emit this warning in script mode:
"You are not superuser.  Watch out for permissions."

17 years agoAvoid "make distcheck" failure, with newer system headers.
Jim Meyering [Mon, 7 May 2007 14:38:00 +0000 (16:38 +0200)]
Avoid "make distcheck" failure, with newer system headers.
* parted/parted.c: Include <limits.h>, for use of CHAR_MAX.

17 years agoUpdated Doxyfile
Anant Narayanan [Thu, 3 May 2007 23:39:52 +0000 (05:09 +0530)]
Updated Doxyfile

17 years agoOn the edge branch, labeled the version as 1.9.0 so we can mark it more correctly...
David Cantrell [Wed, 2 May 2007 18:22:28 +0000 (14:22 -0400)]
On the edge branch, labeled the version as 1.9.0 so we can mark it more correctly as the development tree.

17 years agoWhitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:44:24 +0000 (09:44 -0400)]
Whitespace cleanups.

17 years agoWhitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:42:33 +0000 (09:42 -0400)]
Whitespace cleanups.

17 years agoWhitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:22:44 +0000 (09:22 -0400)]
Whitespace cleanups.

17 years agoWhitespace cleanups.
David Cantrell [Mon, 30 Apr 2007 13:21:48 +0000 (09:21 -0400)]
Whitespace cleanups.

17 years agoRevert "Remove unused label."
David Cantrell [Mon, 23 Apr 2007 20:41:02 +0000 (16:41 -0400)]
Revert "Remove unused label."

This reverts commit bfd9a6d8b6322d870650b0e92bd936035ab28e76.

17 years agoPatch from Jim Meyering <jim@meyering.net> to linux_write() to support logical
David Cantrell [Mon, 23 Apr 2007 20:25:11 +0000 (16:25 -0400)]
Patch from Jim Meyering <jim@meyering.net> to linux_write() to support logical

sector sizes other than 512 (PED_SECTOR_SIZE_DEFAULT).

17 years agoFix primary partition cylinder alignment error for DOS disk labels.
David Cantrell [Mon, 23 Apr 2007 20:02:13 +0000 (16:02 -0400)]
Fix primary partition cylinder alignment error for DOS disk labels.

17 years agoFix off-by-one bug in parted when displaying information about the disk label (the...
David Cantrell [Mon, 23 Apr 2007 20:00:54 +0000 (16:00 -0400)]
Fix off-by-one bug in parted when displaying information about the disk label (the disk size, specifically).

17 years agoDo not translate partition names in 'parted print' command. This causes problems...
David Cantrell [Mon, 23 Apr 2007 19:58:03 +0000 (15:58 -0400)]
Do not translate partition names in 'parted print' command. This causes problems for non-Latin-based character sets. Also, we don't want to translate the partition name here as we are just showing what is in the disklabel, translating it distorts what the value is.

Also added some malloc checks in table.c.

17 years agoRemove unused label.
David Cantrell [Mon, 23 Apr 2007 19:53:48 +0000 (15:53 -0400)]
Remove unused label.

17 years agoReverted my patch to configure.ac to remove -Wl,--as-needed from LDFLAGS when checkin...
David Cantrell [Thu, 15 Mar 2007 16:53:35 +0000 (12:53 -0400)]
Reverted my patch to configure.ac to remove -Wl,--as-needed from LDFLAGS when checking for libreadline.

17 years agolibreadline is a problematic library. Autoconf adds a block to the generated configur...
David Cantrell [Wed, 14 Mar 2007 18:55:49 +0000 (14:55 -0400)]
libreadline is a problematic library. Autoconf adds a block to the generated configure script that checks to see if we should be passing the --as-needed flag to ld(1). There are portability reasons this code exists (best I can figure), but it presents a problem when we scan for libreadline.

libreadline specifically has unresolved symbols on at least Fedora and RHEL.  Why?  Well, the developer can choose to provide libtermcap, libncurses, or libncursesw (wide-char support) at compile time which all satisfy the curses API dependency that libreadline has.  When the parted configure script runs, it fails on readline because the --as-needed flag causes the linker to not include libncurses even though we already have that on the link line.

My solution is to remove the --as-needed flag when we scan for libreadline and then later check for rl_completion_matches() in libreadline.

17 years agoMore changes to set the version number to 1.8.3.
David Cantrell [Tue, 13 Mar 2007 19:05:53 +0000 (15:05 -0400)]
More changes to set the version number to 1.8.3.

17 years agoSet version to 1.8.3 for upcoming release.
David Cantrell [Tue, 13 Mar 2007 17:03:02 +0000 (13:03 -0400)]
Set version to 1.8.3 for upcoming release.

17 years ago[tests] Separate and improved test for reading of disk labels.
Debarshi Ray [Tue, 1 May 2007 04:31:50 +0000 (10:01 +0530)]
[tests] Separate and improved test for reading of disk labels.

17 years agoFix endianness bugs
Matthew Harris [Tue, 24 Apr 2007 15:13:41 +0000 (08:13 -0700)]
Fix endianness bugs

17 years agoAdd integration tests, then adjust code so that they pass.
Jim Meyering [Thu, 26 Apr 2007 21:17:32 +0000 (23:17 +0200)]
Add integration tests, then adjust code so that they pass.
These changes affect how --script (-s) works, and when diagnostics
are displayed.
* Makefile.am (SUBDIRS): Add tests.
* configure.ac (AC_OUTPUT): Add tests/Makefile.
* tests/Makefile.am: New file.
* tests/part-01, tests/label-01: New files.
* tests/part-02, tests/label-02: New files.
* parted/parted.c (enum) [PRETEND_INPUT_TTY]: Define.
Support a new, undocumented option: ---pretend-input-tty.
It is intended solely for testing.  The leading '---' ensures
that it will never conflict with a "regular" long option.
(do_mkpartfs): Prompt only when not in script mode.
Call ped_exception_leave_all() to decrement global counter.
Without this, the use of parted in tests/part-01 would still fail,
but would not issue the diagnostic explaining why.
* parted/ui.h (pretend_input_tty): Declare new global.
* parted/ui.c (exception_handler): Let the new "pretend_input_tty"
option override "!isatty (0)".
(init_ui): Don't set opt_script_mode.
* tests/lang-default, tests/priv-check: New files.

17 years agoTemporarily disable the clone-dvh-label test.
Jim Meyering [Thu, 26 Apr 2007 19:54:51 +0000 (21:54 +0200)]
Temporarily disable the clone-dvh-label test.
* libparted/tests/label.c (test_clone_label):

17 years ago[PATCH] Avoid warning from -Wformat-security; tweak error diagnostic.
Jim Meyering [Sat, 21 Apr 2007 16:59:43 +0000 (18:59 +0200)]
[PATCH] Avoid warning from -Wformat-security; tweak error diagnostic.

* parted/parted.c (_parse_options): Upon failure, output diagnostic
to stderr, not stdout.  Use "program_name" value, not literal "parted".

Signed-off-by: Jim Meyering <jim@meyering.net>
17 years ago[tests] New test for probing of disk labels.
Debarshi Ray [Fri, 20 Apr 2007 19:29:15 +0000 (00:59 +0530)]
[tests] New test for probing of disk labels.

17 years agoRevert "[libparted] dvh label fixes"
Otavio Salvador [Fri, 20 Apr 2007 15:03:45 +0000 (12:03 -0300)]
Revert "[libparted] dvh label fixes"

This reverts commit dcf8e966abf997b9df69b1664c470ed2aa5c166b.

17 years ago[libparted] dvh label fixes
Otavio Salvador [Fri, 20 Apr 2007 15:01:37 +0000 (12:01 -0300)]
[libparted] dvh label fixes

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] Simplify test_clone_label removing the label reading test
Otavio Salvador [Fri, 20 Apr 2007 06:53:18 +0000 (03:53 -0300)]
[tests] Simplify test_clone_label removing the label reading test

Since the test_create_label already tests the label reading we
shouldn't redo it. It's always better to have simple tests so is much
easier to find the bugs.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] Trivial coding style fixes around the tests code
Otavio Salvador [Fri, 20 Apr 2007 03:37:07 +0000 (00:37 -0300)]
[tests] Trivial coding style fixes around the tests code

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] Add _test_exception_handler to fail every time an exception is raised
Otavio Salvador [Fri, 20 Apr 2007 00:30:53 +0000 (21:30 -0300)]
[tests] Add _test_exception_handler to fail every time an exception is raised

Sometimes parts of code raises exceptions and this shouldn't happen on
tests. To ensure we catch them a specific exception handler has been
implemented.

The handler usage is very easy. You just need to put the following
code at testsuite main method:

...
        /* Fail when an exception is raised */
        ped_exception_set_handler (_test_exception_handler);
...

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] New test for cloning of disk labels.
Debarshi Ray [Fri, 20 Apr 2007 00:19:44 +0000 (05:49 +0530)]
[tests] New test for cloning of disk labels.

17 years ago[tests] Fix spacing around brackets and asterisks.
Debarshi Ray [Thu, 19 Apr 2007 19:30:50 +0000 (01:00 +0530)]
[tests] Fix spacing around brackets and asterisks.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years agoHandle options independent of their order.
Benno Schulenberg [Mon, 9 Apr 2007 21:34:15 +0000 (23:34 +0200)]
Handle options independent of their order.

Abort on any invalid option, and handle -v and -h first.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] Small refactoring on test_create_label
Otavio Salvador [Wed, 18 Apr 2007 22:37:11 +0000 (19:37 -0300)]
[tests] Small refactoring on test_create_label

 - Destroy the temporary device once the test has been finished,
 - Use the _implemented_disk_label and _create_disk_label methods
   to avoid code duplication.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] Implements _implemented_disk_label and _create_disk_label on common.[hc]
Otavio Salvador [Wed, 18 Apr 2007 22:35:57 +0000 (19:35 -0300)]
[tests] Implements _implemented_disk_label and _create_disk_label on common.[hc]

 - _implemented_disk_label: returns 0 when we haven't yet implemented
   this specific label and 1 otherwise;

 - _create_disk_label: creates a disk label of a specific type on a
   specific device;

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years ago[tests] Ensure that we're able to read the just created disk label
Otavio Salvador [Wed, 18 Apr 2007 20:05:05 +0000 (17:05 -0300)]
[tests] Ensure that we're able to read the just created disk label

To ensure we're able to read the just created disk label we introduced a call
ped_disk_new using the same loopback. This could detect bad label creating or
probing detectiong mistakes.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
17 years agoIndentation fixes in libparted/tests/.
Debarshi Ray [Tue, 17 Apr 2007 15:38:14 +0000 (21:08 +0530)]
Indentation fixes in libparted/tests/.

17 years agoShow the update /etc/fstab message only when there has been a change to the disk...
Debarshi Ray [Mon, 16 Apr 2007 18:34:54 +0000 (00:04 +0530)]
Show the update /etc/fstab message only when there has been a change to the disk. The message is now shorter and more direct.

17 years agochange the variable named start to offset to be consistent with the doc
solsTiCe d'Hiver [Thu, 5 Apr 2007 22:01:46 +0000 (00:01 +0200)]
change the variable named start to offset to be consistent with the doc

17 years agoremove any trace of PED_PARTITION_PRIMARY which was deprecated a long time ago to...
solsTiCe d'Hiver [Thu, 5 Apr 2007 12:39:45 +0000 (14:39 +0200)]
remove any trace of PED_PARTITION_PRIMARY which was deprecated a long time ago to use PED_PARTITION_NORMAL

17 years agoAdded 'rescue', 'unit', and 'version' to the man page, plus some small edits.
Benno Schulenberg [Thu, 29 Mar 2007 17:28:25 +0000 (19:28 +0200)]
Added 'rescue', 'unit', and 'version' to the man page, plus some small edits.

17 years agoAvoid segfault due a double free on reiserfs support (patch sent by Jakub Bogusz...
Otavio Salvador [Wed, 4 Apr 2007 12:04:30 +0000 (09:04 -0300)]
Avoid segfault due a double free on reiserfs support (patch sent by Jakub Bogusz <qboosh@pld-linux.org>)

17 years agoMake the wording of warning somewhat clearer.
Benno Schulenberg [Wed, 4 Apr 2007 10:03:29 +0000 (12:03 +0200)]
Make the wording of warning somewhat clearer.

17 years agoTweak some help messages: change third person to imperative for consistency, add...
Benno Schulenberg [Mon, 26 Mar 2007 22:23:18 +0000 (00:23 +0200)]
Tweak some help messages: change third person to imperative for consistency, add single quotes and remove letters for clarity

17 years agoConditionalize the System Z stuff correctly. We get headers installed on non-System...
David Cantrell [Mon, 19 Mar 2007 18:01:46 +0000 (14:01 -0400)]
Conditionalize the System Z stuff correctly.  We get headers installed on non-System Z platforms, but the code only compiles on that platform.

17 years agoRemove the COMPILE_FOR_S390 flag-setting stuff. It wasn't correct anyway. Take...
David Cantrell [Mon, 19 Mar 2007 15:20:55 +0000 (11:20 -0400)]
Remove the COMPILE_FOR_S390 flag-setting stuff.  It wasn't correct anyway.  Take a kernel-style approach and check uname -m to see if we are on s390.  If so, we build for zSeries.  Otherwise we do not.

17 years agoSleep for one second after uploading a file to ftp-upload.gnu.org. Seems transaction...
David Cantrell [Mon, 19 Mar 2007 14:43:56 +0000 (10:43 -0400)]
Sleep for one second after uploading a file to ftp-upload.gnu.org.  Seems transactions need to be spaced out a bit otherwise the server will reject files.

17 years agoFix for compile problems with gcc-4.1.2 as indicated here:
David Cantrell [Mon, 19 Mar 2007 15:09:25 +0000 (11:09 -0400)]
Fix for compile problems with gcc-4.1.2 as indicated here:
http://lists.gnu.org/archive/html/bug-parted/2007-03/msg00008.html

17 years agoCheck for tgetent() in libtinfo as well as ncurses, curses, termcap, and termlib.
David Cantrell [Mon, 19 Mar 2007 15:10:38 +0000 (11:10 -0400)]
Check for tgetent() in libtinfo as well as ncurses, curses, termcap, and termlib.

17 years agoRemove some unused variables, check the return values from fgets() and asprintf(...
David Cantrell [Mon, 19 Mar 2007 15:12:11 +0000 (11:12 -0400)]
Remove some unused variables, check the return values from fgets() and asprintf(), and remove the unused _dm_remove_map() function.

17 years agoInclude vtoc.h for the format1_label_t typedef.
David Cantrell [Mon, 19 Mar 2007 15:19:27 +0000 (11:19 -0400)]
Include vtoc.h for the format1_label_t typedef.

17 years agoRemove GNU make-specific things from po4a.mk.
David Cantrell [Mon, 19 Mar 2007 18:20:52 +0000 (14:20 -0400)]
Remove GNU make-specific things from po4a.mk.

17 years agoInstall the libparted.pc file, not the libparted.pc.in file.
David Cantrell [Fri, 16 Mar 2007 19:18:08 +0000 (15:18 -0400)]
Install the libparted.pc file, not the libparted.pc.in file.

17 years agoMore spec file template cleanups.
David Cantrell [Fri, 16 Mar 2007 19:19:57 +0000 (15:19 -0400)]
More spec file template cleanups.

17 years agoUpdated the release script to work with the new source layout.
David Cantrell [Fri, 16 Mar 2007 20:09:08 +0000 (16:09 -0400)]
Updated the release script to work with the new source layout.

17 years agoFixed faulty information in README-hacking (Bison is not a maintainer tool for Parted...
Debarshi Ray [Fri, 16 Mar 2007 14:20:32 +0000 (19:50 +0530)]
Fixed faulty information in README-hacking (Bison is not a maintainer tool for Parted), and Makefile.maint (every project has certain variations of it).

17 years agopo/POTFILES.in: Add lib/getopt.c
Jim Meyering [Fri, 16 Mar 2007 09:59:19 +0000 (10:59 +0100)]
po/POTFILES.in: Add lib/getopt.c

17 years agoPrevented DASD specific headers and sources from being compiled/installed on non...
Debarshi Ray [Fri, 16 Mar 2007 06:42:34 +0000 (12:12 +0530)]
Prevented DASD specific headers and sources from being compiled/installed on non-s390 systems; and conditionally included fdasd.h in linux.h for s390 systems.

17 years agoMove static variable flagging little endian or not to journal.c. We don't want stati...
David Cantrell [Thu, 15 Mar 2007 17:03:24 +0000 (13:03 -0400)]
Move static variable flagging little endian or not to journal.c.  We don't want static variables in general, but if they must exist, put them in a C file, not a header.

Parameterize the little_endian flag for the macros in journal.h.

17 years agoModernize the spec file template.
David Cantrell [Tue, 13 Mar 2007 21:34:05 +0000 (17:34 -0400)]
Modernize the spec file template.

17 years agoIgnore more files.
David Cantrell [Tue, 13 Mar 2007 21:33:44 +0000 (17:33 -0400)]
Ignore more files.

17 years agoPatch from Matthew Garrett <mjg59@srcf.ucam.org> to add HFS+ resize support.
David Cantrell [Tue, 13 Mar 2007 17:37:45 +0000 (13:37 -0400)]
Patch from Matthew Garrett <mjg59@srcf.ucam.org> to add HFS+ resize support.

17 years agohfs.c: Detect write failure.
Jim Meyering [Mon, 12 Mar 2007 13:58:40 +0000 (14:58 +0100)]
hfs.c: Detect write failure.
* libparted/fs/hfs/hfs.c (hfs_extract_file, hfs_extract_bitmap):
(hfs_extract_mdb, hfsplus_extract_file, hfsplus_extract_vh):
Fail when fclose fails for a written-to file handle.

17 years ago aix.c: Avoid memory overrun. Don't assume logical sector size <= 512B
Jim Meyering [Thu, 8 Mar 2007 22:40:03 +0000 (23:40 +0100)]
aix.c: Avoid memory overrun.  Don't assume logical sector size <= 512B
* libparted/labels/aix.c (struct AixLabel): Remove definition.
(aix_label_magic_get, aix_label_magic_set): New functions.
(read_sector): New function.
(aix_probe): Rewrite not to use the above, and not a static buffer.
(aix_clobber): Likewise.
Also, rather than PED_ASSERT'ing that aix_probe returns 1,
simply return 0 if aix_probe returns fails.
(ped_disk_aix_init): Remove assertion, now that AixLabel is gone.

17 years ago Use PED_SECTOR_SIZE_DEFAULT not 512
Jim Meyering [Thu, 8 Mar 2007 22:11:53 +0000 (23:11 +0100)]
Use PED_SECTOR_SIZE_DEFAULT not 512
* libparted/arch/beos.c (beos_read, beos_write):
* libparted/arch/linux.c (_device_get_length, _device_seek)
(linux_read, linux_write, _blkpg_add_partition):
* libparted/fs/fat/bootsector.c (fat_boot_sector_read):
* libparted/labels/bsd.c (bsd_alloc):
* libparted/labels/dos.c (probe_filesystem_for_geom):
* libparted/labels/rdb.c (amiga_read):

17 years ago* parted/ui.c (non_interactive_mode): Plug a tiny leak.
Jim Meyering [Thu, 8 Mar 2007 21:39:33 +0000 (22:39 +0100)]
* parted/ui.c (non_interactive_mode): Plug a tiny leak.
Exercise by running the following with a CD-ROM in the drive:
valgrind --leak-check=full parted/parted /dev/cdrom print
Before, we'd leak the 6-byte command: "print\0".