From unknown Wed Jun 18 22:58:44 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#6402 <6402@debbugs.gnu.org> To: bug#6402 <6402@debbugs.gnu.org> Subject: Status: [PATCH] rm: added --directory (-d) option Reply-To: bug#6402 <6402@debbugs.gnu.org> Date: Thu, 19 Jun 2025 05:58:44 +0000 retitle 6402 [PATCH] rm: added --directory (-d) option reassign 6402 coreutils submitter 6402 Eric Blake severity 6402 normal tag 6402 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 11 11:14:05 2010 Received: (at submit) by debbugs.gnu.org; 11 Jun 2010 15:14:05 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ON5vp-0008A3-GB for submit@debbugs.gnu.org; Fri, 11 Jun 2010 11:14:05 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ON5vm-00089h-Jk for submit@debbugs.gnu.org; Fri, 11 Jun 2010 11:14:04 -0400 Received: from lists.gnu.org ([199.232.76.165]:59772) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ON5vh-0004Wv-OR for submit@debbugs.gnu.org; Fri, 11 Jun 2010 11:13:57 -0400 Received: from [140.186.70.92] (port=39291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ON5vg-0006Fh-1J for bug-coreutils@gnu.org; Fri, 11 Jun 2010 11:13:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ON5ve-0005Vn-JT for bug-coreutils@gnu.org; Fri, 11 Jun 2010 11:13:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5103) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ON5ve-0005VZ-Bf for bug-coreutils@gnu.org; Fri, 11 Jun 2010 11:13:54 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5BFDpSx032277 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Jun 2010 11:13:51 -0400 Received: from [10.3.243.96] (vpn-243-96.phx2.redhat.com [10.3.243.96]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5BFDoci011140; Fri, 11 Jun 2010 11:13:50 -0400 Message-ID: <4C12528F.3040600@redhat.com> Date: Fri, 11 Jun 2010 09:13:19 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Lightning/1.0b2pre Mnenhy/0.8.2 Thunderbird/3.0.4 MIME-Version: 1.0 To: pwplusnick2@gmail.com Subject: Re: [PATCH] rm: added --directory (-d) option References: <4b9402e6.5444f10a.65af.1954@mx.google.com> In-Reply-To: <4b9402e6.5444f10a.65af.1954@mx.google.com> X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig27AD2A406F086907BD58B404" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit Cc: bug-coreutils@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.8 (-------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig27AD2A406F086907BD58B404 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 03/07/2010 12:47 PM, pwplusnick2@gmail.com wrote: > Hello again, Hello, Sorry for the long delay in reading through my inbox. It looks like this was written before we moved to the debbugs interface, making it easier to lose in the mists of time; but now that I am responding, it will get an id number to help us remember it. >=20 > I have finally completed my --directory (-d) feature, like the FreeBSD = one. Well, first, I would need to understand if there is any difference between 'rmdir dir' (specified by POSIX) and 'rm -d dir' - if they are no different, then how do you justify the extension? But, since there are other implementations out there that do it, it might be nice to support, if only so GNU tools can serve as drop-in replacement for vendor tools. > The directory option deletes a directory only if the directory in quest= ion is > empty. This is a safer alternative to the recursive option is some case= s where > you don't want to delete unempty directories. >=20 > I have documented the features. Although I am not the best technical wr= iter, I > hope that what I have done is adequate. One thing that I have neglected= to do, > intentionally, is to write an automated test. I am not skilled enough o= r > confident enough in my Perl or shell scripting ability to write such a = test. Thanks very much for submitting a patch, and especially for including documentation as part of the patch. If others on this list agree that this is worth having, there's still one hurdle to jump through - your patch is too long to be considered trivial, so you would have to assign copyright to the FSF, or else we would have to reimplement the patch from scratch based on your description. I have not looked at your patch, for that reason. Let us know if this is still something you are willing to pursue. >=20 > I would love to hear what I could have done better, or possibly what I = have > done wrong. Any comments on my code are very much appreciated. That is = a big > part of why I am doing this is to become a better programmer. >=20 > Thank you, and with out further ado, here is the patch. >=20 --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig27AD2A406F086907BD58B404 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJMElKUAAoJEKeha0olJ0Nq5QEH/0eSXeNTZJy7EpU6OiwQUy59 mQa/WsNjRRE7MFTcq4uQche06+SrA9pqYK7vcMJlqxUQnHM3DRs5SZ/5p8WSZLQb da0J5UcyeDtQ4aZNlOjMLKAroXqZLrHXHimsOCZtWMLcyAEkgFY4HxooNmskJ+Nb TujEevFGxo05TYrj34aOZAbwYbZcShWGyHCqSafuB4yX6oGLNmxGD7bpHwUK3z1k pTrRhQj2qgSH2hS/W30MlOc/4faa62kGbSHLeCcfa+cI3NFsDt7Nxf+5dpERm3vg 3RuX/TxQpSQu1/z8oHk+0oC63NwzayxW1NHX6e36rQfO0arQZwKvxSsJ095lAxw= =/0H5 -----END PGP SIGNATURE----- --------------enig27AD2A406F086907BD58B404-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 15 14:59:32 2010 Received: (at 6402) by debbugs.gnu.org; 15 Jun 2010 18:59:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OObMC-0004p1-Ag for submit@debbugs.gnu.org; Tue, 15 Jun 2010 14:59:32 -0400 Received: from kiwi.cs.ucla.edu ([131.179.128.19]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OObM9-0004ot-58 for 6402@debbugs.gnu.org; Tue, 15 Jun 2010 14:59:30 -0400 Received: from [131.179.64.200] (Penguin.CS.UCLA.EDU [131.179.64.200]) by kiwi.cs.ucla.edu (8.13.8+Sun/8.13.8/UCLACS-6.0) with ESMTP id o5FIxNk3003306; Tue, 15 Jun 2010 11:59:23 -0700 (PDT) Message-ID: <4C17CD8B.2030206@cs.ucla.edu> Date: Tue, 15 Jun 2010 11:59:23 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Eric Blake Subject: Re: bug#6402: [PATCH] rm: added --directory (-d) option References: <4b9402e6.5444f10a.65af.1954@mx.google.com> <4C12528F.3040600@redhat.com> In-Reply-To: <4C12528F.3040600@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -3.1 (---) X-Debbugs-Envelope-To: 6402 Cc: 6402@debbugs.gnu.org, pwplusnick2@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) On 06/11/2010 08:13 AM, Eric Blake wrote: > I would need to understand if there is any difference > between 'rmdir dir' (specified by POSIX) and 'rm -d dir' - if they are > no different, then how do you justify the extension? I briefly looked at the FreeBSD source code, and there's essentially no difference. The "-d" option causes BSD "rm" to use the rmdir system call rather than the unlink system call. There is a minor difference if you use the "-P" option to shred on the file before removing it, in that "rm -dP" does not attempt to shred a directory, but that minor difference doesn't apply to coreutils where "shred" is a separate executable. I'm dubious about this "rm -d" flag. It's clearly not portable, and (despite a search) I couldn't find any record of anybody seriously using it. On the contrary, all the uses I found of "rm -d" were errors; e.g., people incorrectly thought that "rm -dr FOO" would recursively move the directory tree rooted at FOO. Since "rm -d" causes confusion and provides no extra utility over "rmdir" that I can see, I suggest that we instead change "rm -d" to report an error, much as "rm -X" does for other offbeat values of X. From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 15 15:38:07 2010 Received: (at 6402) by debbugs.gnu.org; 15 Jun 2010 19:38:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OObxX-000588-21 for submit@debbugs.gnu.org; Tue, 15 Jun 2010 15:38:07 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OObxV-00057j-3l for 6402@debbugs.gnu.org; Tue, 15 Jun 2010 15:38:06 -0400 Received: from mx.meyering.net (mx.meyering.net [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id 6B946940089; Tue, 15 Jun 2010 21:37:55 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id EDDF4E70; Tue, 15 Jun 2010 21:37:53 +0200 (CEST) From: Jim Meyering To: Paul Eggert Subject: Re: bug#6402: [PATCH] rm: added --directory (-d) option In-Reply-To: <4C17CD8B.2030206@cs.ucla.edu> (Paul Eggert's message of "Tue, 15 Jun 2010 11:59:23 -0700") References: <4b9402e6.5444f10a.65af.1954@mx.google.com> <4C12528F.3040600@redhat.com> <4C17CD8B.2030206@cs.ucla.edu> Date: Tue, 15 Jun 2010 21:37:53 +0200 Message-ID: <87pqzsgk8e.fsf@meyering.net> Lines: 26 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: 6402 Cc: 6402@debbugs.gnu.org, Eric Blake , pwplusnick2@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.3 (---) Paul Eggert wrote: > On 06/11/2010 08:13 AM, Eric Blake wrote: > >> I would need to understand if there is any difference >> between 'rmdir dir' (specified by POSIX) and 'rm -d dir' - if they are >> no different, then how do you justify the extension? > > I briefly looked at the FreeBSD source code, and there's essentially no > difference. The "-d" option causes BSD "rm" to use the rmdir system call > rather than the unlink system call. There is a minor difference if you > use the "-P" option to shred on the file before removing it, in that > "rm -dP" does not attempt to shred a directory, but that minor difference > doesn't apply to coreutils where "shred" is a separate executable. > > I'm dubious about this "rm -d" flag. It's clearly not > portable, and (despite a search) I couldn't find any record of anybody > seriously using it. On the contrary, all the uses I found of "rm -d" were > errors; e.g., people incorrectly thought that "rm -dr FOO" would recursively > move the directory tree rooted at FOO. > > Since "rm -d" causes confusion and provides no extra utility over "rmdir" > that I can see, I suggest that we instead change "rm -d" to report an error, > much as "rm -X" does for other offbeat values of X. Thanks for doing that research. I like your idea. I too would prefer to discourage the use of rm's -d option. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 18 09:07:07 2010 Received: (at 6402) by debbugs.gnu.org; 18 Aug 2010 13:07:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OliME-0004fl-Mc for submit@debbugs.gnu.org; Wed, 18 Aug 2010 09:07:07 -0400 Received: from mail-qw0-f44.google.com ([209.85.216.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OliK4-0004du-Bu for 6402@debbugs.gnu.org; Wed, 18 Aug 2010 09:04:52 -0400 Received: by qwc9 with SMTP id 9so450706qwc.3 for <6402@debbugs.gnu.org>; Wed, 18 Aug 2010 06:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=38Z7m3ITQj6ENzic4oobh4T8J8Fq7tWEbgQrpHZordA=; b=tmQgUVvauQOKWROHWex6YKqRK28FfOxcNyErVibxypPLcS+u6Y52DPjzisge7ywRfL SrmQH2xp6p8veYIrFCno1eX0KwK9p876xYY9sSz7oWDk3vMUe8H8IW7tveBLBgQNYsm1 fC4iLQDWt9NwnPKgRRfj3HB0oAIygctfFPu18= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=djX2Xo5MRsF7ilQZzdP+stecMReOI1h3CVl6Oec02U5zsQMaPQ962Bmm6SUr3UnbJ+ xGdxzidwRtKypoRvDl1NxyH/OGJuZY/nl9tKT8NK2loMY6A8O/syCszrN3/wLEsrQOn+ IUohVHd9CN54X/rjvHOmeltVZVtkannMmzquo= MIME-Version: 1.0 Received: by 10.229.37.3 with SMTP id v3mr78358qcd.169.1282136756758; Wed, 18 Aug 2010 06:05:56 -0700 (PDT) Received: by 10.229.127.208 with HTTP; Wed, 18 Aug 2010 06:05:56 -0700 (PDT) In-Reply-To: References: <4b9402e6.5444f10a.65af.1954@mx.google.com> <4C12528F.3040600@redhat.com> <4C17CD8B.2030206@cs.ucla.edu> <87pqzsgk8e.fsf@meyering.net> Date: Wed, 18 Aug 2010 08:05:56 -0500 Message-ID: Subject: Re: bug#6402: [PATCH] rm: added --directory (-d) option From: William Plusnick To: 6402@debbugs.gnu.org Content-Type: multipart/mixed; boundary=001636834228f0ab07048e18b9a4 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 6402 X-Mailman-Approved-At: Wed, 18 Aug 2010 09:07:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.7 (-) --001636834228f0ab07048e18b9a4 Content-Type: multipart/alternative; boundary=001636834228f0ab00048e18b9a2 --001636834228f0ab00048e18b9a2 Content-Type: text/plain; charset=ISO-8859-1 Sorry to take so long to reply, life got busy all of a sudden. I took your advice and instead made a trivial patch (I don't think I will have to sign anything) that instead prints an error message that points them to rmdir and exits. Thank you, William -- "Once GNU is written, everyone will be able to obtain good system software free, just like air."-- RMS in the GNU Manifesto --001636834228f0ab00048e18b9a2 Content-Type: text/html; charset=ISO-8859-1 Sorry to take so long to reply, life got busy all of a sudden. I took your advice and instead made a trivial patch (I don't think I will have to sign anything) that instead prints an error message that points them to rmdir and exits.

