<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 23, 2017 at 3:34 AM, Holger Levsen <span dir="ltr"><<a href="mailto:holger@layer-acht.org" target="_blank">holger@layer-acht.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Michael,<br>
<br>
are you subscribed to this bug or do you need cc:s?<br></blockquote><div><br></div><div>I’m not subscribed, so please keep me cc'ed :).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
On Sun, May 21, 2017 at 06:43:54PM +0200, Michael Stapelberg wrote:<br>
> This is in relation to <a href="https://bugs.debian.org/850917" rel="noreferrer" target="_blank">https://bugs.debian.org/850917</a><wbr>, where we added<br>
> code to log update-alternatives calls.<br>
><br>
> Now that the calls are logged, we need to somehow make Debiman aware<br>
> of the calls. To that end, I wrote a program which will read all<br>
> available logs, parse all LOG-ALTERNATIVES lines, and generate a JSON<br>
> file with the links created by the various binary packages.<br>
<br>
thanks for the nice summary and proposal!<br>
<br>
> Find the source of that program at<br>
> <a href="https://github.com/Debian/debiman/blob/b4d79f84b34abfc59effcd85c78541ce8f572b4b/cmd/debiman-piuparts-distill/piuparts.go" rel="noreferrer" target="_blank">https://github.com/Debian/<wbr>debiman/blob/<wbr>b4d79f84b34abfc59effcd85c78541<wbr>ce8f572b4b/cmd/debiman-<wbr>piuparts-distill/piuparts.go</a><br>
<br>
looks simple and clean enough!<br>
<br>
> I then ran the program like so on <a href="http://piuparts.debian.org" rel="noreferrer" target="_blank">piuparts.debian.org</a>:<br>
<br>
/me really likes that pejacevic is developer accessable! ;)<br>
<br>
> % debiman-piuparts-distill \<br>
>     -logs_dir=/srv/<a href="http://piuparts.debian.org/htdocs/stretch" rel="noreferrer" target="_blank">piuparts.<wbr>debian.org/htdocs/stretch</a> \<br>
>     -output=debiman/testing.json.<wbr>gz<br>
><br>
> % debiman-piuparts-distill \<br>
>   -logs_dir=/srv/<a href="http://piuparts.debian.org/htdocs/sid" rel="noreferrer" target="_blank">piuparts.<wbr>debian.org/htdocs/sid</a> \<br>
>   -output=debiman/unstable.json.<wbr>gz<br>
><br>
> % debiman-piuparts-distill \<br>
>   -logs_dir=/srv/<a href="http://piuparts.debian.org/htdocs/experimental" rel="noreferrer" target="_blank">piuparts.<wbr>debian.org/htdocs/experimental</a> \<br>
>   -output=debiman/experimental.<wbr>json.gz<br>
><br>
> % debiman-piuparts-distill \<br>
>   -logs_dir=/srv/<a href="http://piuparts.debian.org/htdocs/jessie" rel="noreferrer" target="_blank">piuparts.<wbr>debian.org/htdocs/jessie</a> \<br>
>   -output=debiman/stable.json.gz<br>
<br>
ok, so only parsing 4 suites… how long did these commands run?<br></blockquote><div><br></div><div>294,21s user 212,64s system 30% cpu 27:36,09 total<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> I then copied debiman/*.json.gz over to <a href="http://manziarly.debian.org" rel="noreferrer" target="_blank">manziarly.debian.org</a>,<br>
> re-generated the entire site, and slave alternative manpages now work<br>
> as expected :).<br>
<br>
hehe, nice! got an example?<br></blockquote><div><br></div><div>Sure:</div><div><a href="https://manpages.debian.org/unstable/postgresql-client-9.6/pg_dump.1.en.html">https://manpages.debian.org/unstable/postgresql-client-9.6/pg_dump.1.en.html</a><br></div><div><a href="https://manpages.debian.org/unstable/vis/vi.1.en.html">https://manpages.debian.org/unstable/vis/vi.1.en.html</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Obviously, the above was a one-off manual effort, so now we should<br>
> discuss how we’d like to set things up for a more permanent export.<br>
<br>
sure!<br>
<br>
> Here’s a strawman proposal. We could:<br>
><br>
> 1. Add a crontab entry, which triggers a shell script, which will<br>
>    update debiman-piuparts-distill, then run it on the logs<br>
>    directories.<br>
<br>
sounds good, how often would you like to run it?<br></blockquote><div><br></div><div>Once a day would be sufficient, I think.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> 2. Store the resulting *.json.gz files in a directory called<br>
>    /srv/<a href="http://piuparts.debian.org/htdocs/for-manpages.d.o" rel="noreferrer" target="_blank">piuparts.debian.org/<wbr>htdocs/for-manpages.d.o</a><br>
<br>
I don't really like the "for-manpages.d.o" directory name, but cannot think<br>
of a better one either, so…<br>
<br>
> 3. Download the files via HTTPS on manziarly.d.o.<br>
<br>
great, so only step 1+2 are on the piuparts side :)<br>
<br>
> Step ① requires installing the Go compiler<br>
> (<a href="https://packages.debian.org/stretch/golang-go" rel="noreferrer" target="_blank">https://packages.debian.org/<wbr>stretch/golang-go</a>) on piuparts.d.o. We<br>
> could avoid this if we’re all okay with just copying the<br>
> debiman-piuparts-distill binary onto piuparts.d.o, but referring to<br>
> e.g. /home/stapelberg/debiman-<wbr>piuparts-distill from a cronjob within<br>
> the piuparts git repository feels somewhat unclean.<br>
<br>
nah, installing golang-go from jessie or jessie-backports is easy, it<br>
just needs a patch for <a href="http://git.debian.org/git/mirror/debian.org.git" rel="noreferrer" target="_blank">git.debian.org/git/mirror/<wbr>debian.org.git</a> for the files<br>
debian/control and debian/changelog and a mail to admin@rt.d.o with the<br>
subject "Debian RT: .*" to generate a ticket… which golang-go version do<br>
you want?<br></blockquote><div><br></div><div>Since piuparts.d.o is running on jessie, we’ll need to use golang-go 1.7 from jessie-backports, please :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> Any thoughts? Would you be okay with my strawman? If so, I’ll prepare<br>
> a patch.<br>
<br>
Yup, seems very fine to me! Please do!<br></blockquote><div><br></div><div>Great. Find a patch attached. Note that it’s untested, as golang-go is not yet installed and I lack permission to run as piupartsm. I’m not sure what your development process is for changes like this, but feel free to fix up the patch as necessary.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
cmd/debiman-piuparts-distill/<wbr>piuparts.go also could use a comments in main()<br>
and explaining the purpose of the various functions ;-) I was just giving it<br>
a 2nd look after wanting to ask you to explain it/go-basics to me the next<br>
time we met but then thought I should first try to understand it myself ;-)<br>
And then I noticed some more comments explaining/introducing the purpose<br>
of the following code lines would be nice…<br></blockquote><div><br></div><div>Sure. I’ll add some commentary, and I’m also happy to explain any details — just ask.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I suppose cmd/debiman-piuparts-distill/<wbr>piuparts.go should live in master-bin<br>
in piuparts.git or what would you propose? I don't think we wanna compile it<br>
when building the piuparts-master package (for the Debian archive) but rather<br>
only build it when installing on pejacevic…<br></blockquote><div><br></div><div>It could continue living in <a href="http://github.com/Debian/debiman">github.com/Debian/debiman</a>, or we could move it to piuparts. The advantage of keeping it in <a href="http://github.com/Debian/debiman">github.com/Debian/debiman</a> is that we don’t need to duplicate code between different git repositories. Installing/updating the command is as simple as running “go get -u <a href="http://github.com/Debian/debiman/cmd/debiman-piuparts-distill">github.com/Debian/debiman/cmd/debiman-piuparts-distill</a>”.</div></div><div><br></div>-- <br><div class="gmail_signature">Best regards,<br>Michael</div>
</div></div>