pdf-parse: 0.7.4 bump with friends

This commit is contained in:
blshkv 2020-01-13 20:14:12 +08:00
parent a7cdf7d9eb
commit 2fd5251ef4
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
6 changed files with 122 additions and 0 deletions

View file

@ -1 +1,2 @@
DIST pdf-parser_V0_7_3.zip 14911 BLAKE2B 82869dafa850f1e54c1c7866dc5e668735e8b959e5f80d2718b9bc36fcf04c1cd2f33bea6b92d15cd6c10ae9b3b1b83582a675217a613175d149392bd8938348 SHA512 2b3a0d0c80a421430839bbb7555722bc0a2239e5203f9ac4a81fae77aa98af2c78fcbb496b6d67bcb94d1698513da0124d79eb9689b9bc65fe2f0e58981a6efb
DIST pdf-parser_V0_7_4.zip 14999 BLAKE2B 94764426afe8854832102afd4c71100f1f8b3e436ba25b94b07e101d6c7b156921fa49aaca01c34d67e167f7cfadcbfd125ded03a531e011fa71605399988b05 SHA512 9984cd9792818331224e74c450065a815b8081147541ba911d13913fb62202c3e50a752f3e3d8600d763f1f9ca0f2615afb4761c81520da2046400236f20ce40

View file

@ -0,0 +1,26 @@
diff -ur a/pdf-parser.py b/pdf-parser.py
--- a/pdf-parser.py 2019-03-18 11:04:30.022785000 +0300
+++ b/pdf-parser.py 2019-03-18 11:21:14.135237324 +0300
@@ -857,11 +857,11 @@
if options.hash:
streamContent = object.Stream(False, options.overridingfilters)
print(' unfiltered')
- print(' len: %6d md5: %s' % (len(streamContent), hashlib.md5(streamContent).hexdigest()))
+ print(' len: %6d md5: %s' % (len(streamContent), hashlib.md5(streamContent.encode('utf-8')).hexdigest()))
print(' %s' % HexAsciiDumpLine(streamContent))
streamContent = object.Stream(True, options.overridingfilters)
print(' filtered')
- print(' len: %6d md5: %s' % (len(streamContent), hashlib.md5(streamContent).hexdigest()))
+ print(' len: %6d md5: %s' % (len(streamContent), hashlib.md5(streamContent.encode('utf-8')).hexdigest()))
print(' %s' % HexAsciiDumpLine(streamContent))
streamContent = None
else:
@@ -1516,7 +1516,7 @@
elif options.hash:
print('obj %d %d' % (object.id, object.version))
rawContent = FormatOutput(object.content, True)
- print(' len: %d md5: %s' % (len(rawContent), hashlib.md5(rawContent).hexdigest()))
+ print(' len: %d md5: %s' % (len(rawContent), hashlib.md5(rawContent.encode('utf-8')).hexdigest()))
print('')
elif options.searchstream:
if object.StreamContains(options.searchstream, not options.unfiltered, options.casesensitive, options.regex, options.overridingfilters):

View file

@ -0,0 +1,45 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
inherit python-r1 unpacker
DESCRIPTION="This tool will parse a PDF document to identify the fundamental elements used"
HOMEPAGE="https://blog.didierstevens.com/programs/pdf-tools/"
MY_P="${PN}_V$(ver_rs 1- '_')"
SRC_URI="https://www.didierstevens.com/files/software/${MY_P}.zip"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="unicode yara"
DEPEND="${PYTHON_DEPS}
$(unpacker_src_uri_depends)"
RDEPEND="${DEPEND}
yara? ( dev-python/yara-python[${PYTHON_USEDEP}] )"
S="${WORKDIR}"
src_prepare() {
# Enable check maximum version of the python3
sed -e 's/TestPythonVersion(enforceMaximumVersion=True)/# REM/' \
-i pdf-parser.py || die
# Fix encoding errors when reading files
use unicode && eapply "${FILESDIR}/${PV}_define_encoding_format.patch"
default
}
src_install() {
python_foreach_impl python_newscript pdf-parser.py pdf-parser
}
pkg_postinst() {
elog "\nSee more: https://blog.didierstevens.com/2008/04/09/quickpost-about-the-physical-and-logical-structure-of-pdf-files/\n"
}

View file

@ -1 +1,2 @@
DIST pdfid_v0_2_6.zip 11695 BLAKE2B 71b1dee8915cae1c38afb7a4201393aa1ab01beadbf8c6bab7b7006bfde6b817aab0aa01199350c069d81fc9d489df52fe3ec81c55fc2a0c016470a772478867 SHA512 57f164659b5f091347f442ebc78647c39548c04cf1a1826178d9fcc14af67b46462e3f3195937525947d8182dd39975498fcf79c8f86f0c48266b35ffa1cf033
DIST pdfid_v0_2_7.zip 11773 BLAKE2B 808d73856ed18ca6f37c1ac77fe80fc1689f89fb9722cc7bfdf317477c9d20d6caf632c13c6a737bba4aef81b05427766af70c65b04ff011eca4ad054acb1c29 SHA512 02bb09b7d4541a55300a81f8c640a789b660f4d23933bc4ce3fa4055b85022611290bcee8dbd7842bcd95178b6c65b2e7fe2b99a17ce398c82642cbd1d07a4c5

View file

@ -0,0 +1,11 @@
--- a/pdfid.py.orig 2019-11-05 23:31:16.000000000 +0800
+++ b/pdfid.py 2020-01-13 19:56:41.037224704 +0800
@@ -374,7 +374,7 @@
def ParseINIFile():
oConfigParser = ConfigParser.ConfigParser(allow_no_value=True)
oConfigParser.optionxform = str
- oConfigParser.read(os.path.join(GetScriptPath(), 'pdfid.ini'))
+ oConfigParser.read('/etc/pdfid/pdfid.ini')
keywords = []
if oConfigParser.has_section('keywords'):
for key, value in oConfigParser.items('keywords'):

View file

@ -0,0 +1,38 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
inherit python-r1 unpacker
DESCRIPTION="This tool will scan a PDF document looking for certain keyword"
HOMEPAGE="https://blog.didierstevens.com/programs/pdf-tools/"
MY_P="${PN}_v$(ver_rs 1- '_')"
SRC_URI="https://www.didierstevens.com/files/software/${MY_P}.zip"
LICENSE="public-domain"
SLOT="0"
KEYWORDS="amd64 ~arm x86"
IUSE=""
DEPEND="${PYTHON_DEPS}
$(unpacker_src_uri_depends)"
RDEPEND="${DEPEND}"
PATCHES=( "${FILESDIR}"/${P}_pentoo.patch )
S="${WORKDIR}"
src_install() {
insinto "/etc/${PN}"
doins pdfid.ini
insinto "/usr/share/${PN}"
doins plugin_*
python_foreach_impl python_newscript pdfid.py pdfid
}