summaryrefslogtreecommitdiffstats
path: root/pym/portage/checksum.py
Commit message (Collapse)AuthorAgeFilesLines
* Use 'with file' more.Zac Medico2012-12-281-9/+8
| | | | This helps to minimize ResourceWarning triggered by ^C with python3.
* Replace getstatusoutput with unicode safe Popen.Zac Medico2012-09-111-4/+13
| | | | This fixes potential issues similar to those reported in bug #310789.
* _apply_hash_filter: make hash_filter simplerZac Medico2012-08-211-2/+6
| | | | | Now any callable object will work, which might be helpful for consumers of the Manifest.checkFileHashes() method.
* Implement PORTAGE_CHECKSUM_FILTER for bug #432170Zac Medico2012-08-211-0/+54
|
* Skip whirlpool digest check when unaccelerated.Zac Medico2012-07-121-0/+20
| | | | | | | | If multiple digests are available and whirlpool is unaccelerated, then skip it. This allows extreme performance problems like bug #425046 to be avoided whenever practical, especially for cases like stage builds where acceleration may not be available for some hashes due to minimization of dependencies.
* perform_all: fix TypeError for bug #411897Zac Medico2012-04-131-1/+1
|
* checksum.py: remove PyPy 1.7 workaroundsZac Medico2012-02-131-30/+1
| | | | | | The corresponding hashlib issues are fixed in PyPy 1.8: https://bugs.pypy.org/issue957
* checksum.py: detect PyPy crashes in hashlibZac Medico2011-12-011-0/+29
| | | | | | | | Use a fork to try and PyPy by digesting random data with hashlib functions. It doesn't look like a bug has been reported upstream for this yet, so it may or may not be reproducible by others. Anyway, this allows me to avoid crashing the main PyPy process until I find a real fix.
* checksum.py: handle pycrypto breakageZac Medico2011-11-131-2/+10
|
* Bug #388615 - optimize FEATURES=prelink-checksumsMartin von Gagern2011-10-261-14/+27
| | | | Only spawn prelink if the file has an ELF header.
* perform_checksum: OSerror to PermissionDeniedZac Medico2011-10-161-1/+3
|
* checksum.py: use fchksum.fmd5t directlyZac Medico2011-10-011-4/+1
|
* checksum.py: lazily import bundled whirlpoolZac Medico2011-10-011-7/+7
|
* Manifest2 hash backend provider: mhashRobin H. Johnson2011-10-011-0/+19
| | | | | | | | | | Offer mhash as a provider for Manifest2 hash generation and validation. This is important as either of pycrypto or fchksum offer an accelerated Whirlpool implementation, and hashlib might not offer it. Additionally, the mhash implementation is accelerated and ships with a rigorious testsuite. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Manifest2 hash: SHA512Robin H. Johnson2011-10-011-0/+1
| | | | | | Provide SHA512 hash algorithm to be used as new Manifest2 hash. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Manifest2 hash: WhirlpoolRobin H. Johnson2011-10-011-2/+6
| | | | | | | Provide public-domain implementation of the Whirlpool hash algorithm to be used as new Manifest2 hash. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Refactor RMD160 hashlib code for less-hardcodingRobin H. Johnson2011-10-011-9/+12
| | | | | | To be used shortly for WHIRLPOOL as well as RMD160. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Convert _generate_hash_function into a class.Zac Medico2011-10-011-6/+11
|
* Use portage.subprocess_getstatusoutput() more.Zac Medico2011-07-121-6/+3
|
* repoman: handle PermissionDenied from digestgenZac Medico2011-06-171-2/+13
| | | | This will fix bug #371987.
* Remove unused imports found by pylint.Arfrever Frehtes Taifersar Arahesis2010-08-291-2/+2
|
* Remove all svn $Id keywords.Zac Medico2010-03-241-1/+0
|
* Make verify_all() do checksums in sorted order by hash name.Zac Medico2010-02-031-1/+1
| | | | svn path=/main/trunk/; revision=15318
* Replace dict.keys() usage with __iter__(), since it behaves identically inZac Medico2009-09-221-1/+1
| | | | | | both python 2.x and 3.x. svn path=/main/trunk/; revision=14384
* Use dict.(keys|values|items)() instead of ↵Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+1
| | | | | | | | dict.(iterkeys|itervalues|iteritems)() for compatibility with Python 3. (2to3-3.1 -f dict -nw ${FILES}) svn path=/main/trunk/; revision=14327
* Fix all remaining SyntaxErrors with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-211-1/+1
| | | | svn path=/main/trunk/; revision=14315
* Update system imports for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-2/+5
| | | | svn path=/main/trunk/; revision=14294
* Update syntax of numbers for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-1/+1
| | | | | | (2to3-3.1 -f numliterals -nw ${FILES}) svn path=/main/trunk/; revision=14292
* Update syntax of 'except' statements for compatibility with Python 3.Arfrever Frehtes Taifersar Arahesis2009-09-201-5/+5
| | | | | | (2to3-3.1 -f except -nw ${FILES}) svn path=/main/trunk/; revision=14289
* Replace _content_encoding, _fs_encoding, and _merge_encoding with directZac Medico2009-08-211-5/+4
| | | | | | usage of _encodings. svn path=/main/trunk/; revision=14113
* Prepare 308 messages to localization.Arfrever Frehtes Taifersar Arahesis2009-08-151-2/+3
| | | | svn path=/main/trunk/; revision=14067
* Make _generate_hash_function() use _fs_encoding to encode the filenameZac Medico2009-08-151-1/+2
| | | | | | (if it's not already encoded), and enable errors='strict'. svn path=/main/trunk/; revision=14060
* In perform_checksum(), encode the filename with correct encoding beforeZac Medico2009-08-151-5/+12
| | | | | | | passing to spawn (for prelink), and enable strict encoding behavior in _perform_md5_merge(). svn path=/main/trunk/; revision=14059
* Fix dblink._unmerge_pkgfiles() to use the correct version of perform_md5Zac Medico2009-08-151-1/+3
| | | | | | when it falls back to utf8 encoding. svn path=/main/trunk/; revision=14058
* Use portage._merge_encoding to encode/decode all filenames duringZac Medico2009-08-141-0/+4
| | | | | | merge/unmerge operations. svn path=/main/trunk/; revision=14027
* Update imports to import portage.os (with unicode wrappers), and useZac Medico2009-08-111-4/+4
| | | | | | _unicode_encode() and _unicode_decode() where appropriate. svn path=/main/trunk/; revision=14004
* With python-2.6, importing the Crypto.Hash.MD5 and Crypto.Hash.SHA modulesZac Medico2008-11-081-4/+1
| | | | | | | | | | | | from pycrypto triggers warnings since those modules are implemented using the deprecated md5 and sha modules from python's stdlib. So, in order to avoid the warning and the inferior hash implementations that come with them, never use these particular modules from pycrypto. Instead, use hashlib or directly use stdlib's md5 and sha modules if necessary. Thanks to Markus Peloquin for reporting. svn path=/main/trunk/; revision=11828
* Py3k compatibility patch by Ali Polatel <hawking@g.o>.Zac Medico2008-07-021-1/+4
| | | | | | Don't use the format raise Exception, "string" svn path=/main/trunk/; revision=10890
* Avoid python-2.6 deprecation warnings for md5 and sha modules by tryingZac Medico2008-06-301-3/+13
| | | | | | | to import hashlib first and then falling back to the deprecated modules if necessary. Thanks to ColdWind for reporting. svn path=/main/trunk/; revision=10854
* Move prelink tempfile cleanup to the finally block andZac Medico2007-09-271-6/+2
| | | | | | remove unused locking code. svn path=/main/trunk/; revision=7864
* Bug #190179 - Use `prelink --verify filename` to write theZac Medico2007-09-241-5/+9
| | | | | | | | | | temp file via stdout since --undo fails when run as a normal non-superuser because it tries to chown the output file. Also, use mkstemp() to eliminate the need for locking the temp file. Thanks to Israel G. Lugo <israel.lugo@lugosys.com> for the initial patch. svn path=/main/trunk/; revision=7801
* Run pychecker over everything, fix obvious thing slike modules not in use, ↵Alec Warner2007-07-221-3/+3
| | | | | | variables not being used, or global exceptions not being deleted. Also fix imports for style (1 per line) svn path=/main/trunk/; revision=7354
* Remove unused imports and unnecessary dict.keys() call.Zac Medico2007-06-241-3/+1
| | | | svn path=/main/trunk/; revision=7011
* add hashlib support for checksum verification, refactor checksum functions ↵Marius Mauch2007-06-231-54/+71
| | | | | | to not look like a complete mess svn path=/main/trunk/; revision=6972
* Remove more unnecessary list generation.Zac Medico2007-06-211-3/+3
| | | | svn path=/main/trunk/; revision=6912
* For bug #173184, handle the CommandNotFound that is produced during ↵Zac Medico2007-04-021-4/+9
| | | | | | uninstallation of prelink. svn path=/main/trunk/; revision=6332
* Make verify_all() return an "insufficient data" error if there is not at ↵Zac Medico2007-02-231-0/+18
| | | | | | least one supported hash type. svn path=/main/trunk/; revision=6055
* Namespace sanitizing, step 3Marius Mauch2007-01-251-1/+1
| | | | svn path=/main/trunk/; revision=5782
* Namespace sanitizing, step 2Marius Mauch2007-01-251-14/+14
| | | | | | | Rename portage.exec to portage.process to avoid syntax errors svn path=/main/trunk/; revision=5780
* Namespace sanitizing, step 1Marius Mauch2007-01-251-0/+219
svn path=/main/trunk/; revision=5778