Commit Graph

99 Commits

Author SHA1 Message Date
Benno Schulenberg 62eea9ce12 textual: adjust grammar and punctuation of some messages
Also equalize three messages to one other one,
and fix a typo in USE_COLORS_BY_DEFAULT.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-08-03 11:18:56 +02:00
Karel Zak 1b2e9dd01d cfdisk: don't print obsolete CHS addresses
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 15:49:14 +02:00
Karel Zak ed99eac0e2 cfdisk: make sure that output fits to terminal width
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 15:29:37 +02:00
Karel Zak 6e07b904e7 cfdisk: remove extra line between menu and info line
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-27 12:37:15 +02:00
Benno Schulenberg d48fc38307 cfdisk: spell "label" in lower case
To be less shouty.  It is not an abbreviation like "UUID".

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-07-27 11:57:11 +02:00
Benno Schulenberg 80351b1f4a cfdisk: allow an uppercase X to toggle the extra info
To make true the help text line that says that all commands
can be entered with either upper or lower case.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-07-27 11:57:08 +02:00
Karel Zak cbcafba2bb cfdisk: make sure that extra info is refreshed/removed
For example when you move from a Partition to the FreeSapce then we
need to remove old extra info and draw nothing.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-22 14:28:33 +02:00
Karel Zak a2d0dbb433 cfdisk: properly toggle extra info window, make it more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-22 14:11:27 +02:00
Boris Egorov 13c551f259 cfdisk: fix condition logic [cppcheck]
[disk-utils/cfdisk.c:1181] -> [disk-utils/cfdisk.c:1181]: (warning)
Possible null pointer dereference: data - otherwise it is redundant to
check it against null.

Signed-off-by: Boris Egorov <egorov@linux.com>
2015-06-25 12:08:53 +02:00
Karel Zak 3542fc516a cfdisk: cleanup extra partitions info for slang
The patch removes problem with getch() on slang, now the code is based
on subwin() and extra info window is persistent.

A new problem is that slang does not keep sub-window border
persistent. I'm going to ignore this slang problem... use ncurses
dude!

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-31 13:10:17 +02:00
Ondrej Oprala dda7fe12ac cfdisk: provide extra partinfo with "x"
The new 'extra' info provides:

 * filesystem information from libblkid (TYPE, UUID, LABEL)

   This feature is based on libblkid ability to probe specified area
   on the device. It allows to probe for filesystems although the
   partition devices (e.g. /dev/sda2) does not exist. For example from
   disk image:

   	# cfdisk /home/archive/fs-images/disk.img

 * additional information from libfdisk (partition UUID, Name, ...)

 * mount information from libmount (from fstab or mountinfo)

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Karel Zak <kzak@redhat.com>
2015-03-27 14:04:44 +01:00
Karel Zak 5d51dc2a7f colors: cleanup man pages, add hint to usage()
cfdisk, fdisk, calm dmesg and hexdump

