diff options
author | klondike <klondike@xiscosoft.es> | 2010-11-12 18:29:21 +0100 |
---|---|---|
committer | klondike <klondike@xiscosoft.es> | 2010-11-12 18:29:21 +0100 |
commit | ae75400747c90306cc4ca230e9e1b7814c7f08e8 (patch) | |
tree | 2921974a50447cdcafcecd0344c0733ab29b8e81 | |
parent | Reorganizing things to make easier to track (diff) | |
download | hardened-docs-ae75400747c90306cc4ca230e9e1b7814c7f08e8.tar.gz hardened-docs-ae75400747c90306cc4ca230e9e1b7814c7f08e8.tar.bz2 hardened-docs-ae75400747c90306cc4ca230e9e1b7814c7f08e8.zip |
Adapting to new structure and fixing gentoo.org addresses
-rwxr-xr-x | dopreview.sh | 10 | ||||
-rwxr-xr-x | fixpreview.sh | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/dopreview.sh b/dopreview.sh index b57ece7..7ca3232 100755 --- a/dopreview.sh +++ b/dopreview.sh @@ -15,13 +15,15 @@ if [ -z "$(whereis -b gorg | cut -d: -f2)" ]; exit 1; fi -for FILE in *.xml; +for FILE in `find xml/ -iname '*.xml'`; do - output=$(basename $FILE .xml).html + output=${FILE%.xml}.html + output=html/${output#xml/} + mkdir -p `dirname $output` gorg < $FILE | \ sed -e 's|"/css/main.css"|"http://www.gentoo.org/css/main.css"|g' \ -e 's|"../../../|"http://www.gentoo.org/|g' \ - -e 's|"/|"http://www.gentoo.org/|g' \ - -e 's|"/images/|"http://www.gentoo.org/images/|g' | \ + -e 's|"/images/|"http://www.gentoo.org/images/|g' \ + -e 's|"/|"http://www.gentoo.org/|g' | \ tr -d "\302" | tr -d "\240" > $output; done diff --git a/fixpreview.sh b/fixpreview.sh index 4d243bb..ff0728f 100755 --- a/fixpreview.sh +++ b/fixpreview.sh @@ -10,11 +10,12 @@ then exit 1; fi -for FILE in *.html; +for FILE in `find html/ -iname '*.html'`; do sed -i -e 's|"/css/main.css"|"http://www.gentoo.org/css/main.css"|g' ${FILE}; sed -i -e 's|"../../../|"http://www.gentoo.org/|g' ${FILE}; sed -i -e 's|"/images/|"http://www.gentoo.org/images/|g' ${FILE}; + sed -i -e 's|"/|"http://www.gentoo.org/|g' ${FILE}; cp ${FILE} ${FILE}.orig; cat ${FILE}.orig | tr -d "\302" | tr -d "\240" > ${FILE}; rm ${FILE}.orig; |