lincredits-0.7+nmu1/0000775000000000000000000000000011523645533011273 5ustar lincredits-0.7+nmu1/lincredits0000775000000000000000000003257010472362143013363 0ustar #!/usr/bin/python # # lincredits -- Beautify the Linux CREDITS file in various formats # Written by Chris Lawrence # (C) 1999-2002 Chris Lawrence # # This program is freely distributable per the following license: # ## Permission to use, copy, modify, and distribute this software and its ## documentation for any purpose and without fee is hereby granted, ## provided that the above copyright notice appear in all copies and that ## both that copyright notice and this permission notice appear in ## supporting documentation. ## ## I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I ## BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY ## DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ## WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ## SOFTWARE. # # Version 0.4: 12 January 1999 # # TODO: Add support for the MAINTAINERS file format # [Unfortunately the S tag means different things in the two formats, # and each block starts with a line with no header] import sys, string, getopt, re def parseblock(lines): creditinfo = {} creditline = re.compile(r':\s+') for line in lines: dat = creditline.split(line, 1) # Skip improperly formatted headers if len(dat) < 2: continue (type, data) = dat if type == 'N': creditinfo['name'] = data elif type in ('E', 'M'): creditinfo['email'] = creditinfo.get('email', []) + [data] elif type == 'P': creditinfo['pgp'] = creditinfo.get('pgp', []) + [data] elif type == 'W': creditinfo['url'] = creditinfo.get('url', []) + [data] elif type == 'D': creditinfo['desc'] = creditinfo.get('desc', []) + [data] elif type == 'S': creditinfo['mail'] = creditinfo.get('mail', []) + [data] else: print 'Warning: Unknown CREDITS header:', type return creditinfo def parse(file): lines = file.readlines() nameline = re.compile('N:') linebuff = [] peoplelist = [] people = {} for line in lines: if line[-1] == '\n': line = line[:-1] if nameline.match(line): linebuff = [line] elif linebuff and not line: info = parseblock(linebuff) if info.has_key('name'): people[info['name']] = info peoplelist.append(info['name']) else: print 'Warning: CREDITS entry without name:', info linebuff = [] elif linebuff: linebuff.append(line) if linebuff: # Flush any remaining data info = parseblock(linebuff) if info.has_key('name'): people[info['name']] = info peoplelist.append(info['name']) else: print 'Warning: CREDITS entry without name:', info return peoplelist, people def format_text(names, info, filename, outfile): outfile.write( 'CREDITS from %s\n\n' % filename ) for name in names: outfile.write(name) if info[name].has_key('email'): outfile.write(' <'+info[name]['email'][0]+'>:\n') bits = info[name]['email'][1:] if bits: outfile.write(' Alternate addresses:\n') for bit in bits: outfile.write(' <'+bit+'>\n') else: outfile.write(':\n') if info[name].has_key('url'): outfile.write(' Website:\n') bits = info[name]['url'] for bit in bits: outfile.write(' '+bit+'\n') if info[name].has_key('pgp'): outfile.write(' PGP key fingerprint:\n') bits = info[name]['pgp'] for bit in bits: outfile.write(' '+bit+'\n') if info[name].has_key('desc'): bits = info[name]['desc'] outfile.write(' Contributions:\n') for bit in bits: outfile.write(' '+bit+'\n') if info[name].has_key('mail'): bits = info[name]['mail'] outfile.write(' Physical address:\n') for bit in bits: outfile.write(' '+bit+'\n') outfile.write('\n') return def webify(str): str = string.replace(str, '<', '<') str = string.replace(str, '>', '>') str = string.replace(str, '"', '"') return str def make_email_link(addr): return '<%s>' % (addr, webify(addr)) def make_url_link(addr): return '%s' % (addr, webify(addr)) def format_html(names, info, filename, outfile): outfile.write('\n') outfile.write('CREDITS from %s\n' % webify(filename) ) outfile.write('\n\n
\n') for name in names: outfile.write('
'+webify(name)) if info[name].has_key('email'): outfile.write(' '+make_email_link(info[name]['email'][0])) outfile.write(':\n
\n') bits = info[name]['email'][1:] if bits: outfile.write('
Alternate addresses:\n
    \n') for bit in bits: outfile.write('
  • '+make_email_link(bit)+'\n') outfile.write('
\n') else: outfile.write(':\n
\n') if info[name].has_key('url'): outfile.write('
Website:\n
    \n') bits = info[name]['url'] for bit in bits: outfile.write('
  • '+make_url_link(bit)+'\n') outfile.write('
