On Mon, Apr 14, 2025 at 11:25:11AM +0200, Agustin Martin wrote: > Control: tags -1 + patch > > On Sun, Aug 13, 2023 at 09:20:47PM +0200, Lucas Nussbaum wrote: > > Source: hplip > > Version: 3.22.10+dfsg0-2 > > Severity: minor > > Tags: trixie sid ftbfs > > User: lu...@debian.org > > Usertags: ftbfs-sab-20230813 ftbfs-source-after-build > > User: debian...@lists.debian.org > > Usertags: qa-doublebuild > > > > Hi, > > > > This package fails to build a source package after a successful build > > (dpkg-buildpackage ; dpkg-buildpackage -S). > [...] > > > dpkg-source: warning: file > > > hplip-3.22.10+dfsg0/prnt/drv/foomatic_xml/hpijs/HP-tango.xml has no final > > > newline (either original or modified version) > > > dpkg-source: warning: file > > > hplip-3.22.10+dfsg0/prnt/drv/foomatic_xml/hpijs/hpijs.xml has no final > > > newline (either original or modified version) > > > dpkg-source: error: unrepresentable changes to source > > > dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit > > > status 1 > > > > > > E: Command 'cd /<<PKGBUILDDIR>> && runuser -u user42 -- dpkg-buildpackage > > > --sanitize-env -us -uc -rfakeroot -S' failed to run. > > > I am attaching a patch with the changes I tested in my box. Here, they > make package successfully build twice.
Safer version of patch attached. Should work better with multiple "debian/rules clean" invocations. -- Agustin
>From 587c9d2cea0cc7fa5825e444eef08f4eed729537 Mon Sep 17 00:00:00 2001 From: Agustin Martin Domingo <agmar...@debian.org> Date: Mon, 14 Apr 2025 10:28:56 +0200 Subject: [PATCH] d/rules: Make sure things are restored on clean target (#1046748). This should allow building full package after successful build. Many things are changed under ppd, just gunzipping things is not enough, better restore initial contents from scratch. Other things left behind are removed or restored by this patch. --- debian/rules | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index f7c2b68..56b94d5 100755 --- a/debian/rules +++ b/debian/rules @@ -37,6 +37,9 @@ GZIP = gzip -n --best override_dh_autoreconf: dh_autoreconf --as-needed sh -- debian/autogen.sh +debian_previous_bkp.tar.gz: + tar -cvzf $@ cups_drv.inc foomatic_drv.inc ppd prnt/drv + # Clean everything up, including everything auto-generated # at build time that needs not to be kept around in the Debian diff override_dh_clean: @@ -47,13 +50,24 @@ override_dh_clean: find -type d -name build -print0 | xargs -0 -r rm -rf \; # We prefer to regenerate these using pyuic (cd ui5 && for i in *.ui ; do rm -f $${i%.ui}.py ; done) - + # Other autogenerated stuff that is left behind. + rm -rf prnt/drv/foomatic_xml + rm -f Dat2drv prnt/hpcups/libImageProcessor.so + rm -rf ppd/hpijs + rm -f ppd/hpcups/hp-laserjet_cp_1025nw.ppd \ + ppd/hpcups/hp-laserjet_professional_p1102w.ppd + # Many modified files under ppd, better restore from scratch. + if [ -r debian_previous_bkp.tar.gz ]; then \ + find . -name '*.ppd.gz' | xargs rm -f; \ + tar xvzf debian_previous_bkp.tar.gz; \ + rm -f debian_previous_bkp.tar.gz; \ + fi ## ## Package build ## -override_dh_auto_configure: +override_dh_auto_configure: debian_previous_bkp.tar.gz dh_auto_configure -- \ PYTHON="$(PYTHON)" \ --config-cache \ -- 2.49.0