mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-06-26 14:29:56 +02:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f93816977f | |||
| a37bd43c09 |
File diff suppressed because it is too large
Load Diff
@@ -55,6 +55,9 @@
|
|||||||
"$ref": "#/$defs/tagValue"
|
"$ref": "#/$defs/tagValue"
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"category": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"citation_0": {
|
"citation_0": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -79,6 +82,15 @@
|
|||||||
"operator_icao": {
|
"operator_icao": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"owner": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"owner_category_0": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"owner_category_1": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"serial_number": {
|
"serial_number": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -260,6 +260,7 @@ def extract_split_archive(file_paths: list, extract_dir: str) -> bool:
|
|||||||
stdin=cat_proc.stdout,
|
stdin=cat_proc.stdout,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
|
check=True
|
||||||
)
|
)
|
||||||
cat_proc.stdout.close()
|
cat_proc.stdout.close()
|
||||||
cat_stderr = cat_proc.stderr.read().decode() if cat_proc.stderr else ""
|
cat_stderr = cat_proc.stderr.read().decode() if cat_proc.stderr else ""
|
||||||
@@ -268,24 +269,6 @@ def extract_split_archive(file_paths: list, extract_dir: str) -> bool:
|
|||||||
if cat_stderr:
|
if cat_stderr:
|
||||||
print(f"cat stderr: {cat_stderr}")
|
print(f"cat stderr: {cat_stderr}")
|
||||||
|
|
||||||
tar_stderr = result.stderr.decode() if result.stderr else ""
|
|
||||||
if result.returncode != 0:
|
|
||||||
# GNU tar exits non-zero for format issues that BSD tar silently
|
|
||||||
# tolerates (e.g. trailing junk after the last valid entry).
|
|
||||||
# Check whether files were actually extracted before giving up.
|
|
||||||
extracted_items = os.listdir(extract_dir)
|
|
||||||
if extracted_items:
|
|
||||||
print(f"[WARN] tar exited {result.returncode} but extracted "
|
|
||||||
f"{len(extracted_items)} items — treating as success")
|
|
||||||
if tar_stderr:
|
|
||||||
print(f"tar stderr: {tar_stderr}")
|
|
||||||
else:
|
|
||||||
print(f"Failed to extract split archive (tar exit {result.returncode})")
|
|
||||||
if tar_stderr:
|
|
||||||
print(f"tar stderr: {tar_stderr}")
|
|
||||||
shutil.rmtree(extract_dir, ignore_errors=True)
|
|
||||||
return False
|
|
||||||
|
|
||||||
print(f"Successfully extracted archive to {extract_dir}")
|
print(f"Successfully extracted archive to {extract_dir}")
|
||||||
|
|
||||||
# Delete tar files immediately after extraction
|
# Delete tar files immediately after extraction
|
||||||
@@ -302,9 +285,11 @@ def extract_split_archive(file_paths: list, extract_dir: str) -> bool:
|
|||||||
print(f"Disk space after tar deletion: {free_gb:.1f}GB free")
|
print(f"Disk space after tar deletion: {free_gb:.1f}GB free")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
except Exception as e:
|
except subprocess.CalledProcessError as e:
|
||||||
|
stderr_output = e.stderr.decode() if e.stderr else ""
|
||||||
print(f"Failed to extract split archive: {e}")
|
print(f"Failed to extract split archive: {e}")
|
||||||
shutil.rmtree(extract_dir, ignore_errors=True)
|
if stderr_output:
|
||||||
|
print(f"tar stderr: {stderr_output}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user