diff --git a/sysutils/debootstrap/Makefile b/sysutils/debootstrap/Makefile index 3ce842903a5d..4cfc1e70f708 100644 --- a/sysutils/debootstrap/Makefile +++ b/sysutils/debootstrap/Makefile @@ -1,48 +1,43 @@ PORTNAME= debootstrap -PORTVERSION= ${DEB_VERSION}n${DEB_NMU} -PORTREVISION= 5 +PORTVERSION= 1.0.143 CATEGORIES= sysutils MASTER_SITES= DEBIAN -DISTNAME= ${PORTNAME}_${DEB_VERSION}+nmu${DEB_NMU}+${DEB_REVISION} +DISTNAME= ${PORTNAME}_${PORTVERSION} MAINTAINER= nc@FreeBSD.org COMMENT= Install Debian or Ubuntu base system into a directory WWW= https://wiki.debian.org/Debootstrap LICENSE= MIT LICENSE_FILE= ${WRKSRC}/debian/copyright RUN_DEPENDS= ${LOCALBASE}/share/keyrings/ubuntu-archive-keyring.gpg:security/ubuntu-keyring \ bash:shells/bash \ gpgv2:security/gnupg \ gtar:archivers/gtar \ pcre2grep:devel/pcre2 \ wget:ftp/wget USES= gmake perl5 USE_PERL5= run MAKE_ENV= DATADIR="${DATADIR}" NO_ARCH= yes NO_BUILD= yes WRKSRC= ${WRKDIR}/${PORTNAME} -# The +nmu suffix used by debian for "non maintainer uploads" of a Debian -# native package doesn't play well with our versioning -DEB_VERSION= 1.0.128 -DEB_NMU= 2 -DEB_REVISION= deb12u2 - post-patch: @${REINPLACE_CMD} \ -e 's,%%DATADIR%%,${DATADIR},g' \ -e 's,%%LOCALBASE%%,${LOCALBASE},g' \ ${WRKSRC}/debootstrap @${FIND} ${WRKSRC}/scripts -type f | \ ${XARGS} ${REINPLACE_CMD} -e 's,/usr/share/keyrings,${LOCALBASE}/share/keyrings,g' post-install: + ${FIND} ${STAGEDIR}${DATADIR} -name '*.bak' -delete + ${FIND} ${STAGEDIR}${DATADIR} -name '*.orig' -delete ${INSTALL_MAN} ${WRKSRC}/debootstrap.8 \ ${STAGEDIR}${PREFIX}/share/man/man8/debootstrap.8 .include diff --git a/sysutils/debootstrap/distinfo b/sysutils/debootstrap/distinfo index 05c2a782e36a..7693d14a1d5c 100644 --- a/sysutils/debootstrap/distinfo +++ b/sysutils/debootstrap/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1756305131 -SHA256 (debootstrap_1.0.128+nmu2+deb12u2.tar.gz) = c5ff2803461978d1b5fd965ae64ea5aabef94c3126793a58e8f9a4a92c00db96 -SIZE (debootstrap_1.0.128+nmu2+deb12u2.tar.gz) = 86623 +TIMESTAMP = 1778658194 +SHA256 (debootstrap_1.0.143.tar.gz) = c638730e50d3cd8a46ff4ce8b1f74d579e9c8323974285cf3fd1ac36aa8f2ade +SIZE (debootstrap_1.0.143.tar.gz) = 99002 diff --git a/sysutils/debootstrap/files/patch-Makefile b/sysutils/debootstrap/files/patch-Makefile index 4627149a0e5a..9404ecadccf6 100644 --- a/sysutils/debootstrap/files/patch-Makefile +++ b/sysutils/debootstrap/files/patch-Makefile @@ -1,22 +1,20 @@ ---- Makefile.orig 2022-07-13 22:17:17 UTC +--- Makefile.orig 2025-04-24 17:07:30 UTC +++ Makefile -@@ -5,14 +5,13 @@ clean: +@@ -5,13 +5,13 @@ clean: clean: -DSDIR=$(DESTDIR)/usr/share/debootstrap +DSDIR=$(DESTDIR)$(DATADIR) install: mkdir -p $(DSDIR)/scripts - mkdir -p $(DESTDIR)/usr/sbin + mkdir -p $(DESTDIR)$(PREFIX)/sbin cp -a scripts/* $(DSDIR)/scripts/ -- install -o root -g root -m 0644 functions $(DSDIR)/ -+ cp -a functions $(DSDIR)/ + install -m 0644 functions $(DSDIR)/ - sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap -- chown root:root $(DESTDIR)/usr/sbin/debootstrap - chmod 0755 $(DESTDIR)/usr/sbin/debootstrap + sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)$(PREFIX)/sbin/debootstrap + chmod 0755 $(DESTDIR)$(PREFIX)/sbin/debootstrap diff --git a/sysutils/debootstrap/files/patch-debootstrap b/sysutils/debootstrap/files/patch-debootstrap index 32e164a075f3..504cf5f57b7e 100644 --- a/sysutils/debootstrap/files/patch-debootstrap +++ b/sysutils/debootstrap/files/patch-debootstrap @@ -1,58 +1,58 @@ ---- debootstrap.orig 2022-10-14 11:16:30 UTC +--- debootstrap.orig 2025-10-14 09:32:18 UTC +++ debootstrap @@ -1,4 +1,4 @@ -#!/bin/sh +#!%%LOCALBASE%%/bin/bash set -e VERSION='@VERSION@' -@@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then +@@ -14,7 +14,7 @@ if [ -z "${DEBOOTSTRAP_DIR-}" ]; then if [ -x /debootstrap/debootstrap ]; then DEBOOTSTRAP_DIR=/debootstrap else - DEBOOTSTRAP_DIR=/usr/share/debootstrap + DEBOOTSTRAP_DIR=%%DATADIR%% fi fi -@@ -379,8 +379,8 @@ if [ $# != 0 ] ; then +@@ -385,8 +385,8 @@ if [ $# != 0 ] ; then shift ;; --keyring|--keyring=?*) -- if ! gpgv --version >/dev/null 2>&1; then -- error 1 NEEDGPGV "gpgv not installed, but required for Release verification" -+ if ! gpgv2 --version >/dev/null 2>&1; then -+ error 1 NEEDGPGV "gpgv2 not installed, but required for Release verification" +- if ! in_path sopv && ! in_path sqv && ! in_path gpgv; then +- error 1 NEEDPGPV "none of sopv, sqv or gpgv are installed, but required for Release verification" ++ if ! in_path sopv && ! in_path sqv && ! in_path gpgv2; then ++ error 1 NEEDPGPV "none of sopv, sqv or gpgv2 are installed, but required for Release verification" fi if [ "$1" = "--keyring" ] && [ -n "$2" ]; then KEYRING="$2" -@@ -536,13 +536,7 @@ fi +@@ -560,13 +560,7 @@ fi ########################################################################### -if in_path dpkg && \ - dpkg --print-architecture >/dev/null 2>&1; then - HOST_ARCH=$(/usr/bin/dpkg --print-architecture) -elif in_path udpkg && \ - udpkg --print-architecture >/dev/null 2>&1; then - HOST_ARCH=$(/usr/bin/udpkg --print-architecture) -elif [ -e "$DEBOOTSTRAP_DIR/arch" ]; then +if [ -e "$DEBOOTSTRAP_DIR/arch" ]; then HOST_ARCH=$(cat "$DEBOOTSTRAP_DIR/arch") fi HOST_OS="$HOST_ARCH" -@@ -562,6 +556,14 @@ if [ -z "$HOST_OS" ]; then - HOST_OS=freebsd +@@ -589,6 +583,14 @@ if [ -z "$HOST_OS" ]; then + HOST_OS=darwin ;; esac +fi + +if [ "$HOST_OS" = "freebsd" -a -z "$HOST_ARCH" ]; then + HOST_ARCH=`/sbin/sysctl -n hw.machine_arch` + if [ "$HOST_ARCH" = "aarch64" ]; then + HOST_ARCH=arm64 + fi + EXTRACTOR_OVERRIDE=ar fi if [ -z "$ARCH" ]; then diff --git a/sysutils/debootstrap/files/patch-functions b/sysutils/debootstrap/files/patch-functions index f79f29c1e5d6..a194fe580ddf 100644 --- a/sysutils/debootstrap/files/patch-functions +++ b/sysutils/debootstrap/files/patch-functions @@ -1,72 +1,85 @@ ---- functions.orig 2024-12-29 18:30:24 UTC +--- functions.orig 2026-03-26 22:58:30 UTC +++ functions -@@ -658,7 +658,7 @@ download_release_sig () { +@@ -700,10 +700,10 @@ download_release_sig () { + info RELEASESIG "Checking Release signature" - # Don't worry about the exit status from gpgv; parsing the output will - # take care of that. -- (gpgv --status-fd 1 --keyring "$KEYRING" --ignore-time-conflict \ -+ (gpgv2 --status-fd 1 --keyring "$KEYRING" --ignore-time-conflict \ - "$relsigdest" "$reldest" || true) | read_gpg_status + # If everything is installed, prefer gpgv for now +- if in_path gpgv; then ++ if in_path gpgv2; then + # Don't worry about the exit status from gpgv; parsing the output will + # take care of that. +- (gpgv --status-fd 1 --keyring "$KEYRING" --ignore-time-conflict \ ++ (gpgv2 --status-fd 1 --keyring "$KEYRING" --ignore-time-conflict \ + "$relsigdest" "$reldest" || true) | read_gpg_status + elif in_path sopv; then + local rc=0 +@@ -715,7 +715,7 @@ download_release_sig () { + check_sqv_status "$rc" + else + # This is already checked at argument parsing time, so shouldn't happen here +- error 1 NEEDPGPV "none of sopv, sqv or gpgv are installed, but required for Release verification" ++ error 1 NEEDPGPV "none of sopv, sqv or gpgv2 are installed, but required for Release verification" + fi progress 100 100 DOWNRELSIG "Downloading Release file signature" fi -@@ -978,7 +978,7 @@ extract_dpkg_deb_field () { +@@ -1045,7 +1045,7 @@ extract_dpkg_deb_data () { extract_dpkg_deb_data () { local pkg="$1" -- dpkg-deb --fsys-tarfile "$pkg" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but file already exists. Exit..." -+ dpkg-deb --fsys-tarfile "$pkg" | gtar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but file already exists. Exit..." +- dpkg-deb --fsys-tarfile "$pkg" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but tar failed. Exit..." ++ dpkg-deb --fsys-tarfile "$pkg" | gtar $EXTRACT_DEB_TAR_OPTIONS -xf - || error 1 FILEEXIST "Tried to extract package, but tar failed. Exit..." } # Raw .deb extractors -@@ -998,7 +998,7 @@ extract_ar_deb_field () { +@@ -1065,7 +1065,7 @@ extract_ar_deb_field () { if in_path $cat_cmd; then ar -p "$pkg" "$tarball" | $cat_cmd | - tar -O -xf - control ./control 2>/dev/null | + gtar -O -xf - control ./control 2>/dev/null | grep -i "^$field:" | sed -e 's/[^:]*: *//' | head -n 1 else error 1 UNPACKCMDUNVL "Extracting %s requires the %s command, which is not available" "$pkg" "$cat_cmd" -@@ -1020,7 +1020,7 @@ extract_ar_deb_data () { +@@ -1087,7 +1087,7 @@ extract_ar_deb_data () { esac if in_path "$cat_cmd"; then - ar -p "$pkg" "$tarball" | "$cat_cmd" | tar $EXTRACT_DEB_TAR_OPTIONS -xf - + ar -p "$pkg" "$tarball" | "$cat_cmd" | gtar $EXTRACT_DEB_TAR_OPTIONS -xf - else error 1 UNPACKCMDUNVL "Extracting %s requires the %s command, which is not available" "$pkg" "$cat_cmd" fi -@@ -1614,7 +1614,7 @@ while (read STDIN, $x, 1) { +@@ -1696,7 +1696,7 @@ while (read STDIN, $x, 1) { }' "$@" elif [ "$1" = "GETDEPS" ]; then local pkgdest="$2"; shift; shift --LC_ALL=C grep "$gropt" '^$|^Package:|^Depends:|^Pre-Depends:' $pkgdest | perl -e ' -+LC_ALL=C pcre2grep '^$|^Package:|^Depends:|^Pre-Depends:' $pkgdest | perl -e ' +-LC_ALL=C grep "$gropt" '^$|^Package:|^Depends:|^Pre-Depends:' "${pkgdest}" | perl -e ' ++LC_ALL=C pcre2grep '^$|^Package:|^Depends:|^Pre-Depends:' "${pkgdest}" | perl -e ' %seen = map { $_ => 1 } @ARGV; while () { if (/^Package: (.*)$/) { -@@ -1642,13 +1642,13 @@ while () { +@@ -1724,13 +1724,13 @@ while () { local m="$2" local p="$3" shift; shift; shift - LC_ALL=C grep "$gropt" '^$|^Architecture:|^Filename:|^MD5sum:|^Package:|^Priority:|^SHA256:|^Size:|^Version:|^Depends:|^Pre-Depends:' "$p" | pkgdetails_field 1 Package: "$m" "$@" + LC_ALL=C pcre2grep '^$|^Architecture:|^Filename:|^MD5sum:|^Package:|^Priority:|^SHA256:|^Size:|^Version:|^Depends:|^Pre-Depends:' "$p" | pkgdetails_field 1 Package: "$m" "$@" elif [ "$1" = "FIELD" ]; then local f="$2" local m="$3" local p="$4" shift; shift; shift; shift -- LC_ALL=C grep "$gropt" '^$|^Package:|^Priority:' "$p" | pkgdetails_field 0 "$f" "$m" "$@" -+ LC_ALL=C pcre2grep '^$|^Package:|^Priority:' "$p" | pkgdetails_field 0 "$f" "$m" "$@" +- LC_ALL=C grep "$gropt" '^$|^Package:|^Priority:|^Essential:' "$p" | pkgdetails_field 0 "$f" "$m" "$@" ++ LC_ALL=C pcre2grep '^$|^Package:|^Priority:|^Essential:' "$p" | pkgdetails_field 0 "$f" "$m" "$@" elif [ "$1" = "STANZAS" ]; then local pkgdest="$2"; shift; shift perl -e ' -@@ -1805,7 +1805,7 @@ read_gpg_status () { +@@ -1941,7 +1941,7 @@ read_gpg_status () { elif [ "$unkkey" ]; then error 1 UNKNOWNRELSIG "Release signed by unknown key (key id %s)\n The specified keyring $KEYRING may be incorrect or out of date.\n You can find the latest Debian release key at https://ftp-master.debian.org/keys.html" "$unkkey" else - error 1 SIGCHECK "Error executing gpgv to check Release signature" + error 1 SIGCHECK "Error executing gpgv2 to check Release signature" fi } diff --git a/sysutils/debootstrap/files/patch-scripts-gutsy b/sysutils/debootstrap/files/patch-scripts-gutsy index 18b91b19d176..75693c2ba411 100644 --- a/sysutils/debootstrap/files/patch-scripts-gutsy +++ b/sysutils/debootstrap/files/patch-scripts-gutsy @@ -1,51 +1,51 @@ ---- scripts/gutsy.orig 2023-02-08 17:55:01 UTC +--- scripts/gutsy.orig 2026-03-26 22:58:30 UTC +++ scripts/gutsy -@@ -296,10 +296,21 @@ echo \"Warning: Fake initctl called, doing nothing\"" +@@ -302,10 +302,21 @@ echo \"Warning: Fake initctl called, doing nothing\"" predep=$(without "$(without "$(resolve_deps $predep)" "$required")" "$done_predeps") # XXX: progress is tricky due to how dpkg_progress works # -- cjwatson 2009-07-29 + # This step sometimes fails due to some missing functionality in Linuxulator. Just ignore it. + set +e p; smallyes '' | in_target dpkg --force-overwrite --force-confold --skip-same-version --install $(debfor $predep) + rc=$? base=$(without "$base" "$predep") done_predeps="$done_predeps $predep" + + if [ $rc != 0 ]; then + warning FREEBSD_00 "Applying FreeBSD-specific workaround..." + # ... for "Failed to mount /etc/machine-id: Bad address" with Focal. + in_target truncate -s0 /var/lib/dpkg/info/systemd.postinst + in_target dpkg --configure systemd + fi + set -e done if [ -n "$base" ]; then -@@ -310,10 +321,13 @@ echo \"Warning: Fake initctl called, doing nothing\"" +@@ -316,10 +327,13 @@ echo \"Warning: Fake initctl called, doing nothing\"" info CONFBASE "Configuring the base system..." + # This step sometimes fails due to some missing functionality in Linuxulator. Just ignore it. + set +e smallyes '' | (repeatn 5 in_target_failmsg CONF_BASE_FAIL_FIVE "Failure while configuring base packages. This will be re-attempted up to five times." "" \ dpkg --status-fd 8 --force-confold --skip-same-version --configure -a 8>&1 1>&7 || echo EXITCODE $?) | - dpkg_progress $baseprog $bases CONFBASE "Configuring base system" CONFIGURING + dpkg_progress $baseprog "$bases" CONFBASE "Configuring base system" CONFIGURING + set -e fi if [ -x "$TARGET/sbin/initctl.REAL" ]; then -@@ -321,6 +335,12 @@ echo \"Warning: Fake initctl called, doing nothing\"" +@@ -327,6 +341,12 @@ echo \"Warning: Fake initctl called, doing nothing\"" fi mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon" rm -f "$TARGET/usr/sbin/policy-rc.d" + + echo \ +"# Workaround for Linuxulator missing mremap(2) support; without it, +# apt(8) fails like this: +# E: Dynamic MMap ran out of room. Please increase the size of APT::Cache-Start. +APT::Cache-Start 251658240;" >> "$TARGET/etc/apt/apt.conf.d/00freebsd" - progress $bases $bases CONFBASE "Configuring base system" + progress "$bases" "$bases" CONFBASE "Configuring base system" info BASESUCCESS "Base system installed successfully." diff --git a/sysutils/debootstrap/pkg-plist b/sysutils/debootstrap/pkg-plist index 48844c2652e5..f97ab5a61e4a 100644 --- a/sysutils/debootstrap/pkg-plist +++ b/sysutils/debootstrap/pkg-plist @@ -1,81 +1,116 @@ -share/man/man8/debootstrap.8.gz sbin/debootstrap %%DATADIR%%/functions %%DATADIR%%/scripts/aequorea %%DATADIR%%/scripts/amber +%%DATADIR%%/scripts/aramo +%%DATADIR%%/scripts/aria %%DATADIR%%/scripts/artful %%DATADIR%%/scripts/ascii +%%DATADIR%%/scripts/awen %%DATADIR%%/scripts/bartholomea +%%DATADIR%%/scripts/belenos %%DATADIR%%/scripts/beowulf +%%DATADIR%%/scripts/bianca %%DATADIR%%/scripts/bionic %%DATADIR%%/scripts/bookworm %%DATADIR%%/scripts/breezy +%%DATADIR%%/scripts/brigantia %%DATADIR%%/scripts/bullseye %%DATADIR%%/scripts/buster %%DATADIR%%/scripts/byzantium %%DATADIR%%/scripts/ceres %%DATADIR%%/scripts/chromodoris %%DATADIR%%/scripts/cosmic %%DATADIR%%/scripts/crimson +%%DATADIR%%/scripts/dagda %%DATADIR%%/scripts/dapper %%DATADIR%%/scripts/dasyatis +%%DATADIR%%/scripts/dawn %%DATADIR%%/scripts/debian-common %%DATADIR%%/scripts/disco +%%DATADIR%%/scripts/dwyn +%%DATADIR%%/scripts/echo +%%DATADIR%%/scripts/ecne %%DATADIR%%/scripts/edgy +%%DATADIR%%/scripts/elxr %%DATADIR%%/scripts/eoan %%DATADIR%%/scripts/etch %%DATADIR%%/scripts/etch-m68k +%%DATADIR%%/scripts/etiona %%DATADIR%%/scripts/feisty +%%DATADIR%%/scripts/flidas %%DATADIR%%/scripts/focal +%%DATADIR%%/scripts/forky %%DATADIR%%/scripts/groovy %%DATADIR%%/scripts/gutsy %%DATADIR%%/scripts/hardy %%DATADIR%%/scripts/hirsute %%DATADIR%%/scripts/hoary %%DATADIR%%/scripts/hoary.buildd %%DATADIR%%/scripts/impish %%DATADIR%%/scripts/intrepid %%DATADIR%%/scripts/jammy %%DATADIR%%/scripts/jaunty %%DATADIR%%/scripts/jessie %%DATADIR%%/scripts/jessie-kfreebsd %%DATADIR%%/scripts/kali %%DATADIR%%/scripts/kali-dev %%DATADIR%%/scripts/kali-last-snapshot %%DATADIR%%/scripts/kali-rolling %%DATADIR%%/scripts/karmic %%DATADIR%%/scripts/kinetic +%%DATADIR%%/scripts/landing %%DATADIR%%/scripts/lenny +%%DATADIR%%/scripts/lory %%DATADIR%%/scripts/lucid +%%DATADIR%%/scripts/lunar +%%DATADIR%%/scripts/mantic %%DATADIR%%/scripts/maverick +%%DATADIR%%/scripts/nabia %%DATADIR%%/scripts/natty +%%DATADIR%%/scripts/noble %%DATADIR%%/scripts/oldoldstable %%DATADIR%%/scripts/oldstable +%%DATADIR%%/scripts/ondokuz %%DATADIR%%/scripts/oneiric +%%DATADIR%%/scripts/onyedi +%%DATADIR%%/scripts/oracular +%%DATADIR%%/scripts/pardus +%%DATADIR%%/scripts/parrot +%%DATADIR%%/scripts/plucky %%DATADIR%%/scripts/potato %%DATADIR%%/scripts/precise %%DATADIR%%/scripts/quantal +%%DATADIR%%/scripts/questing %%DATADIR%%/scripts/raring +%%DATADIR%%/scripts/resolute +%%DATADIR%%/scripts/robur %%DATADIR%%/scripts/sarge %%DATADIR%%/scripts/sarge.buildd %%DATADIR%%/scripts/sarge.fakechroot %%DATADIR%%/scripts/saucy %%DATADIR%%/scripts/sid +%%DATADIR%%/scripts/slaine %%DATADIR%%/scripts/squeeze %%DATADIR%%/scripts/stable %%DATADIR%%/scripts/stretch +%%DATADIR%%/scripts/taranis %%DATADIR%%/scripts/testing +%%DATADIR%%/scripts/toutatis %%DATADIR%%/scripts/trixie %%DATADIR%%/scripts/trusty %%DATADIR%%/scripts/unstable %%DATADIR%%/scripts/utopic %%DATADIR%%/scripts/vivid %%DATADIR%%/scripts/warty %%DATADIR%%/scripts/warty.buildd %%DATADIR%%/scripts/wheezy %%DATADIR%%/scripts/wily %%DATADIR%%/scripts/woody %%DATADIR%%/scripts/woody.buildd %%DATADIR%%/scripts/xenial %%DATADIR%%/scripts/yakkety +%%DATADIR%%/scripts/yirmibir +%%DATADIR%%/scripts/yirmiuc %%DATADIR%%/scripts/zesty +share/man/man8/debootstrap.8.gz