Bug#1017796: magit-forge-el: FTBFS if apt does not have deb-src lines configured
Package: magit-forge-el
Version: 0.3.1-1
Severity: normal
Tags: patch
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu kinetic ubuntu-patch
Hi Matteo,
The magit-forge-el package was failing to build in Ubuntu, because
debian/rules relies on apt-cache showsrc to figure out the paths for magit
and closql on the installed system, but the Ubuntu build environment doesn't
have deb-src entries configured (nor should it need to).
This approach is also buggy, because it looks for the most recent version of
the source package in the cache, when what you ACTUALLY want to know is the
version of the binary package that has been installed as a build-dependency.
The attached patch uses dpkg -l instead of apt-cache to query the installed
system. I have uploaded this change to Ubuntu, where it has built
successfully.
Thanks for considering,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer https://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
diff -Nru magit-forge-el-0.3.1/debian/rules magit-forge-el-0.3.1/debian/rules
--- magit-forge-el-0.3.1/debian/rules 2022-02-25 15:00:33.000000000 -0800
+++ magit-forge-el-0.3.1/debian/rules 2022-08-20 09:51:08.000000000 -0700
@@ -1,7 +1,7 @@
#!/usr/bin/make -f
-CLOSQL_VER = $(shell apt-cache showsrc closql-el | grep "Version:" | sort -r | head -n1 | cut -f2 -d ' ' | cut -f1 -d '-')
-MAGIT_VER = $(shell apt-cache showsrc magit | grep "Version:" | sort -r | head -n1 | cut -f2 -d ' ' | cut -f1 -d '-')
+CLOSQL_VER = $(shell dpkg -l elpa-closql | awk '/^ii/ { print $$3 }' | cut -f1 -d '-')
+MAGIT_VER = $(shell dpkg -l elpa-magit | awk '/^ii/ { print $$3 }' | cut -f1 -d '-')
LPATH = -L /usr/share/emacs/site-lisp/elpa-src/closql-$(CLOSQL_VER)
LPATH += -L /usr/share/emacs/site-lisp/elpa-src/magit-$(MAGIT_VER)
Reply to: