Skip to content

Commit

Permalink
Add "-f" for rm to ignore file not found error
Browse files Browse the repository at this point in the history
Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
  • Loading branch information
AristoChen committed Jul 31, 2024
1 parent feed34e commit 654b3b0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion snapcraft_legacy/plugins/v2/_kernel_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ def _arrange_install_dir_cmd(install_dir: str) -> List[str]:
# but snapd expects modules/ and firmware/
mv {install_dir}/lib/modules {install_dir}/
# remove symlinks modules/*/build and modules/*/source
rm {install_dir}/modules/*/build {install_dir}/modules/*/source
rm -f {install_dir}/modules/*/build {install_dir}/modules/*/source
# if there is firmware dir, move it to snap root
# this could have been from stage packages or from kernel build
[ -d {install_dir}/lib/firmware ] && mv {install_dir}/lib/firmware {install_dir}
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy/unit/plugins/v2/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ def _is_sub_array(array, sub_array):
# but snapd expects modules/ and firmware/
mv ${SNAPCRAFT_PART_INSTALL}/lib/modules ${SNAPCRAFT_PART_INSTALL}/
# remove symlinks modules/*/build and modules/*/source
rm ${SNAPCRAFT_PART_INSTALL}/modules/*/build ${SNAPCRAFT_PART_INSTALL}/modules/*/source
rm -f ${SNAPCRAFT_PART_INSTALL}/modules/*/build ${SNAPCRAFT_PART_INSTALL}/modules/*/source
# if there is firmware dir, move it to snap root
# this could have been from stage packages or from kernel build
[ -d ${SNAPCRAFT_PART_INSTALL}/lib/firmware ] && mv ${SNAPCRAFT_PART_INSTALL}/lib/firmware ${SNAPCRAFT_PART_INSTALL}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/parts/plugins/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1919,7 +1919,7 @@ def _is_sub_array(array, sub_array):
# but snapd expects modules/ and firmware/
mv ${CRAFT_PART_INSTALL}/lib/modules ${CRAFT_PART_INSTALL}/
# remove symlinks modules/*/build and modules/*/source
rm ${CRAFT_PART_INSTALL}/modules/*/build ${CRAFT_PART_INSTALL}/modules/*/source
rm -f ${CRAFT_PART_INSTALL}/modules/*/build ${CRAFT_PART_INSTALL}/modules/*/source
# if there is firmware dir, move it to snap root
# this could have been from stage packages or from kernel build
[ -d ${CRAFT_PART_INSTALL}/lib/firmware ] && mv ${CRAFT_PART_INSTALL}/lib/firmware ${CRAFT_PART_INSTALL}
Expand Down

0 comments on commit 654b3b0

Please sign in to comment.