Signed-off-by: Karel Zak <kzak@redhat.com>

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-25 12:40:06 +01:00
Karel Zak 941409c066 cfdisk: improve create-label UI
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-10 12:50:33 +01:00
Benno Schulenberg f16c37f4a5 cfdisk: also recognize a lowercase 'l' for loading a script file
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-10 12:23:15 +01:00
Benno Schulenberg 5088d642dd cfdisk: do not startle the user with a false message when --zero is used
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-10 12:23:15 +01:00
Karel Zak 29e9b787da cfdisk: improve ui_get_size() warnings
- don't reset to default after error
 - clean previous warnings after users response
 - remove unnecessary warning

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 13:06:20 +01:00
Karel Zak 1bb387bdbd libfdisk: fix issues with very small partitions
- cfdisk: minimal partitions size is 1 sector
 - dos: when align last sector then don't set partition size to zero
   for very small partitions.
 - don't ignore tiny partitions before free space when define
   free-space start offset
 - improve some debug messages

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 12:44:00 +01:00
Karel Zak f9fb8290d8 cfdisk: print "wrong order" warning after startup, colorize info messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 11:04:37 +01:00
Karel Zak b5ef65a931 cfdisk: force main menu to default to Quit/New menu items
Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-03 10:37:33 +01:00
Karel Zak 635a81513a cfdisk: disable some KEY_* in ui_get_wqstring()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-02 13:05:48 +01:00
Karel Zak 316bce9dd4 cfdisk: default to Quit menu item
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-02-02 12:47:50 +01:00
Benno Schulenberg 2a0ffa311c cfdisk: make '?' an alias of 'h', to also show the help screen
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg d4640320df cfdisk: punctuate the bottombar messages consistently
Also adjust the style of two comments and add another.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg 143d9e3e52 cfdisk: improve wording and consistency of the size warnings
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Benno Schulenberg a4fbbbd491 cfdisk: remove the mistaken B from the explanation of size suffixes
Also reword the explanation to be clearer.  It is not necessary to
be complete -- that is what the man page is for.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 10:57:07 +01:00
Karel Zak ec8a728ae0 cfdisk: fix mem leak and main_menu_action() logic [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-28 14:30:20 +01:00
Benno Schulenberg b6e3c61464 cfdisk: actually translate the table headers and the bottom line
The printout of the table headers and the bottomline descriptions
were lacking calls to gettext().

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:53:51 +01:00
Benno Schulenberg e993b9c8e5 cfdisk: shorten the help screen to make it fit within 25 lines
When the terminal has less than 32 lines, the new cfdisk ignored the
fact that the help-screen text was longer and just skipped printing
the remaining lines.  Instead of introducing a minipager for the help
screen, just condense its text and remove unneeded lines.  Now the
text occupies just 25 lines, which should fit on most terminals.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:53:49 +01:00
Benno Schulenberg fd4484a712 cfdisk: don't mess up the help screen by printing the PO file header
Asking for the translation of the empty string ("") produces the header
of the PO file corresponding to the current locale, which messes up the
help screen.  So, don't use empty strings in the array of help strings
but (arbitrary) double spaces.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:53:48 +01:00
Benno Schulenberg 54fefa078e textual: fix spellos and inconsistencies in several program messages
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:17:55 +01:00
Sami Kerola 7ee26cbf02 maint: fix shadow declaration
This change fixes all shadow declarations.  The worth while to mention
fix is with libfdisk sun geometry.  It comes from bitops.h cpu_to_be16
macro that further expands from include/bits/byteswap.h that has the
shadowing.

libfdisk/src/sun.c:961:173: warning: declaration of '__v' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:69: warning: shadowed declaration is here [-Wshadow]
libfdisk/src/sun.c:961:178: warning: declaration of '__x' shadows a previous local [-Wshadow]
libfdisk/src/sun.c:961:74: warning: shadowed declaration is here [-Wshadow]

That could have caused earlier some unexpected results.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-01-07 10:08:21 +01:00
Benno Schulenberg 451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Karel Zak 8c9615a99b cfdisk: improve Dump dialog
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-05 12:53:50 +01:00
Karel Zak 702d0e1cef cfdisk: improve menu clean function
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-05 12:42:24 +01:00
Karel Zak 7509020126 cfdisk: detect too small partition sizes
References: https://github.com/karelzak/util-linux/issues/136
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-05 12:13:25 +01:00
Karel Zak a1ef792fda libfdisk: rename and move function
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 17:33:07 +01:00
Karel Zak 5c04b40850 cfdisk: cleanup menuitem draw functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-13 12:52:03 +01:00
Karel Zak 5cb9918d59 cfdisk: remove [Load] from menu
This functionality will be rarely used, so it does not make sense to
waste screen space with this menu item. It's enough to provide this
functionality in "Select label type" dialog (cfdisk --zero and then
'L' command).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-13 11:19:58 +01:00
Karel Zak a89eafed85 cfdisk: add support for sfdisk scripts
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-12 16:12:39 +01:00
Karel Zak 819d9a2975 include/debug: fix typo
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-24 11:19:23 +02:00
Karel Zak ecf40cda76 libfdisk: make it possible to use zero for size and start
The zero may be valid size and start of the partition. This patch
introduces:

	fdisk_partition_has_start()
	fdisk_partition_has_size()
	fdisk_partition_unset_size()
	fdisk_partition_unset_start()

to make it possible to work with zero. The feature is internally
implemented by magic constant ((type) -1) for undefined sizes and
offsets.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-15 12:17:40 +02:00
Karel Zak 05af8bd4f0 sfdisk: ask on EOF
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-09 12:23:59 +02:00
Karel Zak 9b0b9fb1bf libfdisk: follow explicitly specified partition size
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-09 12:09:07 +02:00
Karel Zak c3bc748352 libfdisk: return partno when add new partition
* improve the way how sfdisk report results
 * the API change simplify applications

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-07 14:55:31 +02:00
Sami Kerola f627750083 textual: use version printing macro everywhere
Only mount, umount, and blkid remains not using the macro because they
are print also library references.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-10-01 12:33:23 +02:00
Karel Zak eef6397023 cfdisk: don't modify ncurses LINES and COLS
On Sun, Sep 28, 2014 at 01:48:38AM -0700, pv4 wrote:
 If ncurses is build with --enable-reentrant, building
 util-linux-2.25.1 fails with the folllowing error:

     disk-utils/cfdisk.c: In function 'resize':
     disk-utils/cfdisk.c:202:9: error: lvalue required as left operand of assignment
        LINES = ws.ws_row;
              ^
     disk-utils/cfdisk.c:203:8: error: lvalue required as left operand of assignment
        COLS = ws.ws_col;
             ^

 man COLS gives the following:

     Depending on the configuration, these may be actual variables,
     or macros (see curs_threads(3X)) which provide read-only
     access to curses's state.  In either case, applications should
     treat them as read-only to avoid confusing the library.

Addresses: https://github.com/karelzak/util-linux/issues/125
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-10-01 11:38:49 +02:00
Karel Zak c7119037f0 libfdisk: use reference counting for context
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-28 12:49:16 +02:00
Karel Zak 59af21c3f2 cfdisk: fix typo in the previous commit
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-26 22:19:26 +02:00
Karel Zak ce3134dfdd cfdisk: wrong interpretation of yes in non-english language
Reported-by: tnut@nutyx.org
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-26 17:03:11 +02:00
Karel Zak 8eccde20dd fdisk: use libfdisk public API only
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-15 12:16:55 +02:00