Ticket #31273: port-sitemap_gen.diff
File port-sitemap_gen.diff, 4.4 KB (added by anddam (Andrea D'Amore), 13 years ago) |
---|
-
files/patch-sitemap_gen_py.diff
1 --- sitemap_gen.py (revision 36) 2 +++ sitemap_gen.py (working copy) 3 @@ -62,7 +62,7 @@ 4 import fnmatch 5 import glob 6 import gzip 7 -import md5 8 +import hashlib 9 import os 10 import re 11 import stat 12 @@ -425,7 +425,7 @@ 13 """ Output and count a warning. Suppress duplicate warnings. """ 14 if text: 15 text = encoder.NarrowText(text, None) 16 - hash = md5.new(text).digest() 17 + hash = hashlib.md5(text).digest() 18 if not self._warns_shown.has_key(hash): 19 self._warns_shown[hash] = 1 20 print '[WARNING] ' + text 21 @@ -438,7 +438,7 @@ 22 """ Output and count an error. Suppress duplicate errors. """ 23 if text: 24 text = encoder.NarrowText(text, None) 25 - hash = md5.new(text).digest() 26 + hash = hashlib.md5(text).digest() 27 if not self._errors_shown.has_key(hash): 28 self._errors_shown[hash] = 1 29 print '[ERROR] ' + text 30 @@ -648,8 +648,8 @@ 31 if not self.loc: 32 return None 33 if self.loc.endswith('/'): 34 - return md5.new(self.loc[:-1]).digest() 35 - return md5.new(self.loc).digest() 36 + return hashlib.md5(self.loc[:-1]).digest() 37 + return hashlib.md5(self.loc).digest() 38 #end def MakeHash 39 40 def Log(self, prefix='URL', level=3): -
Portfile
1 1 # $Id$ 2 2 3 PortSystem 1.0 4 PortGroup python26 1.0 5 name sitemap_gen 6 version 1.4 7 categories www python 8 platforms darwin 9 maintainers google.com:mstokely 10 description sitecopy website maintenance utility 11 long_description The sitemap_gen.py script analyzes your web server \ 12 and generates one or more Sitemap files. These files \ 13 are XML listings of content you make available on your \ 14 web server. The files can then be directly submitted \ 15 to Google. \ 16 Written by opensource@google.com. 17 homepage https://www.google.com/webmasters/sitemaps/docs/en/about.html 18 master_sites sourceforge:goog-sitemapgen 19 checksums md5 0cd37e1295631b5b1ac484cfac321297 \ 20 sha1 693a041b0e7d9446766446291b2a80892399337c \ 21 rmd160 b03442238c331f0f835d5e886de8094d3836bb33 3 PortSystem 1.0 4 PortGroup python26 1.0 5 name sitemap_gen 6 version 1.5 7 categories www python 8 platforms darwin 9 maintainers google.com:mstokely 10 description sitecopy website maintenance utility 11 long_description The sitemap_gen.py script analyzes your web server \ 12 and generates one or more Sitemap files. These files \ 13 are XML listings of content you make available on your \ 14 web server. The files can then be directly submitted \ 15 to Google. 22 16 17 homepage http://code.google.com/p/sitemap-generators/ 18 master_sites googlecode:sitemap-generators 19 distname ${name}_${version} 20 checksums md5 98754e802722c0cc2ffcc8aedead67b6 \ 21 sha1 37126d3cb484ae28a6c7ff1ba8b2c96d2d79d1e8 \ 22 rmd160 3b781f8cfc8618263bb852ef58836e4ef1527ea5 23 24 extract.mkdir yes 25 patchfiles patch-sitemap_gen_py.diff 23 26 post-destroot { 24 xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name} 25 xinstall -m 0755 ${worksrcpath}/${name}.py ${destroot}${prefix}/bin/${name} 26 xinstall -m 0644 -W ${worksrcpath} COPYING README example_config.xml \ 27 example_urllist.txt ${destroot}${prefix}/share/doc/${name} 28 reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.6|" \ 29 ${destroot}${prefix}/bin/sitemap_gen 27 xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name} 28 xinstall -d -m 0755 ${destroot}${prefix}/share/examples/${name} 29 xinstall -m 0644 -W ${worksrcpath} \ 30 AUTHORS ChangeLog COPYING README \ 31 ${destroot}${prefix}/share/doc/${name} 32 xinstall -m 0644 -W ${worksrcpath} \ 33 example_config.xml example_urllist.txt \ 34 ${destroot}${prefix}/share/examples/${name} 35 36 xinstall -m 0755 ${worksrcpath}/${name}.py ${destroot}${prefix}/bin/${name} 37 reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.6|" \ 38 ${destroot}${prefix}/bin/sitemap_gen 30 39 }