mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-20 22:01:11 +02:00
net-misc/sherlock: bump to 0.11.1
Package-Manager: Portage-2.3.89, Repoman-2.3.20 Signed-off-by: Yury Martynov <email@linxon.ru>
This commit is contained in:
parent
2d680e0e17
commit
fdf402c3b2
4 changed files with 170 additions and 13 deletions
|
|
@ -1,3 +1,4 @@
|
|||
DIST sherlock-0.10.4.tar.gz 1423062 BLAKE2B 8d9dee38544c5d2b87897306b954ed25d7f301b967b5c2c4c093f66dc387c9da7605654e14143b46a77c7ccdde167299a72328175c5995d23d908997452c708e SHA512 954fcc9ddc2ff0bb96b9f4bc5e26e955d2372ae4a2535a1d5751f949bd7359671335a8fd1ae23aed87dab77d82a3ca6f97152f6d7f0972305f77d10b79326776
|
||||
DIST sherlock-0.10.5.tar.gz 1425148 BLAKE2B deeab0fe0b29b9cda237bfc4f8d5bbef6b76ad0854175ea997367872c2ca5ef3da6664d2b0e14d864e712e99f8278bfb7a36f36b3376b6ad4876d48d0765b877 SHA512 2515f111105322f28e5b648cfae37ce58d1f3db81611055949a514e1b87b3af18072e2a1b03164b3d3ccc3b0fb1b8bd873cdd9dda18770743762ae477558c924
|
||||
DIST sherlock-0.10.9.tar.gz 1426029 BLAKE2B 34330e450ddb3530e78002cbb5db5677a897ca30ad1837089bd69fad56c28be65147360ce9b669af28f711d28be44b9bf3e752d8f69c1eb3a6d2f17711e67032 SHA512 3ebce5a54114804a8b120f1f1bc4105f6140290c846ce335d694239fbe440c71ca772437cd5bcadc8cc9ba8f7e1918e912e55c02c6a1f750504ed6c66390b199
|
||||
DIST sherlock-0.11.1.tar.gz 1429824 BLAKE2B dd7eaa96e14978d5e96b0d504109554ceaf1272109d463a8574504a7ba85f0426fb911932518869eff44f9df555360e987b0c89c9ebc8f72126a7ad2769cce53 SHA512 29ba0de78169f550b05b2b0a7f36184aecce26fbcc1ba663bbe80e2a3f264cf209818c209b384e4d5e3fe1d0038c27d7be94570c181b940194605ca0cbdc993f
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
diff -ur a/site_list.py b/site_list.py
|
||||
--- a/site_list.py 2020-05-09 07:42:00.000000000 +0300
|
||||
+++ b/site_list.py 2020-05-10 18:59:39.334304839 +0300
|
||||
@@ -1,8 +1,13 @@
|
||||
+#!/usr/bin/env python3
|
||||
+
|
||||
"""Sherlock: Supported Site Listing
|
||||
This module generates the listing of supported sites.
|
||||
"""
|
||||
+
|
||||
+import os
|
||||
import json
|
||||
import sys
|
||||
+import shutil
|
||||
import requests
|
||||
import threading
|
||||
import xml.etree.ElementTree as ET
|
||||
@@ -11,6 +16,8 @@
|
||||
|
||||
pool = list()
|
||||
|
||||
+DEFAULT_DATA_JSON_FILE = '/usr/share/sherlock/resources/data.json'
|
||||
+
|
||||
def get_rank(domain_to_query, dest):
|
||||
|
||||
#Retrieve ranking data via alexa API
|
||||
@@ -35,12 +42,12 @@
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
-with open("sherlock/resources/data.json", "r", encoding="utf-8") as data_file:
|
||||
- data = json.load(data_file)
|
||||
+if os.path.exists(DEFAULT_DATA_JSON_FILE):
|
||||
+ shutil.copyfile(DEFAULT_DATA_JSON_FILE, 'data.json')
|
||||
|
||||
-with open("sites.md", "w") as site_file:
|
||||
+with open("data.json", "r", encoding="utf-8") as data_file:
|
||||
+ data = json.load(data_file)
|
||||
data_length = len(data)
|
||||
- site_file.write(f'## List Of Supported Sites ({data_length} Sites In Total!)\n')
|
||||
|
||||
for social_network in data:
|
||||
url_main = data.get(social_network).get("urlMain")
|
||||
@@ -57,17 +64,14 @@
|
||||
for social_network, url_main, th in pool:
|
||||
if args.rank:
|
||||
th.join()
|
||||
- site_file.write(f'{index}. [{social_network}]({url_main})\n')
|
||||
sys.stdout.write("\r{0}".format(f"Updated {index} out of {data_length} entries"))
|
||||
sys.stdout.flush()
|
||||
index = index + 1
|
||||
|
||||
- if args.rank:
|
||||
- site_file.write(f'\nAlexa.com rank data fetched at ({datetime.utcnow()} UTC)\n')
|
||||
-
|
||||
sorted_json_data = json.dumps(data, indent=2, sort_keys=True)
|
||||
|
||||
-with open("sherlock/resources/data.json", "w") as data_file:
|
||||
+with open("data.json", "w") as data_file:
|
||||
data_file.write(sorted_json_data)
|
||||
|
||||
-print("\nFinished updating supported site listing!")
|
||||
+print("\nFinished updating supported site listing in: " + os.path.abspath('data.json'))
|
||||
+print("\nUsage: sherlock --json " + os.path.abspath("data.json") + " USERNAME [USERNAMES ...]")
|
||||
83
net-misc/sherlock/sherlock-0.11.1.ebuild
Normal file
83
net-misc/sherlock/sherlock-0.11.1.ebuild
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{6,7} )
|
||||
|
||||
inherit eutils python-single-r1
|
||||
|
||||
DESCRIPTION="Find usernames across social networks"
|
||||
HOMEPAGE="https://github.com/sherlock-project/sherlock"
|
||||
|
||||
if [[ ${PV} == *9999 ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/sherlock-project/sherlock"
|
||||
else
|
||||
# snapshot: 20200509
|
||||
HASH_COMMIT="0ba49808878b3efe24029639dfcac7f55a02c0d0"
|
||||
|
||||
SRC_URI="https://github.com/sherlock-project/sherlock/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 ~arm ~mips ~x86"
|
||||
S="${WORKDIR}/${PN}-${HASH_COMMIT}"
|
||||
fi
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT=0
|
||||
IUSE="test"
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/certifi[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/chardet[${PYTHON_MULTI_USEDEP}]
|
||||
>=dev-python/colorama-0.4.1[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/idna[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/lxml[${PYTHON_MULTI_USEDEP}]
|
||||
>=dev-python/PySocks-1.7.0[${PYTHON_MULTI_USEDEP}]
|
||||
>=dev-python/requests-2.22.0[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/requests-futures[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/soupsieve[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/torrequest[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/urllib3[${PYTHON_MULTI_USEDEP}]
|
||||
>=net-libs/stem-1.8.0[${PYTHON_MULTI_USEDEP}]
|
||||
')"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${P}_add_support_custom_data_json-r1.patch )
|
||||
|
||||
pkg_setup() {
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
python_fix_shebang "${S}"
|
||||
|
||||
if [[ ${PV} != *9999 ]]; then
|
||||
sed -e "s/__version__ = \"\(.*\)\"/__version__ = \"${PV}\"/" \
|
||||
-i sherlock/sherlock.py || die
|
||||
fi
|
||||
|
||||
if ! use test; then
|
||||
rm -rf sherlock/tests || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
"${EPYTHON}" -m unittest discover -v || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "/usr/share/${PN}"
|
||||
doins -r *.py sherlock/* data_bad_site.json
|
||||
|
||||
python_optimize "${D}/usr/share/${PN}"
|
||||
|
||||
make_wrapper ${PN} "${EPYTHON} /usr/share/${PN}/sherlock.py"
|
||||
make_wrapper ${PN}-get-sitelist "${EPYTHON} /usr/share/${PN}/site_list.py"
|
||||
|
||||
dodoc *.md Dockerfile
|
||||
}
|
||||
|
|
@ -14,8 +14,8 @@ if [[ ${PV} == *9999 ]]; then
|
|||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/sherlock-project/sherlock"
|
||||
else
|
||||
# snapshot: 20200109
|
||||
HASH_COMMIT="639d781a02d20acac02a751100ee1fcd5ca72220"
|
||||
# snapshot: 20200509
|
||||
HASH_COMMIT="0ba49808878b3efe24029639dfcac7f55a02c0d0"
|
||||
|
||||
SRC_URI="https://github.com/sherlock-project/sherlock/archive/${HASH_COMMIT}.tar.gz -> ${P}.tar.gz"
|
||||
KEYWORDS="~amd64 ~arm ~mips ~x86"
|
||||
|
|
@ -24,46 +24,55 @@ fi
|
|||
|
||||
LICENSE="MIT"
|
||||
SLOT=0
|
||||
#IUSE="test"
|
||||
IUSE=""
|
||||
IUSE="test"
|
||||
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
|
||||
|
||||
RESTRICT="!test? ( test )"
|
||||
|
||||
RDEPEND="${PYTHON_DEPS}
|
||||
$(python_gen_cond_dep '
|
||||
dev-python/beautifulsoup:4[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/certifi[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/chardet[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/colorama[${PYTHON_MULTI_USEDEP}]
|
||||
>=dev-python/colorama-0.4.1[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/idna[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/lxml[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/PySocks[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/requests[${PYTHON_MULTI_USEDEP}]
|
||||
>=dev-python/PySocks-1.7.0[${PYTHON_MULTI_USEDEP}]
|
||||
>=dev-python/requests-2.22.0[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/requests-futures[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/soupsieve[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/torrequest[${PYTHON_MULTI_USEDEP}]
|
||||
dev-python/urllib3[${PYTHON_MULTI_USEDEP}]
|
||||
>=net-libs/stem-1.7.0[${PYTHON_MULTI_USEDEP}]
|
||||
>=net-libs/stem-1.8.0[${PYTHON_MULTI_USEDEP}]
|
||||
')"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/sherlock-0.11.1_add_support_custom_data_json-r1.patch )
|
||||
|
||||
pkg_setup() {
|
||||
python-single-r1_pkg_setup
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
eapply "${FILESDIR}"/add_support_custom_data_json.patch
|
||||
default
|
||||
python_fix_shebang "${S}"
|
||||
|
||||
if [[ ${PV} != *9999 ]]; then
|
||||
sed -e "s/__version__ = \"\(.*\)\"/__version__ = \"${PV}\"/" \
|
||||
-i sherlock.py || die
|
||||
-i sherlock/sherlock.py || die
|
||||
fi
|
||||
|
||||
python_fix_shebang "${S}"
|
||||
default
|
||||
if ! use test; then
|
||||
rm -rf sherlock/tests || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_test() {
|
||||
"${EPYTHON}" -m unittest discover -v || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
insinto "/usr/share/${PN}"
|
||||
doins data.json *.py
|
||||
doins -r *.py sherlock/* data_bad_site.json
|
||||
|
||||
python_optimize "${D}/usr/share/${PN}"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue