File tree Expand file tree Collapse file tree
src/ota_image_builder/cmds Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,6 +72,10 @@ def _load_extra_patterns_from_file(_f: str) -> list[str]:
7272
7373 _res = []
7474 for _line in _pattern_f .read_text ().splitlines ():
75+ _line = _line .strip ()
76+ if _line .startswith (("#" , "//" )) or not _line :
77+ continue # skip empty line or commented out lines
78+
7579 for _pa in BACKWARD_COMPAT_PA :
7680 if _pa .match (_line ):
7781 break
@@ -110,6 +114,9 @@ def _process_cleanup(self) -> None:
110114 self ._delete_one_entry (path )
111115
112116 for entry in self ._extra_ignore_patterns :
117+ if not (entry := entry .strip ()):
118+ continue # skip empty lines!
119+
113120 if entry .startswith ("/" ):
114121 entry = entry .lstrip ("/" )
115122 if not GLOB_SPECIAL_CHARS .search (entry ): # for exact matching
@@ -125,7 +132,7 @@ def _process_cleanup(self) -> None:
125132 def _prepare_image (self ) -> None :
126133 for entry in DEFAULT_IGNORE_DIRS_SHOULD_PRESERVED :
127134 entry_path = self ._rootfs_dir / entry .lstrip ("/" )
128- entry_path .mkdir (exist_ok = True )
135+ entry_path .mkdir (exist_ok = True , parents = True )
129136
130137 def prepare (self ) -> None :
131138 """Prepare the system rootfs image."""
You can’t perform that action at this time.
0 commit comments