From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1I7CPA-0003Wr-LK for garchives@archives.gentoo.org; Sat, 07 Jul 2007 15:41:05 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l67Fcl71024755; Sat, 7 Jul 2007 15:38:47 GMT Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l67FUXOt013634 for ; Sat, 7 Jul 2007 15:30:33 GMT Received: by an-out-0708.google.com with SMTP id c8so102869ana for ; Sat, 07 Jul 2007 08:30:32 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=nM8Nyj0BRhpAmWR0XzILO0SVlu3I6vky9TnhNuWQVh0NkdtbYwigdQge0sH5bJ6oSCFEyRuqAU67vibv2QUhkOEmpihuqHMyHELLD6qxARrmU1eKIq9WBcbfWZcGCnaKv2hJJml9gBpITeniB3hRoX9kiXFzB3eJISVR/gSrtM0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ccR6ahxwtgyDYhM9pc9ueD6JXPxwEDOLl+1Sq7utUw0O+j1M8HJBS96yKffzlBML6IdlZT8QLNiX/M7o9lHAFzFyGmjJ+hFKI8tp5QtZKNcd9o2qe+qxwkaEMhehNWzPAtADzeyHCCNRVDSFxzuPMgCrXHYw8xW9wCOTDD3DF9k= Received: by 10.100.173.19 with SMTP id v19mr840015ane.1183822232526; Sat, 07 Jul 2007 08:30:32 -0700 (PDT) Received: by 10.100.37.16 with HTTP; Sat, 7 Jul 2007 08:30:32 -0700 (PDT) Message-ID: <9acccfe50707070830gc5f5dabiae06c55c107abd40@mail.gmail.com> Date: Sat, 7 Jul 2007 08:30:32 -0700 From: "Kevin O'Gorman" To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Index to /usr/share/doc/...html... a reinvented wheel? In-Reply-To: <20070707003153.7f6710ab@localhost> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_182906_27274393.1183822232249" References: <9acccfe50707031519w73abc638qb001cc5e9bb64d88@mail.gmail.com> <20070707003153.7f6710ab@localhost> X-Archives-Salt: 0efcf397-750e-42a6-831d-082724ec201f X-Archives-Hash: f756ac442db4b2e80746872a600dae3f ------=_Part_182906_27274393.1183822232249 Content-Type: multipart/alternative; boundary="----=_Part_182907_13634115.1183822232249" ------=_Part_182907_13634115.1183822232249 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/6/07, Paul Gibbons wrote: > > On Tue, 3 Jul 2007 15:19:14 -0700 > "Kevin O'Gorman" wrote: > > > I emerge with the doc USE flag and generally have a bunch of stuff in > > /usr/share/doc. Most of the time it's the HTML stuff I want to read, > > but it's a annoyingly laborious to wade through unindexed > > directgories and get a browser pointing to the right thing. So I > > wrote a little Perl script to create a top-level "index.html", > > organized by package and with a bit of rudimentary pruning. I > > bookmarked it in Firefox, and can get to things a lot faster now. I > > like the result, and will continue to tweak it here and there. > > > > Did I just reinvent a wheel? If not, is there any point it trying to > > make this part of gentoo? If so, how would one do that? > > > > Current script attached. > > > Thanks for the script - it seems to create the index file fine. > However the index.html files are only readable by root. > Is there a treat when running emerge to ensure files are readable by > others? That's an artifact of your umask. I run root with a umask of 022, so I didn't notice the problem. You can add the line umask(0133); to the script (before the open call) to get a sensible 0644 (rw-r--r--) mode. As I've also modified the sorting of entries on each line, in an attempt to make each index.html come first in its directory, I've attached my latest copy to this email. -- Kevin O'Gorman, PhD ------=_Part_182907_13634115.1183822232249 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/6/07, Paul Gibbons <paul@pkami.e7even.com> wrote:
On Tue, 3 Jul 2007 15:19:14 -0700
"Kevin O'Gorman" <kogorman@gmail.com> wrote:

> I emerge with the doc USE flag and generally have a bunch of stuff in
> /usr/share/doc.  Most of the time it's the HTML stuff I want to read,
> but it's a annoyingly laborious to wade through unindexed
> directgories and get a browser pointing to the right thing.  So I
> wrote a little Perl script to create a top-level "index.html",
> organized by package and with a bit of rudimentary pruning.  I
> bookmarked it in Firefox, and can get to things a lot faster now.  I
> like the result, and will continue to tweak it here and there.
>
> Did I just reinvent a wheel? If not, is there any point it trying to
> make this part of gentoo?  If so, how would one do that?
>
> Current script attached.
>
Thanks for the script - it seems to create the index file fine.
However the index.html files are only readable by root.
Is there a treat when running emerge to ensure files are readable by
others?

That's an artifact of your umask.  I run root with a umask of 022, so I didn't notice the problem.

You can add the line
    umask(0133);
to the script (before the open call) to get a sensible 0644 (rw-r--r--) mode.

As I've also modified the sorting of entries on each line, in an attempt to make each index.html come first in its directory, I've attached my latest copy to this email.

--
Kevin O'Gorman, PhD
------=_Part_182907_13634115.1183822232249-- ------=_Part_182906_27274393.1183822232249 Content-Type: application/octet-stream; name="makeindex.perl" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="makeindex.perl" X-Attachment-Id: f_f3u960uw IyEvdXNyL2Jpbi9wZXJsIC13CiMgQ3JlYXRlIGFuIGluZGV4IG9mIGFsbCBpbmRleCBmaWxlcy4g IERvIG5vdCBpbmRleCBzdWItaW5kZXhlcy4KCiRSQ1NJRCA9IDw8J0VPRic7CiRJZDogbWFrZWlu ZGV4LnBlcmwsdiAxLjEgMjAwNy8wNy8wNyAxNToyODo0NSByb290IFJlbGVhc2Ugcm9vdCAkCkVP RgpjaG9tcCAkUkNTSUQ7CgokREVCVUc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cmUgcGFja2FnZSBuYW1lcwoJaWYgKCRwMiBuZSAk cDEpIHsKCSAgICBpZiAoJHAxKSB7IHByaW50ICJcbiI7IH0KCSAgICBwcmludCAiICAgPGxpPjxw PiRwMjogIjsKCSAgICAkcDEgPSAkcDI7Cgl9CglpZiAoISBkZWZpbmVkICRsaW5rc3skaX0pIHsK CSAgICBwcmludCAiICZuYnNwOyA8YSBocmVmPVwiJGlcIj4kaTwvYT4iOwoJfSBlbHNpZiAoJERF QlVHKSB7CgkgICAgcHJpbnQgIiA8ZXhjbHVkZWQgYnkgJGxpbmtzeyRpfT5cbiI7Cgl9CiAgICB9 CiAgICBwcmludCAiXG4iOwpwcmludCAiPC91bD5cbiI7CnByaW50ICI8L2JvZHk+XG4iOwo= ------=_Part_182906_27274393.1183822232249-- -- gentoo-user@gentoo.org mailing list