From 469a1ed79fa6192b0d8f76331c0d05b2f6f501e3 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 28 Aug 2015 15:12:40 +0200 Subject: [PATCH] Ensure that eatmydata version on host is recent enough Otherwise when e.g. building Debian/jessie on Ubuntu 14.04 causes: | ERROR: ld.so: object 'libeatmydata.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. --- scripts/build-and-provide-package | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/scripts/build-and-provide-package b/scripts/build-and-provide-package index 2bdc0aa..6fc78f2 100755 --- a/scripts/build-and-provide-package +++ b/scripts/build-and-provide-package @@ -566,19 +566,23 @@ use_eatmydata() { if ! dpkg-query --show --showformat='${Status}' eatmydata | grep -q '^install' ; then echo "*** eatmydata missing on host system, not considering for usage (force via USE_EATMYDATA=true) ***" else - echo "*** eatmydata is present on host system, now checking distribution support ***" - case "${COWBUILDER_DIST}" in - etch|lenny|squeeze|wheezy) - echo "*** Debian release $COWBUILDER_DIST doesn't provide eatmydata >=82-6, skipping eatmydata ***" - ;; - warty|hoary|breezy|dapper|edgy|feisty|gutsy|hardy|intrepid|jaunty|karmi|lucid|maverick|natty|oneiric|quantal|raring|saucy|utopic|precise|trusty) - echo "*** Ubuntu release $COWBUILDER_DIST doesn't provide eatmydata >=82-6, skipping eatmydata ***" - ;; - *) - echo "*** Distribution ${COWBUILDER_DIST} should provide recent eatmydata support, enabling eatmydata ***" - enable_eatmydata - ;; - esac + if ! dpkg --compare-versions "$(dpkg-query --show --showformat='${Version}' eatmydata)" gt '26-2' ; then + echo "*** eatmydata version on host needs to be newer than v26-2 (>=82-6 is recommended), skipping eatmydata ***" + else + echo "*** eatmydata is present on host system, now checking distribution support ***" + case "${COWBUILDER_DIST}" in + etch|lenny|squeeze|wheezy) + echo "*** Debian release $COWBUILDER_DIST doesn't provide eatmydata >=82-6, skipping eatmydata ***" + ;; + warty|hoary|breezy|dapper|edgy|feisty|gutsy|hardy|intrepid|jaunty|karmi|lucid|maverick|natty|oneiric|quantal|raring|saucy|utopic|precise|trusty) + echo "*** Ubuntu release $COWBUILDER_DIST doesn't provide eatmydata >=82-6, skipping eatmydata ***" + ;; + *) + echo "*** Distribution ${COWBUILDER_DIST} should provide recent eatmydata support, enabling eatmydata ***" + enable_eatmydata + ;; + esac + fi fi fi }