Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?**

Expand Down
4 changes: 2 additions & 2 deletions debtap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions patches/0001-fix-pkgfile-26-cache-detection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
From: Wyndar maintenance fork
Subject: [PATCH] Fix pkgfile 26 cache detection

Current pkgfile writes cache files as <repo>.files. Older versions may use
<repo>.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
16 changes: 16 additions & 0 deletions patches/0002-use-ubuntu-meta-release.patch
Original file line number Diff line number Diff line change
@@ -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