Thank you,
William

--
"Once GNU is written, everyone will be able to obtain good system software free, just like air."-- RMS in the GNU Manifesto
--001636834228f0ab00048e18b9a2-- --001636834228f0ab07048e18b9a4 Content-Type: application/octet-stream; name=DIFF Content-Disposition: attachment; filename=DIFF Content-Transfer-Encoding: base64 X-Attachment-Id: f_gd0729ms1 RnJvbSBmNzExYTA3MzcxZTExMWQwOWRiZDc0MjI3ZmYyMjY5OWVjYTJjNTdhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXRyaWNrIFcuIFBsdXNuaWNrIElJIDxwd3BsdXNuaWNrMkBn bWFpbC5jb20+CkRhdGU6IFR1ZSwgMTcgQXVnIDIwMTAgMjM6NTM6MDkgLTA1MDAKU3ViamVjdDog W1BBVENIXSBtYWludDogcm0gLWQgcHJpbnRzIGFuIGVycm9yIG1lc3NhZ2UgYW5kIGV4aXRzCgoq cm0uYzogc2luY2UgaXQgYWZ0ZXIgMjAwNSwgYXMgaW5kaWNhdGUgYnkgYSBjb21tZW50LCBJIG1h ZGUgcm0gLWQgcHJpbnQgYW4KZXJyb3IgbWVzc2FnZSBhbmQgZXhpdCwgcmF0aGVyIHRoYW4gc2ls ZW50bHkgaWdub3JpbmcgdGhlIG9wdGlvbi4KLS0tCiBzcmMvcm0uYyB8ICAgIDggKysrKy0tLS0K IDEgZmlsZXMgY2hhbmdlZCwgNCBpbnNlcnRpb25zKCspLCA0IGRlbGV0aW9ucygtKQoKZGlmZiAt LWdpdCBhL3NyYy9ybS5jIGIvc3JjL3JtLmMKaW5kZXggNDJmMGE1Ny4uNTljYjgwMSAxMDA2NDQK LS0tIGEvc3JjL3JtLmMKKysrIGIvc3JjL3JtLmMKQEAgLTIyNywxMCArMjI3LDEwIEBAIG1haW4g KGludCBhcmdjLCBjaGFyICoqYXJndikKICAgICAgIHN3aXRjaCAoYykKICAgICAgICAgewogICAg ICAgICBjYXNlICdkJzoKLSAgICAgICAgICAvKiBJZ25vcmUgdGhpcyBvcHRpb24sIGZvciBiYWNr d2FyZCBjb21wYXRpYmlsaXR5IHdpdGgKLSAgICAgICAgICAgICBjb3JldXRpbHMgNS45Mi4gIEZJ WE1FOiBTb21lIHRpbWUgYWZ0ZXIgMjAwNSwgY2hhbmdlIHRoaXMKLSAgICAgICAgICAgICB0byBy ZXBvcnQgYW4gZXJyb3IgKG9yIHBlcmhhcHMgYmVoYXZlIGxpa2UgRnJlZUJTRCBkb2VzKQotICAg ICAgICAgICAgIGluc3RlYWQgb2YgaWdub3JpbmcgdGhlIG9wdGlvbi4gICovCisgICAgICAgICAg LyogVGhpcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHZvdGUgb2YgdGhlIG1haW50YWluZXJzLiBQcmlu dAorICAgICAgICAgICAqIGFuIGVycm9yIG1lc3NhZ2UgcmF0aGVyIHRoYW4gaWdub3JlIGl0LiAg ICovCisgICAgICAgICAgZXJyb3IgKEVYSVRfRkFJTFVSRSwgMCwgInRoZSAtZCBmbGFnIGlzIG5v dCBzdXBwb3J0ZWQgaW4gcm0oMSkiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IiwgcGxlYXNlIHNlZSBybWRpcigxKSBpbnN0ZWFkLiIpOwogICAgICAgICAgIGJyZWFrOwogCiAg ICAgICAgIGNhc2UgJ2YnOgotLSAKMS43LjAuNAoK --001636834228f0ab07048e18b9a4-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 15 18:21:20 2010 Received: (at 6402) by debbugs.gnu.org; 15 Sep 2010 22:21:20 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ow0Lv-0006BJ-Lf for submit@debbugs.gnu.org; Wed, 15 Sep 2010 18:21:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ow0Lt-0006BE-RS for 6402@debbugs.gnu.org; Wed, 15 Sep 2010 18:21:18 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8FMNZwl020990 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Sep 2010 18:23:35 -0400 Received: from [10.3.113.81] (ovpn-113-81.phx2.redhat.com [10.3.113.81]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8FMNYld016944; Wed, 15 Sep 2010 18:23:34 -0400 Message-ID: <4C914765.8070204@redhat.com> Date: Wed, 15 Sep 2010 16:23:33 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3 MIME-Version: 1.0 To: William Plusnick Subject: Re: bug#6402: [PATCH] rm: added --directory (-d) option References: <4b9402e6.5444f10a.65af.1954@mx.google.com> <4C12528F.3040600@redhat.com> <4C17CD8B.2030206@cs.ucla.edu> <87pqzsgk8e.fsf@meyering.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-Spam-Score: -8.9 (--------) X-Debbugs-Envelope-To: 6402 Cc: 6402@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.1 (----------) On 08/18/2010 07:05 AM, William Plusnick wrote: > Sorry to take so long to reply, life got busy all of a sudden. Equally sorry for my delay in turn. Now are we even? :) >I took your > advice and instead made a trivial patch (I don't think I will have to sign > anything) that instead prints an error message that points them to rmdir and > exits. Thanks for the patch. However, it's harder to review patches that aren't sent as plain/text MIME types. Here's the meat: > @@ -227,10 +227,10 @@ main (int argc, char **argv) > switch (c) > { > case 'd': > - /* Ignore this option, for backward compatibility with > - coreutils 5.92. FIXME: Some time after 2005, change this > - to report an error (or perhaps behave like FreeBSD does) > - instead of ignoring the option. */ > + /* This is not supported by vote of the maintainers. Print > + * an error message rather than ignore it. */ > + error (EXIT_FAILURE, 0, "the -d flag is not supported in rm(1)" > + ", please see rmdir(1) instead."); > break; Indeed trivial, but missing translation of the string. At any rate, it's certainly after 2005, so according to our own comment, we indeed should do something very similar to what you have proposed! -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 16 13:52:21 2010 Received: (at 6402) by debbugs.gnu.org; 16 Sep 2010 17:52:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwIdA-0007Jq-P7 for submit@debbugs.gnu.org; Thu, 16 Sep 2010 13:52:21 -0400 Received: from qmta15.westchester.pa.mail.comcast.net ([76.96.59.228]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwId8-0007Jl-Hf for 6402@debbugs.gnu.org; Thu, 16 Sep 2010 13:52:19 -0400 Received: from omta22.westchester.pa.mail.comcast.net ([76.96.62.73]) by qmta15.westchester.pa.mail.comcast.net with comcast id 7PDZ1f0031ap0As5FVuf4l; Thu, 16 Sep 2010 17:54:39 +0000 Received: from office.hsd1.ut.comcast.net ([24.10.251.25]) by omta22.westchester.pa.mail.comcast.net with comcast id 7Vuc1f0060ZdyUg3iVueD2; Thu, 16 Sep 2010 17:54:39 +0000 From: Eric Blake To: 6402@debbugs.gnu.org Subject: [PATCH] rm: remove no-op -d option Date: Thu, 16 Sep 2010 11:54:34 -0600 Message-Id: <1284659674-19481-1-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <4C914765.8070204@redhat.com> References: <4C914765.8070204@redhat.com> X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 6402 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.7 (/) * src/rm.c (long_opts, main): Resolve a fixme. * NEWS: Document the change. Based on a report by William Plusnick. --- Jim, what do you think of this alternative patch, which avoids the issue of a new translation string by instead letting getopt parsing reject -d like any other unknown option? NEWS | 2 ++ src/rm.c | 10 +--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 3eb28b1..dc398a9 100644 --- a/NEWS +++ b/NEWS @@ -48,6 +48,8 @@ GNU coreutils NEWS -*- outline -*- [The old behavior was introduced in coreutils-6.0 and had been removed for English only using a different method since coreutils-8.1] + rm -d now issues an error rather than being silently ignored. + sort -g now uses long doubles for greater range and precision. sort -h no longer rejects numbers with leading or trailing ".", and diff --git a/src/rm.c b/src/rm.c index 42f0a57..3b78e19 100644 --- a/src/rm.c +++ b/src/rm.c @@ -63,7 +63,6 @@ enum interactive_type static struct option const long_opts[] = { - {"directory", no_argument, NULL, 'd'}, {"force", no_argument, NULL, 'f'}, {"interactive", optional_argument, NULL, INTERACTIVE_OPTION}, @@ -222,17 +221,10 @@ main (int argc, char **argv) /* Try to disable the ability to unlink a directory. */ priv_set_remove_linkdir (); - while ((c = getopt_long (argc, argv, "dfirvIR", long_opts, NULL)) != -1) + while ((c = getopt_long (argc, argv, "firvIR", long_opts, NULL)) != -1) { switch (c) { - case 'd': - /* Ignore this option, for backward compatibility with - coreutils 5.92. FIXME: Some time after 2005, change this - to report an error (or perhaps behave like FreeBSD does) - instead of ignoring the option. */ - break; - case 'f': x.interactive = RMI_NEVER; x.ignore_missing_files = true; -- 1.7.2.3 From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 17 05:11:12 2010 Received: (at 6402) by debbugs.gnu.org; 17 Sep 2010 09:11:12 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwWyO-0007Ty-Lt for submit@debbugs.gnu.org; Fri, 17 Sep 2010 05:11:12 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwWyM-0007Ts-Ie for 6402@debbugs.gnu.org; Fri, 17 Sep 2010 05:11:12 -0400 Received: from mx.meyering.net (unknown [82.230.74.64]) by smtp1-g21.free.fr (Postfix) with ESMTP id 1B23294018A for <6402@debbugs.gnu.org>; Fri, 17 Sep 2010 11:13:26 +0200 (CEST) Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id E9889DB64; Fri, 17 Sep 2010 11:13:25 +0200 (CEST) From: Jim Meyering To: Eric Blake Subject: Re: bug#6402: [PATCH] rm: remove no-op -d option In-Reply-To: <1284659674-19481-1-git-send-email-eblake@redhat.com> (Eric Blake's message of "Thu, 16 Sep 2010 11:54:34 -0600") References: <4C914765.8070204@redhat.com> <1284659674-19481-1-git-send-email-eblake@redhat.com> Date: Fri, 17 Sep 2010 11:13:25 +0200 Message-ID: <8762y4ybpm.fsf@meyering.net> Lines: 21 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 6402 Cc: 6402@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) Eric Blake wrote: > * src/rm.c (long_opts, main): Resolve a fixme. > * NEWS: Document the change. > Based on a report by William Plusnick. > --- > > Jim, what do you think of this alternative patch, which avoids the > issue of a new translation string by instead letting getopt parsing > reject -d like any other unknown option? I like it. Thank you. ... > --- a/NEWS ... > + rm -d now issues an error rather than being silently ignored. How about a slight change in wording to make clear that the entire "rm" command was not being ignored. rm's -d now evokes an error; before, it was silently ignored. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 17 10:44:01 2010 Received: (at 6402) by debbugs.gnu.org; 17 Sep 2010 14:44:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwcAT-0001zW-8U for submit@debbugs.gnu.org; Fri, 17 Sep 2010 10:44:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwcAP-0001zP-LS for 6402@debbugs.gnu.org; Fri, 17 Sep 2010 10:43:59 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8HEkJwT007392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 17 Sep 2010 10:46:19 -0400 Received: from [10.3.113.81] (ovpn-113-81.phx2.redhat.com [10.3.113.81]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8HEkItv022243; Fri, 17 Sep 2010 10:46:18 -0400 Message-ID: <4C937F3A.4020603@redhat.com> Date: Fri, 17 Sep 2010 08:46:18 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100907 Fedora/3.1.3-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.3 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#6402: [PATCH] rm: remove no-op -d option References: <4C914765.8070204@redhat.com> <1284659674-19481-1-git-send-email-eblake@redhat.com> <8762y4ybpm.fsf@meyering.net> In-Reply-To: <8762y4ybpm.fsf@meyering.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -10.1 (----------) X-Debbugs-Envelope-To: 6402 Cc: 6402@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.1 (----------) On 09/17/2010 03:13 AM, Jim Meyering wrote: >> Jim, what do you think of this alternative patch, which avoids the >> issue of a new translation string by instead letting getopt parsing >> reject -d like any other unknown option? > > I like it. Thank you. > > ... >> --- a/NEWS > ... >> + rm -d now issues an error rather than being silently ignored. > > How about a slight change in wording to make clear > that the entire "rm" command was not being ignored. > > rm's -d now evokes an error; before, it was silently ignored. Pushed with that change. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 17 05:01:33 2011 Received: (at 6402-done) by debbugs.gnu.org; 17 Apr 2011 09:01:33 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBNrJ-0001Dc-5S for submit@debbugs.gnu.org; Sun, 17 Apr 2011 05:01:33 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QBNrH-0001DR-PG for 6402-done@debbugs.gnu.org; Sun, 17 Apr 2011 05:01:32 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 4B4286012A; Sun, 17 Apr 2011 11:01:26 +0200 (CEST) From: Jim Meyering To: 6402-done@debbugs.gnu.org Subject: Re: bug#6402: [PATCH] rm: remove no-op -d option In-Reply-To: <4C937F3A.4020603@redhat.com> (Eric Blake's message of "Fri, 17 Sep 2010 08:46:18 -0600") References: <4C914765.8070204@redhat.com> <1284659674-19481-1-git-send-email-eblake@redhat.com> <8762y4ybpm.fsf@meyering.net> <4C937F3A.4020603@redhat.com> Date: Sun, 17 Apr 2011 11:01:26 +0200 Message-ID: <87pqolckux.fsf@rho.meyering.net> Lines: 21 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: 6402-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Eric Blake wrote: > On 09/17/2010 03:13 AM, Jim Meyering wrote: >>> Jim, what do you think of this alternative patch, which avoids the >>> issue of a new translation string by instead letting getopt parsing >>> reject -d like any other unknown option? >> >> I like it. Thank you. >> >> ... >>> --- a/NEWS >> ... >>> + rm -d now issues an error rather than being silently ignored. >> >> How about a slight change in wording to make clear >> that the entire "rm" command was not being ignored. >> >> rm's -d now evokes an error; before, it was silently ignored. > > Pushed with that change. Closing. From unknown Wed Jun 18 22:58:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 15 May 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator