You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: create_data_tar.py
+47-29Lines changed: 47 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,10 @@
6
6
create_data_tar.py
7
7
8
8
Standalone utility to:
9
-
- Parse a .changes file (provided via --changes-file, or auto-detected)
10
-
- Extract each referenced .deb into data/<pkg>/<arch>/
11
-
- Pack the data/ directory as <changes_basename>.tar.gz in the same directory as the .changes file
9
+
- Locate a .changes file via --path-to-changes (file path or directory; if directory, the newest .changes is selected)
10
+
- Extract each referenced .deb into data/<pkg>/<arch>/ under the directory containing the .changes file
11
+
- Pack the data/ directory as <changes_basename>.tar.gz
12
+
- Place the tarball under <output-tar>/prebuilt_<distro>/ when --output-tar and --distro are provided; otherwise follow the fallback rules described in --output-tar help.
12
13
"""
13
14
14
15
importos
@@ -28,46 +29,54 @@ def parse_arguments():
28
29
description="Generate data.tar.gz by extracting deb contents to data/<pkg>/<arch>/ from a .changes file."
29
30
)
30
31
parser.add_argument(
31
-
"--changes-file",
32
+
"--path-to-changes",
32
33
required=False,
33
-
default="",
34
-
help="Path to the .changes file. If not provided, the newest .changes in --output-dir will be used."
34
+
default=".",
35
+
help="Path to the .changes file or a directory containing .changes files. If a directory is provided, the newest .changes will be used."
35
36
)
36
37
parser.add_argument(
37
-
"--output-dir",
38
+
"--output-tar",
38
39
required=False,
39
-
default=".",
40
-
help="Directory to search for the newest .changes when --changes-file is not provided. Also used as default working dir."
40
+
default="",
41
+
help="Base output directory where the tarball will be placed. When --distro is provided, the tarball will be written to <output-tar>/prebuilt_<distro>/"
41
42
)
42
43
parser.add_argument(
43
44
"--arch",
44
45
required=False,
45
46
default="arm64",
46
47
help="Architecture subfolder under each package directory (default: arm64)."
47
48
)
49
+
parser.add_argument(
50
+
"--distro",
51
+
required=False,
52
+
default="",
53
+
help="Target distro name (e.g., noble, questing). If provided, tar will be placed under <output-tar>/prebuilt_<distro>/"
0 commit comments