From f46271e7749991402234575bde0fde6c5fd911e5 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Sun, 14 Dec 2025 12:59:18 +0100 Subject: [PATCH 1/5] Explicitly use bash with fakeroot If no command is specified, fakeroot will default to using whatever login shell the user has. In my case, this is nushell, which breaks the heredoc script piped into fakeroot. --- debtap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debtap b/debtap index 3b5d0a1..e265099 100755 --- a/debtap +++ b/debtap @@ -3259,7 +3259,7 @@ bsdtar -czf .MTREE --format=mtree --options='!all,use-set,type,uid,gid,mode,time # Creating final package in a fakeroot environment if [[ $Pkgbuild != set ]]; then echo -e "\n${lightgreen}==>${NC} ${bold}Creating final package...${normal}" -fakeroot << EOF +fakeroot /usr/bin/bash << EOF tar --force-local -pcf $(grep '^pkgname =' .PKGINFO | gawk '{print $3}')-$(grep '^pkgver =' .PKGINFO | gawk '{print $3}')-$(grep '^arch =' .PKGINFO | gawk '{print $3}').pkg.tar --exclude='pkgbuildinstallations*' * .PKGINFO .INSTALL .MTREE 2> /dev/null zstd -q -T0 --ultra -15 *.tar EOF From 5e726f6e263009339c223ac7d5f47ea259473735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Petazzoni?= Date: Thu, 30 Jul 2026 20:27:57 +0200 Subject: [PATCH 2/5] Add a couple of missing package dependencies in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6743848..dc111eb 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A script for converting .deb packages into Arch Linux packages, focused on accur **Q: What are the minimum requirements to run this script?** -**A:** You need to have installed these dependencies: `bash`, `binutils` (provides ar utility for extracting .deb package and readelf), `pkgfile` and `fakeroot`.You must run at least once (preferably recently) `debtap -u` to create/update pkgfile and debtap database (you do this with root privileges). +**A:** You need to have installed these dependencies: `bash`, `binutils` (provides ar utility for extracting .deb package and readelf), `pkgfile`, `fakeroot`, `pacman-contrib`, and `namcap`. You must run at least once (preferably recently) `debtap -u` to create/update pkgfile and debtap database (you do this with root privileges). **Q: Debtap needs a lot of time to convert a package. So, why this is happening?** From 236525dcd713d9bab02f53f19da331d6a64f3d05 Mon Sep 17 00:00:00 2001 From: Andrea Manenti Date: Fri, 7 Aug 2026 11:00:06 -0700 Subject: [PATCH 3/5] Added 'case "$1" in' variant in the sed of postinst --- debtap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debtap b/debtap index 3b5d0a1..1bdee2d 100755 --- a/debtap +++ b/debtap @@ -3096,7 +3096,7 @@ fi if [[ -e postinst ]]; then sed -i -e '/how this script works/,/debian-policy/d' -e '/how this script works/,/version>/d' -e '/dh_installdeb/,/DEBHELPER/d' postinst if [[ $(grep -c "case in \$1\|case in \${1}\|case in \"\$1\"\|case in \"\${1}\"\|case \$1 in\|case \${1} in\|case \"\$1\" in\|case \"\${1}\" in" postinst) == $(grep -c "case " postinst) ]]; then - sed -i -e '/case in \$1/,/configure/{/configure/!d}' -e '/case in \${1}/,/configure/{/,configure/!d}' -e '/case in "\$1"/,/configure/{/configure/!d}' -e '/case in "\${1}"/,/configure/{/,configure/!d}' -e '/case \$1 in/,/configure/{/configure/!d}' -e '/case \${1} in/,/configure/{/,configure/!d}' -e '/case in "\$1"/,/configure/{/configure/!d}' -e '/case "\${1}" in/,/configure/{/,configure/!d}' -e '/;;/,/esac/{/;;/!d}' postinst + sed -i -e '/case in \$1/,/configure/{/configure/!d}' -e '/case in \${1}/,/configure/{/,configure/!d}' -e '/case in "\$1"/,/configure/{/configure/!d}' -e '/case in "\${1}"/,/configure/{/,configure/!d}' -e '/case \$1 in/,/configure/{/configure/!d}' -e '/case \${1} in/,/configure/{/,configure/!d}' -e '/case in "\$1"/,/configure/{/configure/!d}' -e '/case "\$1" in/,/configure/{/configure/!d}' -e '/case "\${1}" in/,/configure/{/,configure/!d}' -e '/;;/,/esac/{/;;/!d}' postinst sed -i -e '/[[:blank:]]\{0,\}lintian.*/,/}/d' -e '/[[:blank:]]\{0,\}if.*update-app-install.*/,/fi/d' -e '/[[:blank:]]\{0,\}if.*update-software-center.*/,/fi/d' -e '/[[:blank:]]\{0,\}if.*RET.*/,/fi/d' -e '/.*\*)[[:blank:]]\{0,\}/,/esac/d' postinst sed -i -e '/.*configure.*)[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/d' -e '/^[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/d' postinst sed -i -e s'/.*\*)[[:blank:]]{0,\}\(.*\)/\1/g' -e s'/.*configure.*)[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^[[:blank:]]\{0,\};;[[:blank:]]\{0,\}\(.*\)$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit 0[[:blank:]]\{0,\}$/\1/g' -e s'/^\(.*\)[[:blank:]]\{0,\}\(; \)\{0,1\}\( && \)\{0,1\}[[:blank:]]\{0,\}exit[[:blank:]]\{0,\}$/\1/g' postinst From 18b5417f0a8325c294950bab5c7c6cf550d1e6a0 Mon Sep 17 00:00:00 2001 From: Wyndar <111346189+Wyndar@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:25:28 +0100 Subject: [PATCH 4/5] Add patch for pkgfile 26 cache detection --- patches/0001-fix-pkgfile-26-cache-detection.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/0001-fix-pkgfile-26-cache-detection.patch diff --git a/patches/0001-fix-pkgfile-26-cache-detection.patch b/patches/0001-fix-pkgfile-26-cache-detection.patch new file mode 100644 index 0000000..176f976 --- /dev/null +++ b/patches/0001-fix-pkgfile-26-cache-detection.patch @@ -0,0 +1,12 @@ +From: Wyndar maintenance fork +Subject: [PATCH] Fix pkgfile 26 cache detection + +Current pkgfile writes cache files as .files. Older versions may use +.files.NNN. The existing expression starts with a bare '*' and requires +the numeric suffix, so debtap rejects a freshly updated pkgfile 26 database. + +--- a/debtap ++++ b/debtap +@@ +-if [[ ! $(ls /var/cache/pkgfile | grep -E '*.files?(.[[:digit:]]{3})' 2> /dev/null) ]] || [[ ! $(ls /var/cache/debtap/*-packages-files 2> /dev/null) ]] || [[ ! -e /var/cache/debtap/extended-base-packages-list ]] || [[ ! -e /var/cache/debtap/aur-packages ]] || [[ ! -e /var/cache/debtap/virtual-packages ]]; then ++if [[ ! $(ls /var/cache/pkgfile 2> /dev/null | grep -E '\.files(\.[[:digit:]]{3})?$') ]] || [[ ! $(ls /var/cache/debtap/*-packages-files 2> /dev/null) ]] || [[ ! -e /var/cache/debtap/extended-base-packages-list ]] || [[ ! -e /var/cache/debtap/aur-packages ]] || [[ ! -e /var/cache/debtap/virtual-packages ]]; then From 0b5e4c8960f169464d70793fb002838092e26612 Mon Sep 17 00:00:00 2001 From: Wyndar <111346189+Wyndar@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:25:41 +0100 Subject: [PATCH 5/5] Add patch for robust Ubuntu release detection --- patches/0002-use-ubuntu-meta-release.patch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 patches/0002-use-ubuntu-meta-release.patch diff --git a/patches/0002-use-ubuntu-meta-release.patch b/patches/0002-use-ubuntu-meta-release.patch new file mode 100644 index 0000000..99953a4 --- /dev/null +++ b/patches/0002-use-ubuntu-meta-release.patch @@ -0,0 +1,16 @@ +From: Wyndar maintenance fork +Subject: [PATCH] Use Ubuntu's machine-readable release metadata + +The packages.ubuntu.com HTML parser depends on option ordering and currently +selects a release whose archive Contents file does not exist, causing `debtap +-u` to fail with HTTP 404. Ubuntu maintains changelogs.ubuntu.com/meta-release +specifically as machine-readable stable-release metadata. + +--- a/debtap ++++ b/debtap +@@ +- ubuntu_latest_stable_version=$(curl -k -s https://packages.ubuntu.com | grep option | gawk -F '=' '{print $2}' | gawk '{print $1}' | grep -v option | tac | sed -n 3'{p;q;}' | sed s'/(\"\|-updated\|-backports\)//g') ++ ubuntu_latest_stable_version=$(curl -fsSL https://changelogs.ubuntu.com/meta-release | gawk -F ': ' '$1 == "Dist" { dist=$2 } $1 == "Supported" && $2 == "1" { latest=dist } END { print latest }') ++ if [[ -z "$ubuntu_latest_stable_version" ]]; then ++ echo -e "${red}Unable to determine the latest supported Ubuntu release. Exiting...${NC}"; exit 1 ++ fi