[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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

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
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
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
repacking gfortran-4.9-aarch64-linux-gnu_4.9.2-10_amd64.deb ...
dpkg-deb: building package `gfortran-4.9-aarch64-linux-gnu' in
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
 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:

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
>From 408b58b1f068d91afe81ed8f2412c6aaa6ecf9a9 Mon Sep 17 00:00:00 2001
From: Juerg Haefliger <juerg.haefliger@hp.com>
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 <juerg.haefliger@hp.com>
 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; \
+	sed -i -e 's/_$(DEB_VER_GCC)_/_$(FINAL_VER_GCC)_/' debian/files
 mangle-debian-files: $(stamp)debian-files-base repack-debs

Reply to: