Commit 5fe63e6
0
plików
+0
dodanych
-0
usuniętych
@@ -1,7 +1,7 @@
1
1
#!/usr/bin/env python3
2
2
"""
3
3
╔══════════════════════════════════════════════════════════════════════════════╗
4
-║ PAG - Pagan Linux Package Manager v3.3.10 ║
4
+║ PAG - Pagan Linux Package Manager v3.3.10a ║
5
5
║ Produkcyjny menedżer pakietów – atomowy, bezpieczny, i18n ║
6
6
╚══════════════════════════════════════════════════════════════════════════════╝
7
7
@@ -33,7 +33,7 @@ MODEL ZAUFANIA / BEZPIECZEŃSTWO:
33
33
- self-update: weryfikacja podpisu + SHA256 + składnia, atomowa podmiana.
34
34
"""
35
35
36
-import os, sys, json, shutil, hashlib, tarfile, tempfile, subprocess, time, fcntl, sqlite3, locale, re
36
+import os, sys, json, shutil, hashlib, tarfile, tempfile, subprocess, time, fcntl, sqlite3, locale, re, difflib
37
37
38
38
# Fix TLS trust inside the Pagan chroot: point Python at the CA bundle that
39
39
# pag ships, otherwise urlopen() fails with "unable to get local issuer
@@ -54,7 +54,7 @@ from urllib.request import urlopen, Request
54
54
import threading, itertools
55
55
56
56
# Wersja klienta – do porównania z repo.json["pag_version"] (self-update)
57
-PAG_VERSION = "3.3.10"
57
+PAG_VERSION = "3.3.10a"
58
58
from urllib.error import URLError, HTTPError
59
59
60
60
# =============================================================================
@@ -2520,8 +2520,8 @@ def cmd_self_update():
2520
2520
_cleanup_tmp_files(dst_new, dst_new + ".asc")
2521
2521
return 1
2522
2522
2523
- m = (re.search(rb'PAG_VERSION\s*=\s*"(\d+\.\d+\.\d+)"', data[:3000])
2524
- or re.search(rb"v(\d+\.\d+\.\d+)", data[:3000]))
2523
+ m = (re.search(rb'PAG_VERSION\s*=\s*"(\d+\.\d+\.\d+[a-z]?)"', data[:3000])
2524
+ or re.search(rb"v(\d+\.\d+\.\d+[a-z]?)", data[:3000]))
2525
2525
new_ver = m.group(1).decode() if m else "?"
2526
2526
print(f" ✅ Pobrano pag {new_ver} (obecny {PAG_VERSION}), podpis zweryfikowany")
2527
2527
@@ -4153,6 +4153,15 @@ def main():
4153
4153
"deploy-rollback", "deploy-cleanup", "initramfs-update", "grub-update",
4154
4154
}
4155
4155
if cmd not in WRITE_CMDS:
4156
+ # Literówka komendy? (np. `pag instal steam` zamiast `pag install`) –
4157
+ # zasugeruj poprawną komendę ZAMIAST wpadać w smart search (który
4158
+ # potrafi wisieć na `flatpak search` aż do Ctrl-C).
4159
+ _known = set(READ_ONLY) | set(WRITE_CMDS)
4160
+ _close = difflib.get_close_matches(cmd, _known, n=1, cutoff=0.75)
4161
+ if _close:
4162
+ print(f"❌ Nieznana komenda: '{cmd}'. Czy chodziło o '{_close[0]}'?")
4163
+ print(f" Uruchom 'pag' bez argumentów, aby zobaczyć listę komend.")
4164
+ sys.exit(1)
4156
4165
sys.exit(_smart_search(" ".join([cmd] + args)) or 0)
4157
4166
4158
4167
# Obsługa flag globalnych (-y/--yes)
@@ -4207,4 +4216,9 @@ def main():
4207
4216
sys.exit(_smart_search(" ".join([cmd] + args)) or 0)
4208
4217
4209
4218
if __name__ == "__main__":
4210
- main()
4219
+ try:
4220
+ main()
4221
+ except KeyboardInterrupt:
4222
+ # Ctrl-C (np. podczas flatpak search / pobierania) – bez tracebacka
4223
+ print("\n ⚠ Przerwano (Ctrl-C).")
4224
+ sys.exit(130)