summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch')
-rw-r--r--sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch203
1 files changed, 203 insertions, 0 deletions
diff --git a/sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch b/sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch
new file mode 100644
index 000000000000..6ed4c1989b4c
--- /dev/null
+++ b/sys-cluster/charm/files/charm-6.5.1-fix-markupSanitizer.patch
@@ -0,0 +1,203 @@
+From 88f5739d3f0d34c51f318fc460b843253b4242e0 Mon Sep 17 00:00:00 2001
+From: Nicolas Bock <nicolasbock@gmail.com>
+Date: Fri, 8 Nov 2013 09:58:55 -0700
+Subject: [PATCH 2/2] Make markupSanitizer.py support python 3.1 and 3.2
+
+The script only supports <python-3 because of how uni-code literals are
+treated in python-3.{1,2}. In python-2, a unicode string had to be prefixed
+with 'u', while this notation was dropped in python-3.{1,2}. I have added a
+check to the script so that it runs now with python-2.7 and python-3.{1,2,3}.
+---
+ doc/markupSanitizer.py | 179 ++++++++++++++++++++++++++-----------------------
+ 1 file changed, 95 insertions(+), 84 deletions(-)
+
+diff --git a/doc/markupSanitizer.py b/doc/markupSanitizer.py
+index f206cab..6fe247d 100755
+--- a/doc/markupSanitizer.py
++++ b/doc/markupSanitizer.py
+@@ -4,87 +4,98 @@ from bs4 import BeautifulSoup
+ import sys
+ import os
+
+-# Accept filename as user input
+-argc = len( sys.argv )
+-if (argc < 2): raise Exception
+-fileName = sys.argv[1];
+-
+-# Construct a DOM object
+-soup = BeautifulSoup(open(fileName), "lxml")
+-
+-# Assuming, tt tags are not spewed recklessly by latex2html,
+-# replace them with code tags
+-for t in soup('tt'):
+- t.wrap( soup.new_tag('code') )
+- t.unwrap()
+-
+-# Rewrap all div class=alltt blocks in pre tags
+-for d in soup('div','alltt'):
+- d.wrap( soup.new_tag('pre') )
+- d.unwrap()
+-
+-# Remove br and span tags from within pre sections
+-for p in soup('pre'):
+- for b in p('br'):
+- b.extract()
+- for s in p('span'):
+- s.unwrap()
+-
+-# Remove all useless class 'arabic' spans
+-for s in soup('span','arabic'):
+- s.unwrap()
+-
+-# Extract the navigation bar
+-navmenu = soup.find('div', 'navigation')
+-if navmenu:
+- navmenu.extract()
+-
+-# Wrap the remaining contents within a div
+-if not soup.find('div', id='maincontainer'):
+- soup.body['id'] = 'maincontainer'
+- soup.body.name = 'div'
+- soup.find('div', id='maincontainer').wrap( soup.new_tag('body') )
+-
+-if navmenu:
+- # If this navmenu doesn't already have a TOC, insert one
+- if not navmenu.find('ul','manual-toc'):
+- # Add a toc within the navmenu
+- navmenuTOC = BeautifulSoup(open("tmp-navmenu.html"), "lxml")
+- navmenuTOC = navmenuTOC.find('ul','manual-toc').extract()
+- navmenuTOC.append( BeautifulSoup("".join([
+- '<li><a href="http://charm.cs.illinois.edu">PPL Homepage</a></li>',
+- '<li><a href="http://charm.cs.illinois.edu/help">Other Manuals</a></li>'])
+- ) )
+- navmenu.append(navmenuTOC)
+-
+- # Insert navigation symbols to prev and next links
+- prevsymbol = soup.new_tag('span')
+- prevsymbol['class'] = 'navsymbol'
+- prevsymbol.string = u'\xab'
+- prv = navmenu.find('li',id='nav-prev')
+- if prv:
+- prv.find('a').insert(0, prevsymbol)
+-
+- nextsymbol = soup.new_tag('span')
+- nextsymbol['class'] = 'navsymbol'
+- nextsymbol.string = u'\xbb'
+- nxt = navmenu.find('li',id='nav-next')
+- if nxt:
+- nxt.find('a').append(nextsymbol)
+-
+- # Reinsert the navigation bar at the end
+- soup.body.append(navmenu)
+-
+-# Extract the title
+-titl = soup.find('title')
+-
+-# Replace the head section with the user-supplied head markup
+-soup.find('head').extract()
+-newhead = BeautifulSoup(open("../assets/head.html"), "lxml")
+-newhead = newhead.find('head').extract()
+-newhead.append(titl)
+-soup.html.body.insert_before(newhead)
+-
+-# Print cleaned up markup to stdout
+-print( soup.prettify(formatter="html") )
+-
++def main ():
++ # Accept filename as user input
++ argc = len( sys.argv )
++ if (argc < 2): raise Exception
++ fileName = sys.argv[1];
++
++ # Construct a DOM object
++ soup = BeautifulSoup(open(fileName), "lxml")
++
++ # Assuming, tt tags are not spewed recklessly by latex2html,
++ # replace them with code tags
++ for t in soup('tt'):
++ t.wrap( soup.new_tag('code') )
++ t.unwrap()
++
++ # Rewrap all div class=alltt blocks in pre tags
++ for d in soup('div','alltt'):
++ d.wrap( soup.new_tag('pre') )
++ d.unwrap()
++
++ # Remove br and span tags from within pre sections
++ for p in soup('pre'):
++ for b in p('br'):
++ b.extract()
++ for s in p('span'):
++ s.unwrap()
++
++ # Remove all useless class 'arabic' spans
++ for s in soup('span','arabic'):
++ s.unwrap()
++
++ # Extract the navigation bar
++ navmenu = soup.find('div', 'navigation')
++ if navmenu:
++ navmenu.extract()
++
++ # Wrap the remaining contents within a div
++ if not soup.find('div', id='maincontainer'):
++ soup.body['id'] = 'maincontainer'
++ soup.body.name = 'div'
++ soup.find('div', id='maincontainer').wrap( soup.new_tag('body') )
++
++ if navmenu:
++ # If this navmenu doesn't already have a TOC, insert one
++ if not navmenu.find('ul','manual-toc'):
++ # Add a toc within the navmenu
++ navmenuTOC = BeautifulSoup(open("tmp-navmenu.html"), "lxml")
++ navmenuTOC = navmenuTOC.find('ul','manual-toc').extract()
++ navmenuTOC.append( BeautifulSoup("".join([
++ '<li><a href="http://charm.cs.illinois.edu">PPL Homepage</a></li>',
++ '<li><a href="http://charm.cs.illinois.edu/help">Other Manuals</a></li>'])
++ ) )
++ navmenu.append(navmenuTOC)
++
++ # Insert navigation symbols to prev and next links
++ prevsymbol = soup.new_tag('span')
++ prevsymbol['class'] = 'navsymbol'
++ prevsymbol.string = u('\xab')
++ prv = navmenu.find('li',id='nav-prev')
++ if prv:
++ prv.find('a').insert(0, prevsymbol)
++
++ nextsymbol = soup.new_tag('span')
++ nextsymbol['class'] = 'navsymbol'
++ nextsymbol.string = u('\xbb')
++ nxt = navmenu.find('li',id='nav-next')
++ if nxt:
++ nxt.find('a').append(nextsymbol)
++
++ # Reinsert the navigation bar at the end
++ soup.body.append(navmenu)
++
++ # Extract the title
++ titl = soup.find('title')
++
++ # Replace the head section with the user-supplied head markup
++ soup.find('head').extract()
++ newhead = BeautifulSoup(open("../assets/head.html"), "lxml")
++ newhead = newhead.find('head').extract()
++ newhead.append(titl)
++ soup.html.body.insert_before(newhead)
++
++ # Print cleaned up markup to stdout
++ print( soup.prettify(formatter="html") )
++
++if sys.version < '3':
++ import codecs
++ def u (x):
++ return codecs.unicode_escape_decode(x)[0]
++else:
++ def u (x):
++ return x
++
++if __name__ == "__main__":
++ main()
+--
+1.8.1.5
+