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?** diff --git a/debtap b/debtap index 3b5d0a1..c1fe5b9 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 @@ -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 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 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