Scripts: simpler tar format (#1871)

* scriptsL simpler tar format
* scripts: shorter names for files in update bundle
* scripts: limiting max OTA package dir name length to 80
* scripts: resource bundle: checks for file name length
* scripts: made resource packing errors critical
This commit is contained in:
hedger
2022-10-13 19:05:07 +04:00
committed by GitHub
parent 50dc2d7389
commit 8fdee1e460
3 changed files with 34 additions and 11 deletions

View File

@@ -20,6 +20,7 @@ class ProjectDir:
class Main(App):
DIST_FILE_PREFIX = "flipper-z-"
DIST_FOLDER_MAX_NAME_LENGTH = 80
def init(self):
self.subparsers = self.parser.add_subparsers(help="sub-command help")
@@ -129,7 +130,9 @@ class Main(App):
)
if self.args.version:
bundle_dir_name = f"{self.target}-update-{self.args.suffix}"
bundle_dir_name = f"{self.target}-update-{self.args.suffix}"[
: self.DIST_FOLDER_MAX_NAME_LENGTH
]
bundle_dir = join(self.output_dir_path, bundle_dir_name)
bundle_args = [
"generate",
@@ -170,6 +173,7 @@ class Main(App):
),
"w:gz",
compresslevel=9,
format=tarfile.USTAR_FORMAT,
) as tar:
tar.add(bundle_dir, arcname=bundle_dir_name)