Your message dated Sat, 24 Jun 2017 16:09:45 -0700
with message-id <87podt2dae....@hope.eyrie.org>
and subject line Re: Bug#639663: [debian-policy] Please provide 
upgrading-checklist via web
has caused the Debian Bug report #639663,
regarding upgrading-checklist on www.debian.org, links from it to debian-policy
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
639663: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=639663
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: debian-policy
Severity: wishlist

Hi.

It would be useful to have a copy of the HTML version of
upgrading-checklist somewhere on the web. This could, for example, be
linked from the PTS when some package's Standards-Version has to be
upgraded.

In #485085 the problem of the links from upgrading-checklist to the
policy has been discussed, but not solved. I've come up with a pair of
hacks that should do the trick (although they don't qualify as
"solution" at all). I'm attaching them in case you're interested.

You have to do something like that:

$ ./build_section_mapping.sh <
/usr/share/doc/debian-policy/policy-1.html > sect_map
$ ./patch_checklist.py <
/usr/share/doc/debian-policy/upgrading-checklist-1.html >
upgrading-checklist-1-links.html

You'll probably want also want to change paths in patch_checklist.py.

Also, to usefully link upgrading-checklist from other services, it would
be helpful to have section anchors named with the relevant policy
version number instead of section number (otherwise some other hack like
build_section_mappings.sh should be used).

Thanks, Giovanni.
-- 
Giovanni Mascellani <mascell...@poisson.phc.unipi.it>
Pisa, Italy

Web: http://poisson.phc.unipi.it/~mascellani
Jabber: g.mascell...@jabber.org / giova...@elabor.homelinux.org

Attachment: build_section_mapping.sh
Description: Bourne shell script

#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys, re

POLICY_URL = 'file:///usr/share/doc/debian-policy/policy-1.html'
SECT_MAP_FILE = './sect_map'

dt_re = re.compile('^<dt>(.*)</dt>$')
dt_template = '<dt>%s</dt>\n'

sect_map = {}

def build_sect_map():
    with open(SECT_MAP_FILE) as sect_map_file:
        for line in sect_map_file:
            sect, anchor = line.strip().split(' ', 1)
            sect_map[sect] = anchor

def make_line(sect):
    if sect in sect_map:
        return '<a href="%s#%s">%s</a>' % (POLICY_URL, sect_map[sect], sect)
    else:
        return sect

def main():
    build_sect_map()

    for line in sys.stdin:
        match = dt_re.match(line)
        if match is not None:
            line = dt_template % ', '.join([make_line(x.strip()) for x in match.group(1).split(',')])
        sys.stdout.write(line)

if __name__ == '__main__':
    main()

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
Version: 4.0.0.0

This was made available on the web some time ago, and the remaining work
of making the upgrading checklist an appendix of Policy was done by
Guillem as part of the DocBook conversion.

-- 
Russ Allbery (r...@debian.org)               <http://www.eyrie.org/~eagle/>

--- End Message ---

Reply via email to