From 43c68f98eb259fb1120e1bc40586406d49d2ef31 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Feb 22 2023 03:18:48 +0000 Subject: Update to git snapshot 95d2ac8 --- diff --git a/.gitignore b/.gitignore index 8f32122..771891c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /samloader-820375214f1b7b26109e5c3aea8d005fcc56eebf.tar.gz +/samloader-95d2ac8fb9027b7908d201e4ce807a5b338f923a.tar.gz diff --git a/Use-tqdm-for-progress-bar.patch b/Use-tqdm-for-progress-bar.patch deleted file mode 100644 index 3bac843..0000000 --- a/Use-tqdm-for-progress-bar.patch +++ /dev/null @@ -1,69 +0,0 @@ -From bb107972df3a5d7b9755524b66becad3fea6390c Mon Sep 17 00:00:00 2001 -From: Davide Cavalca -Date: Fri, 24 Dec 2021 11:12:17 +0100 -Subject: [PATCH] Use tqdm for progress bar instead of clint - ---- - samloader/crypt.py | 4 ++-- - samloader/main.py | 5 ++--- - setup.py | 2 +- - 3 files changed, 5 insertions(+), 6 deletions(-) - -diff --git a/samloader/crypt.py b/samloader/crypt.py -index 29611a6..5f45c43 100644 ---- a/samloader/crypt.py -+++ b/samloader/crypt.py -@@ -6,7 +6,7 @@ - import hashlib - import xml.etree.ElementTree as ET - from Cryptodome.Cipher import AES --from clint.textui import progress -+from tqdm import tqdm - - from . import fusclient - from . import request -@@ -38,7 +38,7 @@ def decrypt_progress(inf, outf, key, length): - if length % 16 != 0: - raise Exception("invalid input block size") - chunks = length//4096+1 -- for i in progress.bar(range(chunks)): -+ for i in tqdm(range(chunks)): - block = inf.read(4096) - if not block: - break -diff --git a/samloader/main.py b/samloader/main.py -index 57210dc..0941fed 100644 ---- a/samloader/main.py -+++ b/samloader/main.py -@@ -5,7 +5,7 @@ - import os - import base64 - import xml.etree.ElementTree as ET --from clint.textui import progress -+from tqdm import tqdm - - from . import request - from . import crypt -@@ -46,8 +46,7 @@ def main(): - r = client.downloadfile(path+filename, dloffset) - if args.show_md5 and "Content-MD5" in r.headers: - print("MD5:", base64.b64decode(r.headers["Content-MD5"]).hex()) -- # TODO: use own progress bar instead of clint -- for chunk in progress.bar(r.iter_content(chunk_size=0x10000), expected_size=((size-dloffset)/0x10000)+1): -+ for chunk in tqdm(r.iter_content(chunk_size=0x10000), total=int((size-dloffset)/0x10000)+1): - if chunk: - fd.write(chunk) - fd.flush() -diff --git a/setup.py b/setup.py -index 1442858..018448f 100644 ---- a/setup.py -+++ b/setup.py -@@ -24,7 +24,7 @@ - ], - }, - install_requires=[ -- "clint", -+ "tqdm", - "pycryptodomex", - "requests" - ], diff --git a/python-samloader.spec b/python-samloader.spec index 7ac2cea..90d14d5 100644 --- a/python-samloader.spec +++ b/python-samloader.spec @@ -1,18 +1,17 @@ -%global forgeurl https://github.com/nlscc/samloader -%global commit 820375214f1b7b26109e5c3aea8d005fcc56eebf -%forgemeta +%global date 20221223 +%global commit 95d2ac8fb9027b7908d201e4ce807a5b338f923a +%global shortcommit %(c=%{commit}; echo ${c:0:7}) %global pypi_name samloader Name: python-%{pypi_name} -Version: 0 +Version: 0.4~%{date}git%{shortcommit} Release: %autorelease Summary: Download Samsung firmware from official servers -License: GPLv3 -URL: %{forgeurl} -Source0: %{forgesource} -Patch0: %{url}/pull/59.patch#/Use-tqdm-for-progress-bar.patch +License: GPL-3.0-or-later +URL: https://github.com/nlscc/samloader +Source: %{url}/archive/%{commit}/%{pypi_name}-%{commit}.tar.gz BuildArch: noarch BuildRequires: python3-devel @@ -44,7 +43,6 @@ Summary: %{summary} %check %pyproject_check_import %{pypi_name} - %files -n %{pypi_name} -f %{pyproject_files} %license COPYING %doc README.md diff --git a/sources b/sources index 48fbcee..233d267 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (samloader-820375214f1b7b26109e5c3aea8d005fcc56eebf.tar.gz) = 38f393fb77d5d274c4ff151682a7b4ac1e362a3b074851da1579a238bab9952c2c27c961aa83d68d8dcd8a5e3c142b54b2c2dcfb0137911248fa35c07c6e2380 +SHA512 (samloader-95d2ac8fb9027b7908d201e4ce807a5b338f923a.tar.gz) = 7ef7cdb640fcf96e8c62d5766dd2251baf722992528ad4cf155ffa5f7ce491f6ced1b5368f3b5c590d85139fd1350dfde972b63c4dd28d9c254fc5c23f928569