NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/51062: Allow non numeric sections to be indexed and searched by apropos(1)
The following reply was made to PR bin/51062; it has been noted by GNATS.
From: Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
To: Christos Zoulas <christos%zoulas.com@localhost>
Cc: NetBSD GNATS <gnats-bugs%netbsd.org@localhost>, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/51062: Allow non numeric sections to be indexed and searched
by apropos(1)
Date: Wed, 13 Apr 2016 11:55:55 +0530
--001a113d1980ac3ad4053057d91c
Content-Type: text/plain; charset=UTF-8
On Wed, Apr 13, 2016 at 7:15 AM, Christos Zoulas <christos%zoulas.com@localhost> wrote:
> On Apr 12, 3:40pm, er.abhinav.upadhyay%gmail.com@localhost (er.abhinav.upadhyay%gmail.com@localhost) wrote:
> -- Subject: bin/51062: Allow non numeric sections to be indexed and searched
>
> | >Number: 51062
> | >Category: bin
> | >Synopsis: Allow non numeric sections to be indexed and searched by apropos(1)
> | >Confidential: no
> | >Severity: non-critical
> | >Priority: medium
> | >Responsible: bin-bug-people
> | >State: open
> | >Class: sw-bug
> | >Submitter-Id: net
> | >Arrival-Date: Tue Apr 12 15:40:00 +0000 2016
> | >Originator: Abhinav Upadhyay
> | >Release: CURRENT
> | >Organization:
> | >Environment:
> | >Description:
> | Apropos(1) doesn't allow searching for man pages in non-numeric sections. Also, makemandb(8) indexes only the first character of the section number and drops everything else.
> |
> |
> | The attached patch fixes both the problems. It also includes changes for tickets bin/51038, bin/51039, and bin/51040.
> |
> | I can probably send a smaller patch if there is no interest in the aforementioned patches :)
> | >How-To-Repeat:
> | apropos -s 9lua systm
> |
>
> Please don't mix other patches together. Resubmit just the relevant change,
Hi Christos,
Thanks for committing the other patches. I have updated the patch and
attached with the email.
--001a113d1980ac3ad4053057d91c
Content-Type: text/x-patch; charset=US-ASCII; name="apropos_sections.patch"
Content-Disposition: attachment; filename="apropos_sections.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_imyh2npm0
SW5kZXg6IGFwcm9wb3MtdXRpbHMuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9zcmMv
dXNyLnNiaW4vbWFrZW1hbmRiL2Fwcm9wb3MtdXRpbHMuYyx2CnJldHJpZXZpbmcgcmV2aXNpb24g
MS4yMwpkaWZmIC11IC1yMS4yMyBhcHJvcG9zLXV0aWxzLmMKLS0tIGFwcm9wb3MtdXRpbHMuYwkx
MyBBcHIgMjAxNiAwMTozNzo1MCAtMDAwMAkxLjIzCisrKyBhcHJvcG9zLXV0aWxzLmMJMTMgQXBy
IDIwMTYgMDY6MDI6MjAgLTAwMDAKQEAgLTQ3NCw3ICs0NzQsNyBAQAogfQogCiAvKgotICogIHJ1
bl9xdWVyeSAtLQorICogIHJ1bl9xdWVyeV9pbnRlcm5hbCAtLQogICogIFBlcmZvcm1zIHRoZSBz
ZWFyY2hlcyBmb3IgdGhlIGtleXdvcmRzIGVudGVyZWQgYnkgdGhlIHVzZXIuCiAgKiAgVGhlIDJu
ZCBwYXJhbTogc25pcHBldF9hcmdzIGlzIGFuIGFycmF5IG9mIHN0cmluZ3MgcHJvdmlkaW5nIHZh
bHVlcyBmb3IgdGhlCiAgKiAgbGFzdCB0aHJlZSBwYXJhbWV0ZXJzIHRvIHRoZSBzbmlwcGV0IGZ1
bmN0aW9uIG9mIHNxbGl0ZS4gKExvb2sgYXQgdGhlIGRvY3MpLgpAQCAtNTI1LDE1ICs1MjUsMjAg
QEAKIAkgKiAyLiBJIGFtIHVzaW5nIExJS0Ugb3BlcmF0b3IgYmVjYXVzZSAnPScgb3IgSU4gb3Bl
cmF0b3JzIGRvIG5vdCBzZWVtIHRvIGJlCiAJICogd29ya2luZyB3aXRoIHRoZSBjb21wcmVzc2lv
biBvcH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