\n') if info[name].has_key('pgp'): outfile.write('
PGP key fingerprint:\n
    \n') bits = info[name]['pgp'] for bit in bits: outfile.write('
  • '+webify(bit)+'\n') outfile.write('
\n') if info[name].has_key('desc'): bits = info[name]['desc'] outfile.write('
Contributions:\n
    \n') for bit in bits: outfile.write('
  • '+webify(bit)+'\n') outfile.write('
\n') if info[name].has_key('mail'): bits = info[name]['mail'] outfile.write('
Physical address:\n
\n') for bit in bits: outfile.write(webify(bit)+'
\n') outfile.write('
\n') outfile.write('
\n\n') return # Swiped from running GNU recode -h texfix = [ "~", "!`", "", "\\pound{}", # 160-163 "", "", "", "\\S{}", # 164-167 "\\\"{}", # 168 "\\copyright{}", # 169 "", # 170 "``", # 171 "\\neg{}", # 172 "\\-", # 173 "", # 174 "", # 175 "\\mbox{$^\\circ$}", # 176 "\\mbox{$\\pm$}", # 177 "\\mbox{$^2$}", # 178 "\\mbox{$^3$}", # 179 "\\'{}", # 180 "\\mbox{$\\mu$}", # 181 "", # 182 "\\cdotp", # 183 "\\,{}", # 184 "\\mbox{$^1$}", # 185 "", # 186 "''", # 187 "\\frac1/4{}", # 188 "\\frac1/2{}", # 189 "\\frac3/4{}", # 190 "?`", # 191 "\\`A", # 192 "\\'A", # 193 "\\^A", # 194 "\\~A", # 195 "\\\"A", # 196 "\\AA{}", # 197 "\\AE{}", # 198 "\\c{C}", # 199 "\\`E", # 200 "\\'E", # 201 "\\^E", # 202 "\\\"E", # 203 "\\`I", # 204 "\\'I", # 205 "\\^I", # 206 "\\\"I", # 207 "", # 208 "\\~N", # 209 "\\`O", # 210 "\\'O", # 211 "\\^O", # 212 "\\~O", # 213 "\\\"O", # 214 "", # 215 "\\O{}", # 216 "\\`U", # 217 "\\'U", # 218 "\\^U", # 219 "\\\"U", # 220 "\\'Y", # 221 "", # 222 "\\ss{}", # 223 "\\`a", # 224 "\\'a", # 225 "\\^a", # 226 "\\~a", # 227 "\\\"a", # 228 "\\aa{}", # 229 "\\ae{}", # 230 "\\c{c}", # 231 "\\`e", # 232 "\\'e", # 233 "\\^e", # 234 "\\\"e", # 235 "\\`{\\i}", # 236 "\\'{\\i}", # 237 "\\^{\\i}", # 238 "\\\"{\\i}", # 239 "", # 240 "\\~n", # 241 "\\`o", # 242 "\\'o", # 243 "\\^o", # 244 "\\~o", # 245 "\\\"o", # 246 "", # 247 "\\o{}", # 248 "\\`u", # 249 "\\'u", # 250 "\\^u", # 251 "\\\"u", # 252 "\\'y", # 253 "", # 254 "\\\"y", # 255 ] def texify(text, href=False): for ch in '#$%&_{}': text = text.replace(ch, '\\'+ch) if href: return text text = text.replace('<', '$<$') text = text.replace('>', '$>$') text = text.replace('~', '\~{}') for i in range(160, 255): text = text.replace(chr(i), texfix[i-160]) return text def format_latex(names, info, filename, outfile): outfile.write('\\documentclass{article}\n') print >> outfile, '\\usepackage{hyperref}' outfile.write('\\title{CREDITS from %s}\n' % texify(filename)) outfile.write('\\author{Generated by \\texttt{lincredits}}\n') outfile.write('\\setlength{\parindent}{0in}\n') outfile.write('\\begin{document}\n\\maketitle\n') for name in names: if name == 'Jeff Garzik': print >> sys.stderr, repr(info[name]) thisinfo = info[name] outfile.write('\\begin{minipage}{\\textwidth}\n') outfile.write(texify(name)) keys = thisinfo.keys() madelist = False if 'email' in thisinfo: addr = thisinfo['email'][0] addr = texify(addr, href=True) print >> outfile, ' $<$\\href{mailto:%s}{%s}$>$:' % (addr, addr) bits = thisinfo['email'][1:] if bits: outfile.write('\\begin{list}{}{}\n') outfile.write('\\item Alternate addresses:\n') outfile.write('\\begin{itemize}\n') for bit in bits: bit = texify(bit, href=True) print >> outfile, '\\item $<$\\href{mailto:%s}{%s}$>$' % (bit, bit) outfile.write('\\end{itemize}\n') madelist=True elif len(keys) > 2: outfile.write('\\begin{list}{}{}\n') madelist=True elif len(keys) > 1: outfile.write(':\n\\begin{list}{}{}\n') madelist=True if thisinfo.has_key('url'): outfile.write('\\item Website:\n') outfile.write('\\begin{itemize}\n') bits = thisinfo['url'] for bit in bits: bit = texify(bit, href=True) print >> outfile, '\\item \url{%s}' % (bit) outfile.write('\\end{itemize}\n') if thisinfo.has_key('pgp'): outfile.write('\\item PGP key fingerprint:\n') outfile.write('\\begin{itemize}\n') bits = thisinfo['pgp'] for bit in bits: outfile.write('\\item \\texttt{'+texify(bit)+'}\n') outfile.write('\\end{itemize}\n') if thisinfo.has_key('desc'): bits = thisinfo['desc'] outfile.write('\\item Contributions:\n') outfile.write('\\begin{itemize}\n') for bit in bits: outfile.write('\\item '+texify(bit)+'\n') outfile.write('\\end{itemize}\n') if thisinfo.has_key('mail'): bits = thisinfo['mail'] outfile.write('\\item Physical address:\n') outfile.write('\\begin{list}{}{}\n') for bit in bits: outfile.write('\\item '+texify(bit)+'\n') outfile.write('\\end{list}\n') if madelist: outfile.write('\\end{list}\n') outfile.write('\\end{minipage}\n\n') outfile.write('\\vspace{\\baselineskip}\n') outfile.write('\\end{document}') return USAGE = ('lincredits: Parse the Linux CREDITS file\n\n' 'Usage: lincredits [options] \n' 'Supported options:\n' ' --text: Output as formatted text (default)\n' ' --html: Output as HTML formatted text\n' ' --latex: Output as LaTeX source\n' ' --output : Output to a file instead of standard output\n' ' --help: Show this help text\n' ) def main(): try: (opts, args) = getopt.getopt(sys.argv[1:], 'ho:', ['help', 'text', 'output=', 'latex', 'html']) except getopt.error, msg: print msg sys.exit(1) format = format_text out = "" for option, arg in opts: if option == '-h' or option == '--help': print USAGE return elif option == '--html': format = format_html elif option == '--latex': format = format_latex elif option == '--text': format = format_text elif option == '-o' or option == '--output': out = arg if len(args) != 1: print 'You must specify the CREDITS file to read.' sys.exit(1) if out: outfile = open(out, 'w') else: outfile = sys.stdout infile = open(args[0]) (names, info) = parse(infile) infile.close() format(names, info, args[0], outfile) if outfile != sys.stdout: outfile.close() return if __name__ == '__main__': main() lincredits-0.7+nmu1/debian/0000775000000000000000000000000012564661154012520 5ustar lincredits-0.7+nmu1/debian/pycompat0000664000000000000000000000000210472356237014266 0ustar 2 lincredits-0.7+nmu1/debian/control0000664000000000000000000000105312564661076014125 0ustar Source: lincredits Section: text Priority: optional Maintainer: Chris Lawrence Standards-Version: 3.9.1 Build-Depends: debhelper (>= 7), python-all, dh-python Package: lincredits Architecture: all Depends: ${python:Depends}, ${misc:Depends} XB-Python-Version: ${python:Versions} Suggests: texlive-base, www-browser, linux-source Description: Generate nicely-formatted versions of the Linux CREDITS file This small package allows anyone to create beautified versions of the Linux CREDITS file in plain text, LaTeX or HTML formats. lincredits-0.7+nmu1/debian/dirs0000664000000000000000000000001006766711130013370 0ustar usr/bin lincredits-0.7+nmu1/debian/rules0000775000000000000000000000277012564661111013577 0ustar #!/usr/bin/make -f # Made with the aid of dh_make, by Craig Small -*- makefile -*- # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. # Some lines taken from debmake, by Cristoph Lameter. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 build: build-stamp build-stamp: dh_testdir # Add here commands to compile the package. echo 'No make needed.' touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp install-stamp dh_clean install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_prep dh_installdirs # Add here commands to install the package into debian/lincredits. cp -p `pwd`/lincredits `pwd`/debian/lincredits/usr/bin touch install-stamp # Build architecture-dependent files here. binary-arch: build install # We have nothing to do by default. # Build architecture-independent files here. binary-indep: build install # dh_testversion -i dh_testdir -i dh_testroot -i dh_installdocs -i dh_installexamples -i dh_installmenu -i # dh_installemacsen -i # dh_installinit -i dh_installcron -i dh_installman -i lincredits.1 # dh_undocumented -i dh_installchangelogs -i dh_link -i dh_strip -i dh_compress -i dh_fixperms -i dh_python2 -i dh_installdeb -i dh_shlibdeps -i dh_gencontrol -i # dh_makeshlibs -i dh_md5sums -i dh_builddeb -i source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary lincredits-0.7+nmu1/debian/copyright0000664000000000000000000000211711523644776014461 0ustar This package was written by Chris Lawrence on Mon, 11 Jan 1999 23:26:53 -0600. Copyright: # lincredits -- Beautify the Linux CREDITS file in various formats # Written by Chris Lawrence # Copyright (C) 1999-2011 Chris Lawrence # # This program is freely distributable per the following license: # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permission notice appear in # supporting documentation. # # I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL I # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, # ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. lincredits-0.7+nmu1/debian/compat0000664000000000000000000000000211523644711013710 0ustar 7 lincredits-0.7+nmu1/debian/changelog0000664000000000000000000000303612564661154014374 0ustar lincredits (0.7+nmu1) unstable; urgency=medium * Non-maintainer upload. * Build using dh-python. Closes: #786296. -- Matthias Klose Tue, 18 Aug 2015 18:50:18 +0200 lincredits (0.7) unstable; urgency=low * Update suggestion tetex-base -> texlive-base. (Closes: #601354) * Cleanup various lintian issues, bump to Standards-Version 3.9.1. -- Chris Lawrence Sun, 06 Feb 2011 19:22:46 -0600 lincredits (0.6) unstable; urgency=low * Rebuild for new Python policy. * Cope with a few oddities in the current Linux CREDITS file. * Use hyperref in generated LaTeX output. -- Chris Lawrence Mon, 21 Aug 2006 11:19:08 -0500 lincredits (0.5) unstable; urgency=low * Bump python conflicts to 2.4, since it runs OK with 2.3. (Closes: #213240) -- Chris Lawrence Mon, 29 Sep 2003 10:32:10 -0500 lincredits (0.4) unstable; urgency=low * Remove dependency on obsolete python-base. (Closes: #124016) -- Chris Lawrence Sat, 2 Feb 2002 21:31:34 -0600 lincredits (0.3) unstable; urgency=low * Updated Standards-Version. * Updated control file for new Python packaging. -- Chris Lawrence Mon, 5 Nov 2001 03:45:14 -0600 lincredits (0.2) unstable; urgency=low * Standards-Version: 3.0.1.1 -- Chris Lawrence Sun, 12 Sep 1999 06:45:09 -0500 lincredits (0.1) unstable; urgency=low * Initial Release. -- Chris Lawrence Mon, 11 Jan 1999 23:26:53 -0600 lincredits-0.7+nmu1/debian/docs0000664000000000000000000000000106646556443013372 0ustar lincredits-0.7+nmu1/lincredits.10000664000000000000000000000215006646560067013523 0ustar .TH lincredits 1 .SH NAME lincredits \- generate beautified versions of the Linux CREDITS file .SH SYNOPSIS .B lincredits .I "[options] CREDITS-file" .SH "DESCRIPTION" This manual page briefly documents the .BR lincredits command. .PP .B lincredits is a program that beautifes the Linux CREDITS file into one of three supported formats: plain text, LaTeX and HTML. You must specify the path of a valid CREDITS file (usually /usr/src/linux/CREDITS) to be formatted. .SH OPTIONS The programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options are included below. .TP .B \-h, \-\-help Show summary of options. .TP .B \-o, \-\-output Send output to the specified files, instead of standard output. .TP .B \-\-text Format the output as plain text (default). .TP .B \-\-latex Format the output as LaTeX. .TP .B \-\-html Format the output as HTML. .SH TODO Support the MAINTAINERS file as well. .SH SEE ALSO python(1) .SH AUTHOR This manual page was written by Chris Lawrence , for the Debian GNU/Linux system (but may be used by others).