Re: [PATCH] mkdir/split: send --verbose output to stdout + [PATCH]: same for rmdir/install
Hello, I think there are still some things to be consolidated. The same with verbose output should be done in the case of install(when making dir) and in the case of rmdir. In the case of shred should be mentioned in info that verbose output is to standard error. Those things done in attached patch, should break no tests (as rmdir has no verbose test and install verbose test redirects stdout and stderr to the one file) Greetings, Ondrej Vasik Jim Meyering wrote: > Steven Schubiger <[EMAIL PROTECTED]> wrote: > > +2008-02-01 Steven Schubiger <[EMAIL PROTECTED]> > > + > > + * src/mkdir.c: Send --verbose output to stdout. > > + * src/split.c: Likewise. > > + Update texinfo documentation for split. > > + Adjust tests for mkdir/split. > > + * tests/mkdir/p-v: Capture verbose output which previously was > > + being emitted to stderr from stdout. > > + * tests/misc/split-a: Likewise. > > Thanks for the patch. > I've made some minor changes and handled the usual administrivia. > > mkdir, split: write --verbose output to stdout, not stderr. > > * src/mkdir.c (verbose_output): New function. > (announce_mkdir): Use it. > * src/split.c (usage): Update. > * src/split.c (cwrite): Write to stdout, not stderr. > * doc/coreutils.texi (split invocation): Remove the mention > of --verbose output being printed to stderr. > * tests/mkdir/p-v: Redirect stdout, not stderr. > * tests/misc/split-a: Likewise. > * NEWS: Mention this change. > * TODO: Remove this item. > > Signed-off-by: Jim Meyering <[EMAIL PROTECTED]> diff --git a/ChangeLog-2008 b/ChangeLog-2008 index aac9feb..5975e20 100644 --- a/ChangeLog-2008 +++ b/ChangeLog-2008 @@ -1,3 +1,13 @@ +2008-03-03 Ondrej Vasik <[EMAIL PROTECTED]> + + rmdir, install: write --verbose output to stdout, not stderr. + * src/rmdir.c (main): write to stdout, not stderr + * src/rmdir.c (remove_parents): write to stdout, not stderr + * src/install.c (announce_mkdir): write to stdout, not stderr + * doc/coreutils.texi: mention that shred verbose output is + to stderr + * NEWS: Mention that change. + 2008-02-07 Jim Meyering <[EMAIL PROTECTED]> We *do* need two different version files. diff --git a/NEWS b/NEWS index b549513..1c9510f 100644 --- a/NEWS +++ b/NEWS @@ -37,7 +37,8 @@ GNU coreutils NEWS-*- outline -*- ** Consistency - mkdir and split now write --verbose output to stdout, not stderr. + mkdir, split, install and rmdir now write --verbose output to stdout, + not stderr. * Noteworthy changes in release 6.10 (2008-01-22) [stable] diff --git a/doc/coreutils.texi b/doc/coreutils.texi index df6792d..e3a0d50 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8190,7 +8190,7 @@ If a file has multiple links, only the named links will be removed. @itemx --verbose @opindex -v @opindex --verbose -Display status updates as sterilization proceeds. +Display to standard error all status updates as sterilization proceeds. @item -x @itemx --exact diff --git a/src/install.c b/src/install.c index db08751..b594a53 100644 --- a/src/install.c +++ b/src/install.c @@ -1,5 +1,5 @@ /* install - copy files and set attributes - Copyright (C) 89, 90, 91, 1995-2007 Free Software Foundation, Inc. + Copyright (C) 89, 90, 91, 1995-2008 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 @@ -762,7 +762,7 @@ announce_mkdir (char const *dir, void *options) { struct cp_options const *x = options; if (x->verbose) -error (0, 0, _("creating directory %s"), quote (dir)); +printf (_("%s: creating directory %s\n"), program_name, quote (dir)); } /* Make ancestor directory DIR, whose last file name component is diff --git a/src/rmdir.c b/src/rmdir.c index bb1a0c8..abbf87f 100644 --- a/src/rmdir.c +++ b/src/rmdir.c @@ -1,6 +1,6 @@ /* rmdir -- remove directories - Copyright (C) 90, 91, 1995-2002, 2004, 2005, 2006, 2007 Free Software + Copyright (C) 90, 91, 1995-2002, 2004-2008 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -134,7 +134,7 @@ remove_parents (char *dir) /* Give a diagnostic for each attempted removal if --verbose. */ if (verbose) - error (0, 0, _("removing directory, %s"), quote (dir)); + printf(_("%s: removing directory, %s\n"), program_name, quote (dir)); ok = (rmdir (dir) == 0); @@ -233,7 +233,7 @@ main (int argc, char **argv) /* Give a diagnostic for each attempted removal if --verbose. */ if (verbose) - error (0, 0, _("removing directory, %s"), dir); + printf(_("%s: removing directory, %s\n"), program_name, dir); if (rmdir (dir) != 0) { signature.asc Description: Toto je digitálně podepsaná část zprávy _
Patch proposal for id.c and groups.c to fix afs bug
Hey Sorry for any violation of any mailing list rules, this is my first patch to coreutils. On some systems, with AFS, if you call 'id' or 'groups' without a user name parameter it will return a huge group number: $ id -G 500 1103556127 The same behavior applies to groups: $ groups ribalba id: cannot find name for group ID 1103556127 1103556127 Because of this I propose following patch : <8 diff --git a/src/groups.c b/src/groups.c index baac7b9..b24b70a 100644 --- a/src/groups.c +++ b/src/groups.c @@ -102,7 +102,7 @@ main (int argc, char **argv) egid = getegid (); rgid = getgid (); - if (!print_group_list (NULL, ruid, rgid, egid, true)) + if (!print_group_list (getlogin(), ruid, rgid, egid, true)) ok = false; putchar ('\n'); } diff --git a/src/id.c b/src/id.c index e4eda40..d97d809 100644 --- a/src/id.c +++ b/src/id.c @@ -196,21 +196,17 @@ of a different user")); error (EXIT_FAILURE, 0, _("cannot print only names or real IDs in default format")); - if (argc - optind == 1) -{ - struct passwd *pwd = getpwnam (argv[optind]); - if (pwd == NULL) - error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]); - ruid = euid = pwd->pw_uid; - rgid = egid = pwd->pw_gid; -} - else -{ - euid = geteuid (); - ruid = getuid (); - egid = getegid (); - rgid = getgid (); -} + struct passwd *pwdg = NULL; + if (argc - optind == 1){ +pwdg = getpwnam (argv[optind]); + }else{ +pwdg = getpwnam (getlogin()); + } + if (pwdg == NULL) +error (EXIT_FAILURE, 0, _("%s: No such user"), argv[optind]); + ruid = euid = pwdg->pw_uid; + rgid = egid = pwdg->pw_gid; + if (just_user) { @@ -223,7 +219,7 @@ of a different user")); } else if (just_group_list) { - if (!print_group_list (argv[optind], ruid, rgid, egid, use_name)) + if (!print_group_list (pwdg->pw_name, ruid, rgid, egid, use_name)) ok = false; } else if (just_context) @@ -232,7 +228,7 @@ of a different user")); } else { - print_full_info (argv[optind]); + print_full_info (pwdg->pw_name); } putchar ('\n'); >8 The behavior is due to AFS creating a pseudo group in the kernel that does not have a name. Some information to the system I am using: Linux mypc 2.6.9-67.0.4.EL.cernsmp #1 SMP Mon Feb 4 10:15:50 CET 2008 x86_64 x86_64 x86_64 GNU/Linux I hope this can help :) Cheers Didi www.cern.ch/ribalba / www.ribalba.de Email / Jabber: [EMAIL PROTECTED] Phone (Work) : +41 22 7679376 Skype : ribalba Address : CERN / IT-FIO-FS / GENEVE 23/ SCHWEIZ ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
[PATCH] GNUmakefile build tweaks.
* GNUmakefile: When Makefile is not present, make common targets depend on all to trigger nicer error message. * configure.ac: If autoconf is new enough, link GNUmakefile into VPATH builds. Signed-off-by: Eric Blake <[EMAIL PROTECTED]> --- GNUmakefile |5 + configure.ac |7 +++ 2 files changed, 12 insertions(+), 0 deletions(-) For the first change, the idea here is that in well-formed GNU packages and with GNU make, './configure && make check' or './configure && make install' generally work out of the box. But in an un-configured tree, while 'make' complains loudly that configure has not been run yet, 'make check' without the patch is less-than-helpful: $ make There seems to be no Makefile in this directory. You must run ./configure before running `make'. make: *** [all] Error 1 $ make check make: *** No rule to make target `check'. Stop. In contrast, non-GNU makes ignore GNUmakefile altogether, so the user gets a consistent message implying that Makefile is not present regardless of what GNU Coding Standard targets they requested of make (true, they don't get the helpful message to run ./configure, but oh well). It seems odd that GNU make users are on the losing end of this scenario, hence the patch. [At this point, I'm wondering if GNUmakefile should also check whether configure is present, in which case it suggests reading the hacking instructions and running ./bootstrap; although that only affects unbootstrapped trees, rather than unconfigured trees, so it affects a smaller audience.] For the second change, it is nice to link GNUmakefile into the VPATH build tree, so that a VPATH 'make dist' using GNU make picks up all of the maintainer bonus rules (including those in Makefile.maint). Unfortunately, autoconf 2.61 AC_CONFIG_LINKS does not support this usage; you need 2.61a.100 or greater. On the other hand, coreutils already relies on newer autoconf anyway. [I really wish the FSF lawyers would come to a resolution on how to license autoconf under GPLv3+ with exception; autoconf 2.62 has been held up long enough.] -- Eric Blake diff --git a/GNUmakefile b/GNUmakefile index 49e41b7..edb03ad 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -75,6 +75,11 @@ all: @echo "You must run ./configure before running \`make'." 1>&2 @exit 1 +check: all +install: all +dist: all +distcheck: all + endif # Tell version 3.79 and up of GNU make to not build goals in this diff --git a/configure.ac b/configure.ac index 5c332db..6608278 100644 --- a/configure.ac +++ b/configure.ac @@ -333,6 +333,13 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES]) AM_GNU_GETTEXT([external], [need-formatstring-macros]) AM_GNU_GETTEXT_VERSION([0.15]) +dnl Allow maintainer rules under GNU make even in VPATH builds. This does +dnl not work in autoconf 2.61 or earlier, but we don't want to require +dnl non-maintainers to use unreleased autoconf, hence the version test. +dnl TODO remove the version check once autoconf 2.62 is released. +m4_if(m4_version_compare([2.61a.100], m4_defn([AC_AUTOCONF_VERSION])), [1], [], + [AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])]) + AC_CONFIG_FILES( Makefile doc/Makefile -- 1.5.4 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
shellutils
<= META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">= This utility is responsible for the bina= ry "hostname". Now with coreutils this file isn't generated any more. Is it dropped, or not longer supported ? -- [1] [=] References 1. 3D"http://adserver.freenet.de/___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] GNUmakefile build tweaks.
Eric Blake <[EMAIL PROTECTED]> wrote: > * GNUmakefile: When Makefile is not present, make common targets depend > on all to trigger nicer error message. > * configure.ac: If autoconf is new enough, link GNUmakefile into VPATH > builds. Thanks. Applied with one tweak: I put all new targets on the same line: check dist distcheck install: all > [At this point, I'm wondering if GNUmakefile should also check whether > configure is present, in which case it suggests reading the hacking > instructions and running ./bootstrap; although that only affects > unbootstrapped > trees, rather than unconfigured trees, so it affects a smaller audience.] Wouldn't hurt, but maybe not worth it, either... > For the second change, it is nice to link GNUmakefile into the VPATH build > tree, so that a VPATH 'make dist' using GNU make picks up all of the > maintainer > bonus rules (including those in Makefile.maint). Unfortunately, autoconf 2.61 > AC_CONFIG_LINKS does not support this usage; you need 2.61a.100 or greater. > On > the other hand, coreutils already relies on newer autoconf anyway. > > [I really wish the FSF lawyers would come to a resolution on how to license > autoconf under GPLv3+ with exception; autoconf 2.62 has been held up long > enough.] Same here. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: Patch proposal for id.c and groups.c to fix afs bug
Didi <[EMAIL PROTECTED]> wrote: > Sorry for any violation of any mailing list rules, this is my first > patch to coreutils. Hello! No violation ;-) Thanks for the report and patch. > On some systems, with AFS, if you call 'id' or 'groups' without a user > name parameter it will return a huge group number: > $ id -G > 500 1103556127 > > The same behavior applies to groups: > $ groups > ribalba id: cannot find name for group ID 1103556127 > 1103556127 > > Because of this I propose following patch : Unfortunately, we can't use that approach, since both id and groups have to work even when there isn't a user or group name (i.e., when getlogin returns NULL). Maybe you can find a way to distinguish (at run time) between the regular no-user-or-group-name case and your AFS nameless-huge-ID case. ... > The behavior is due to AFS creating a pseudo group in the kernel that > does not have a name. > > > Some information to the system I am using: > Linux mypc 2.6.9-67.0.4.EL.cernsmp #1 SMP Mon Feb 4 10:15:50 CET 2008 > x86_64 x86_64 x86_64 GNU/Linux ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] GNUmakefile build tweaks.
Eric Blake wrote: > * configure.ac: If autoconf is new enough, link GNUmakefile into VPATH > builds. Is there another way to determine if autoconf is new enough? > +dnl Allow maintainer rules under GNU make even in VPATH builds. This does > +dnl not work in autoconf 2.61 or earlier, but we don't want to require > +dnl non-maintainers to use unreleased autoconf, hence the version test. > +dnl TODO remove the version check once autoconf 2.62 is released. > +m4_if(m4_version_compare([2.61a.100], m4_defn([AC_AUTOCONF_VERSION])), [1], > [], > + [AC_CONFIG_LINKS([GNUmakefile:GNUmakefile])]) > + > AC_CONFIG_FILES( >Makefile >doc/Makefile Unfortuantely using AC_AUTOCONF_VERSION breaks autoconf-2.61 which doesn't have it. ./bootstrap: aclocal --force -I m4 ... configure.ac:340: error: m4_defn: undefined macro: AC_AUTOCONF_VERSION configure.ac:340: the top level autom4te: /usr/local/build/coreutils/bin/m4 failed with exit status: 1 aclocal: autom4te failed with exit status: 1 program finished with exit code 1 [Yes, we all want the lawyers to finish the release exception for the autotools! Argh.] Bob ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] GNUmakefile build tweaks.
Bob Proulx proulx.com> writes: > > Unfortuantely using AC_AUTOCONF_VERSION breaks autoconf-2.61 which > doesn't have it. Oops - you're right. s/AC_AUTOCONF_VERSION/m4_PACKAGE_VERSION/ (and you'd think that since I just posted to the gcc list on the same topic, that I would have remembered that I added AC_AUTOCONF_VERSION post-2.61: http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00117.html) -- Eric Blake ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: shellutils
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to [EMAIL PROTECTED] on 3/3/2008 12:43 PM: |This utility is responsible for the bina= ry |"hostname". |Now with coreutils this file isn't generated any more. |Is it dropped, or not longer supported ? Neither. Coreutils 6.10 still provides hostname, but you have to specifically request it when running ./configure, otherwise it is not installed (since there are other popular packages which provide a competing version of hostname). Check out the README for more details. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHzFm984KuGfSFAYARAsh0AJ47ndPssxAc3M9vt6g5ZZsY2aQAZACdH9Ao IyvjCrb360Zzm4YOfdkCHr8= =piDC -END PGP SIGNATURE- ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: [PATCH] GNUmakefile build tweaks.
Eric Blake <[EMAIL PROTECTED]> wrote: > Bob Proulx proulx.com> writes: >> Unfortuantely using AC_AUTOCONF_VERSION breaks autoconf-2.61 which >> doesn't have it. > > Oops - you're right. s/AC_AUTOCONF_VERSION/m4_PACKAGE_VERSION/ Thanks to both of you. Just pushed. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils