From adc58ff421d9ac73e36940d9df455d9bfadbd344 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Mon, 22 May 2023 11:38:30 +0800 Subject: [PATCH] specific only the first level when creating deb When creating a deb, directories is required to be in archive, so let find don't omit directories is required. https://stackoverflow.com/questions/4564434/why-does-my-hand-created-deb-package-fails-at-install-with-unable-to-create-on Since find will output all directories and files, the ar command will include a file twice (one when adding directory ar will include the file inside it, one specific by filename), and the second one will be a hardlink to the previous. This will case apt install failed as "error creating hard link" So now just let find output directories and files only as the first level. And deeper files will be included automatically by ar. --- makedeb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makedeb b/makedeb index c873dd7..94cb8d9 100755 --- a/makedeb +++ b/makedeb @@ -93,10 +93,10 @@ function generate_deb { local control_tgz="${tmpdir}/control.tar.gz" local debian_binary="${tmpdir}/debian-binary" - find "${pkgdir}" -mindepth 1 -not -type d -not -path "${pkgdir}/DEBIAN*" -printf "%P\n" | + find "${pkgdir}" -mindepth 1 -maxdepth 1 -not -path "${pkgdir}/DEBIAN*" -printf "%P\n" | tar -czf "${data_tgz}" -C "${pkgdir}" -T - - find "${pkgdir}/DEBIAN" -mindepth 1 -not -type d -printf "%P\n" | + find "${pkgdir}/DEBIAN" -mindepth 1 -maxdepth 1 -printf "%P\n" | tar -czf "${control_tgz}" -C "${pkgdir}/DEBIAN" -T - echo 2.0 > "${debian_binary}"