Bug#794546: cross-gcc-dev: Non-empty SUFFIX causes package build failures

Juerg Haefliger <[email protected]>
Newsgroups gmane.linux.debian.devel.toolchain
Message-ID <20150804092821.9779.68186.reportbug__36155.9230056175$1438724197$gmane$org@gollum>
Package: cross-gcc-dev
Version: 45
Severity: normal
Tags: patch

Using a non-empty SUFFIX when generating sources causes subsequent build
failures of cross-gcc packages.

To reproduce:

$ TARGET_LIST=arm64 HOST_LIST=amd64 SUFFIX=.1 cross-gcc-gensource 4.9
$ cd cross-gcc-packages-amd64/cross-gcc-4.9-arm64
$ dpkg-buildpackage -us -uc

Which results in the following build failure:

repacking cpp-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb ...
dpkg-deb: building package `cpp-4.9-aarch64-linux-gnu' in `../cpp-4.9-aarch64
-linux-gnu_4.9.2-10.1_amd64.deb'.
        done
repacking gcc-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb ...
dpkg-deb: building package `gcc-4.9-aarch64-linux-gnu' in `../gcc-4.9-aarch64
-linux-gnu_4.9.2-10.1_amd64.deb'.
        done
repacking g++-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb ...
dpkg-deb: building package `g++-4.9-aarch64-linux-gnu' in `../g++-4.9-aarch64
-linux-gnu_4.9.2-10.1_amd64.deb'.
        done
repacking gfortran-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb ...
dpkg-deb: building package `gfortran-4.9-aarch64-linux-gnu' in
`../gfortran-4.9-aarch64-linux-gnu_4.9.2-10.1_amd64.deb'.
        done
START mangle-debian-files
Debs: cpp-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb gcc-4.9-aarch64-linux-
gnu_4.9.2-10_amd64.deb g++-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb
gfortran-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb
 dpkg-genchanges  >../cross-gcc-4.9-arm64_44.1_amd64.changes
dpkg-genchanges: including full source code in upload
dpkg-genchanges: error: cannot fstat file ../cpp-4.9-aarch64-linux-
gnu_4.9.2-10_amd64.deb: No such file or directory
dpkg-buildpackage: error: dpkg-genchanges gave error exit status 2

The problem is in the rules file:
/usr/share/cross-gcc/template/rules.generic

After building the packages, debian/files is generated using the macro
generate_debian_files from rules.generic. The package versions written to
debian/files are incorrect (they are missing the SUFFIX) which causes dpkg-
genchanges to fail. The attached patch fixes this issue.

--
Juerg Haefliger
Hewlett-Packard
0001-Use-FINAL_VER_GCC-as-package-version-in-debian-files.patch (text/x-diff, 1.1 KB)
>From 408b58b1f068d91afe81ed8f2412c6aaa6ecf9a9 Mon Sep 17 00:00:00 2001
From: Juerg Haefliger <[email protected]>
Date: Mon, 3 Aug 2015 13:46:23 +0200
Subject: [PATCH] Use FINAL_VER_GCC as package version in debian/files

When using a non-empty SUFFIX, the final package version FINAL_VER_GCC
is different from DEB_VER_GCC (the version from the gcc-x.y-source
package). When creating debian/files, the versions of the listed
packages need to be modified accordingly. Otherwise there's a mismatch
which causes dpkg-genchanges to fail.

Signed-off-by: Juerg Haefliger <[email protected]>
---
 template/rules.generic | 1 +
 1 file changed, 1 insertion(+)

diff --git a/template/rules.generic b/template/rules.generic
index a0fb57b..92c614f 100755
--- a/template/rules.generic
+++ b/template/rules.generic
@@ -242,6 +242,7 @@ define generate_debian_files
 		dpkg-deb -f $$deb Priority | tr -d "\n"  >>debian/files; \
 		echo "" >>debian/files; \
 	done
+	sed -i -e 's/_$(DEB_VER_GCC)_/_$(FINAL_VER_GCC)_/' debian/files
 endef
 
 mangle-debian-files: $(stamp)debian-files-base repack-debs
-- 
2.1.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.