summaryrefslogtreecommitdiff
path: root/misc-utils
AgeCommit message (Collapse)AuthorFilesLines
2014-02-16s_addr is defined to something strange on illumosIgor Pashev1-5/+5
2014-02-15include <libgen.h> for basename()Igor Pashev1-0/+1
2014-02-10cal: remove unnecessary static variablesSami Kerola1-19/+0
Not in use since commit 95f4adde867492563167b11ba94dba67f93809aa. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-02-10getopt.1: The usual doc dir is /usr/share/doc, not .../docsVille Skyttä1-1/+1
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2014-02-10lsblk: add PARTTYPE tagMichael Marineau1-0/+13
To stay in sync with blkid add PARTTYPE as an available output column.
2014-02-06cal: limit year to 32 bit valueSami Kerola1-21/+23
This is done to keep things simple, when considering tests, for both 64 and 32 bit architectures. Setting the upper limit of a year value to to 2^31-1 (2147483646) should be enough for anyone. Reported-by: Mike Frysinger <vapier@gentoo.org> Reference: http://www.spinics.net/lists/util-linux-ng/msg08662.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-01-20wipefs: call BLKRRPART when erase partition tableKarel Zak2-8/+36
It's better to be smart than make things inconsistent (without BLKRRPART kernel still uses the erased PT and udev-db still contains obsolete information). Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-16wipefs: add comments to codeKarel Zak1-4/+7
2014-01-14rename: fix mem leak [coverity scan]Karel Zak1-1/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-07uuidd: use pkg-config to find systemd-deamon supportSami Kerola4-812/+8
[kzak@redhat.com: - remove USE_SOCKET_ACTIVATION and use HAVE_* as we use for another libs] Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-07cal: in man page improve grammar and wording of the reformation limitationBenno Schulenberg1-5/+6
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-01-06cal: in man page admit that any week has just one SundayBenno Schulenberg1-5/+5
Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-06cal: mention where Gregorian reformation happen in September 1752Sami Kerola1-6/+12
In September 1752 the Gregorian reformation happen in Great Britain and Dominions (including what is now the USA). One could argue the cal(1) should consider locale when determining the reformation, but such is nearly impossible implement correctly. The dates when reformation happen are split by areas that cannot be expressed with current locales, for example the Netherlands is split to two and Germany three categories depending on where in the modern country one is. Secondly the track when reformation happen is lost for some countries, Lithuania or Japan are good examples of such. One of the worst for a programmer is Sweden. They got gradual calendar change which made Swedish calendar to be completely out of sync. Later the Swedish calendar jumped in 1753 to be in sync with everyone else. Notice that some countries, including Saudi Arabia, Ethiopia, Nepal, Iran and Afghanistan, still have not adopted the Gregorian calendar. Hence the output of the cal(1) cannot be considered to be correct for everyone. References: http://calendopedia.com/gregory.htm References: http://en.wikipedia.org/wiki/Gregorian_calendar#Gregorian_reform Reviewed-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-11findmnt: add -U to de-deplicate filesystemsKarel Zak1-2/+18
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-11findmnt: cleanup usage()Karel Zak1-39/+34
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-12-06cal: use month contents structure for --year printingSami Kerola1-184/+45
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: use month contents structure for --three printingSami Kerola1-110/+26
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: add month contents structureSami Kerola1-7/+169
This changes determination of calendar month content completely, as well as outputing. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: determine how many header lines are needed at initializationSami Kerola1-31/+22
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: make user request to be part of read-only control structSami Kerola1-65/+73
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: determine output width at beginning of run and reuse resultSami Kerola1-47/+38
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: simplify ascii_weeknum() functionSami Kerola1-5/+2
Either the week is or isn't highlighted, there is no need to over complicate printing of that. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: make day_in_week() use same variable names as other functionsSami Kerola1-14/+14
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: add input variable names to function prototypesSami Kerola1-16/+18
While prototypes such as 'function(int, int, char, int);' are legal they do not help when trying to understand how the function is expected to be used. Adding variable names gives at least a hint when looking the prototypes. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: rename ascii_wnum() to ascii_weeknum()Sami Kerola1-4/+4
Week is not long word, so it does not need to be enshorted and made more difficult to understand. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-06cal: use control structure for run time configurationSami Kerola1-131/+140
Runtime configuration is set at the time of command line option parsing, and other initialization. Later the configuration is read-only. This should make code a little bit more understandable. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-12-02namei: align missing files with rest of the print outSami Kerola1-0/+9
This change should make namei output more readable when multiple arguments are supplied. The old: $ namei -l /usr/foo f: /usr/foo drwxr-xr-x root root / drwxr-xr-x root root usr foo - No such file or directory The new: $ namei -l /usr/foo f: /usr/foo drwxr-xr-x root root / drwxr-xr-x root root usr foo - No such file or directory Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-11-18lsblk: fix -D segfaultKarel Zak1-3/+3
References: https://bugzilla.redhat.com/show_bug.cgi?id=1031262 Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-08blkid: simple typoPhillip Susi1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-11-07blkid: escape quotes in the outputKarel Zak1-4/+8
# e2label /dev/loop0 'La"bel' # blkid -p /dev/loop0 /dev/loop0: LABEL="La"bel" .... new version: /dev/loop0: LABEL="La\"bel" .... Reported-by: Phillip Susi <psusi@ubuntu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-22cal: fix coding styleKarel Zak1-81/+107
- mostly space around operators - split yearly(), move weeknum stuff to append_wnum() Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-22cal: remove optional from short arg -wTommi Kyntola2-3/+3
The long option --week still has the optional argument as --week=<wnum> This was suggested on the mailing list by Padraig Brady and I do agree with that. Actually, the whole idea of --week=<wnum> came from him. Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-22cal: added argument option for -w|--week to display that weekTommi Kyntola2-17/+100
Because many years have two sections of week 52 or 53, the week that this argument points to is the one that starts during that year (when available). The week number in argument is also highlighted in addition to possibly visible current/defined date highlighting. Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-22cal: added -w|--week for showing week numbersTommi Kyntola2-29/+121
Added week numbers both in ISO-6801 and North America numbering. The mode is determined by first day of the week, Monday for ISO and Sunday for North America mode. ISO week numbers are defined as the first Thursday being part of week 1. The North America numbering is defined, at least by gcal, as first Sunday being in the first week. Signed-off-by: Tommi Kyntola <kynde@iki.fi>
2013-10-15cal: fix compiler warning on systems without term libsKarel Zak1-2/+4
Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15cal: fix warning when compiled --without-ncursesKarel Zak1-1/+1
Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-15docs: standardize the phrases for --help and --version in all man pagesBenno Schulenberg10-17/+15
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14docs: improve formatting and wording of the getopt man pageBenno Schulenberg1-21/+32
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14docs: sort the options in the logger man page alphabeticallyBenno Schulenberg1-31/+31
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14docs: improve a bit the wording on the logger man pageBenno Schulenberg1-13/+13
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14textual: remove duplicate mention of '--help' from lsblk help textBenno Schulenberg1-4/+3
Also improve the alphabetization of the other options. Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-14build-sys: move getopt examples to docdirKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-11cal: fix gettext warningKarel Zak1-2/+2
/usr/bin/xgettext: Non-ASCII comment at or before misc-utils/cal.c:473. Please specify the source encoding through --from-code. Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-11cal: improve the help text and man pagePádraig Brady2-5/+9
* misc-utils/cal.c: Add a little doc string, and mention that the current month is implicit if not specified. Also remove mention of "current" from two option descriptions as a specific date may have been specified. * misc-utils/cal.1: Likewise. [kzak@redhat.com: - use fputs and USAGE_SEPARATOR] Signed-off-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Pádraig Brady <P@draigBrady.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2013-10-08textual: tag a translator comment and put it in proper placeBenno Schulenberg1-6/+4
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08wipefs: pluralize one messageBenno Schulenberg1-2/+4
Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-10-08mcookie: pluralize two messagesBenno Schulenberg1-4/+6
Reported-by: Petr Písař <petr.pisar@atlas.cz> Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-09-30clean up term lib handlingMike Frysinger1-10/+2
The ncurses package has been providing pkg-config files for a while now. So let's start using them to get the proper linker & compiler flags. It can make a difference when ncurses is configured in a way that requires extra link time flags but util-linux doesn't provide them, or when the headers live in a weird place and util-linux can't find them. Since the NCURSES_LIBS is always defined for the Makefile, there's no need to gate on the HAVE_NCURSES conditional. When it's disabled, the var will simply be empty. With a minor tweak to how tinfo is handled, we can do the same thing -- we just always use TINFO_LIBS in the Makefile's. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2013-09-30findmnt: always allocate memory for cell valueDave Reisner1-1/+1
Since b3386c83fe77, findmnt's output uses TT_FL_FREEDATA, which causes a crash here when string literal is returned instead of a heap address. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-16lsblk: use TT_FL_FREEDATA for tt tableKarel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>