touch refuses to accept -d option
Denys Vlasenko
vda.linux at googlemail.com
Wed Dec 1 12:08:04 UTC 2010
On Wed, Dec 1, 2010 at 11:26 AM, David Collier
<from_busybox_maillist at dexdyne.com> wrote:
>> opts = getopt32(argv, "c" IF_DESKTOP("r:d:t:")
>>
>> option "t" needs ENABLE_DESKTOP to be set in config.
>
> Oh FHS :-)
>
> what has "desktop" got to do with what options touch accepts?
DESKTOP is a blanket option "I want maximum compatibility
with Linux distributions' standard tools, I don't mind
if it makes bbox 5k bigger".
> OK - my system is not not not a desktop. It's a buried box that will run
> headless.
> I could just go and turn the "desktop" option on, but what other baggage
> will it change - and would it matter to me?
You can grep for DESKTOP. You can build with DESKTOP on and off
and compare resulting binaries with "size".
> I'm not worried about the
> size of the executable - I have 256M of disk and 32M of RAM.
Then you can select it without ill effects.
> I have edited touch.c and conned it into believing it's running on a
> desktop - my touch command now accepts -d - so thanks for the help.
>
> I note that touch actually accepts r, and t options, which are not
> covered in the usage info.
Then you perhaps also saw the comment:
/* -d and -t both set time. In coreutils,
* accepted data format differs a bit between -d and -t.
* We accept the same formats for both */
Why help text should waste space showing -t DT when
-d DT, which is shown, is exactly the same thing?
-r *is* documented in the latest released version.
> 1. Can I "appeal" that the -d option on touch is useful even on
> non-desktop system and it should be "enabled on all versions". How do I
> go about such a thing?
No. Some people do want minimal size.
You can create a new option, say, CONFIG_FEATURE_FANCY_TOUCH
(just like echo, tail, sleep do it), which enables extra options
for touch without affecting other applets. It's an easy patch.
> 2. I guess if the answer's no, I should submit a patch for usage.src.h
No need, I already fixed it:
http://git.busybox.net/busybox/commit/?id=3f2477e8a89ddadd1dfdd9d990ac8c6fdb8ad4b3
> Is there a howto - I guess I would be best with a proper CVS approach,
> which I could set up here, but is there a way to diff my file against the
> repository in some other way??
busybox project works with patches just the same way any other
open source project. You need to download the current development
tree:
git clone git://busybox.net/busybox.git
edit it, build, test, repeat until it works, diff the changed tree
against the original, then send the patch to the list.
--
vda
More information about the busybox
mailing list