Opened 10 years ago

Closed 7 years ago

Last modified 7 years ago

#3376 closed enhancement (fixed)

Rewrite lgrep and hgrep scripts to be included into Haiku as optional package (easy)

Reported by: monni Owned by: scottmc
Priority: normal Milestone: Unscheduled
Component: Applications/Command Line Tools Version: R1/alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

BeOS wannabes used to have lgrep and hgrep scripts to assist finding functions in libraries. I want them in Haiku too...

Attachments (2)

lgrep (859 bytes) - added by monni 10 years ago.
Library Grep - lgrep
hgrep (75 bytes) - added by monni 10 years ago.
Header Grep - hgrep

Download all attachments as: .zip

Change History (20)

Changed 10 years ago by monni

Attachment: lgrep added

Library Grep - lgrep

Changed 10 years ago by monni

Attachment: hgrep added

Header Grep - hgrep

comment:1 Changed 10 years ago by monni

Component: ApplicationsApplications/Command Line Tools

comment:2 Changed 10 years ago by axeld

We could put it into the optional development package, but they shouldn't be part of the base install.

comment:3 Changed 10 years ago by axeld

Summary: [easy] I want this and that added to Haiku ;)add lgrep and hgrep to Haiku

Oh, and please use more descriptive summaries in the future :-)

comment:4 in reply to:  2 Changed 10 years ago by monni

Replying to axeld:

We could put it into the optional development package, but they shouldn't be part of the base install.

Agree with that.

BTW, I didn't make more descriptive summary back then because I wasn't sure if there was something else missing that could also help new developers resolve errors when configuring and building third-party software, and making new ticket for each enhancement didn't sound such a good idea either.

comment:5 Changed 10 years ago by scottmc

Owner: changed from axeld to scottmc
Status: newassigned
Summary: add lgrep and hgrep to HaikuCreate OptionalPackage for adding lgrep and hgrep to Haiku

Seems easy enough to do.

comment:6 Changed 10 years ago by scottmc

@monni, Where did the hgrep and lgrep you attached to this ticket comes from, as in who was the original author?

comment:7 Changed 10 years ago by monni

As far as I remember, those were originally posted by one BeShare user to be used as bash macros. I fixed a few compatibility issues in them and rewrote them as standalone shell scripts.

comment:8 Changed 10 years ago by monni

I'm pretty sure mmu_man was the original author.

comment:9 Changed 10 years ago by mmu_man

AFAIR I did found the commands used in hgrep somewhere and adapted it and named it hgrep. I definitely came up with something called lgrep in ZETA, but it was more simple than the attached one. Both were declared as functions in /etc/profile.d/devaliases. In any case it's probably ok to just rewrite them.

comment:10 Changed 9 years ago by scottmc

Version: R1/pre-alpha1R1/alpha1

comment:11 Changed 9 years ago by scottmc

Milestone: R1Unscheduled
Summary: Create OptionalPackage for adding lgrep and hgrep to HaikuRewrite lgrep and hgrep scripts to be included into Haiku as optional package (easy)

Since this was not in BeOS R5 be default, I see no need to have it as part of the R1 milestone, so pushing it out to Unscheduled. Since the origin of these scripts is not clear we should rewrite them. If someone wants to rewrite these two scripts and attach them to this ticket, be sure to include proper credits this time, I will then create an optionalpackage for them.

comment:12 Changed 9 years ago by monni

I don't see how people could "rewrite" them more than I did after I got them in BeShare... Like mmu_man said, those were originally defined as functions. My original idea was to make them separate shell scripts so I could use same copy on shared partition in several different BeOS installations on same machine and to ease sharing the "modified" scripts back in BeShare.

comment:13 Changed 8 years ago by leavengood

These don't need to be rewritten. For one thing hgrep is just 2 lines (one of which is the usual #!/bin/sh call.) We can add a comment acknowledging monni and mmu_man as authors, with the usual Haiku copyright and MIT license note. If someone comes along and complains then they can be rewritten but that is never going to happen.

Scott: if you could do that I think that would be fine. I'm not sure they deserve a whole optional package though. Is there already a collection of development utilities these could be added to?

comment:14 Changed 8 years ago by scottmc

added these to haikuports repo for now:
http://www.ports.haiku-files.org/changeset/1679/
Further updates to them can be done there.

comment:15 Changed 7 years ago by scottmc

Resolution: fixed
Status: in-progressclosed

Added as OptionalPackages in hrev44393

comment:16 Changed 7 years ago by umccullough

Not sure you tested the hgrep after you added it to haikuports - at least the finddir path has been misspelled:

http://ports.haiku-files.org/browser/haikuports/trunk/sys-apps/hgrep/hgrep

Might want to fix that before adding it to the official image.

comment:17 Changed 7 years ago by scottmc

Actually missed a closing ) as well... should be ok now in hrev44396.

comment:18 Changed 7 years ago by Disreali

What is the reason to have these as optional packages? They are so small it would just be easier to add them to the base image and avoid the bandwidth usage or need to download.

Note: See TracTickets for help on using tickets.