On Fri, 22 Nov 2013, Faheem Mitha wrote:

On looking at this more closely, I see the problem. As you can see from the error message, the errors occur at the lines

# Move templates and help installed by setup.py to their FHS-correct location

mv $(CURDIR)/debian/mercurial-common/usr/lib/python*/dist-packages/mercurial/templates $(CURDIR)/debian/mercurial-common/usr/lib/python*/dist-packages/mercurial/help $(CURDIR)/debian/mercurial-common/usr/share/mercurial

mv $(CURDIR)/debian/mercurial-common/usr/lib/python*/dist-packages/mercurial/locale $(CURDIR)/debian/mercurial-common/usr/share

On my system I have both python 2.6 and 2.7 installed. So I have two directories under debian/mercurial-common/usr/lib, namely 'python2.6' and 'python2.7',

faheem@orwell:/usr/local/src/mercurial/mercurial-2.8/debian/mercurial-common/usr/lib$ ls
python2.6  python2.7

Ok, so given that this is the case, the problem is obvious. Because of the wild card, each of these commands runs twice, for each version of python, and presumably tries to copy the same files each time. So, it fails the second time because the files are already there.

I looked at the packaging for mercurial 2.7.2, and those lines were not there. So I guess they were added recently. It looks to me like they are buggy.

The attached patch fixes this for me. I'm not guaranteeing that it is
correct, of course.

                                                      Regards, Faheem
diff -r 28fe2be2eabb rules
--- a/rules
+++ b/rules
@@ -8,6 +8,7 @@
        dh $@ --with python2,bash-completion
 
 PYVERS=$(shell pyversions -vs)
+DEFAULT_PYVER=$(shell pyversions -dv)
 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
 override_dh_auto_build:
@@ -77,8 +78,8 @@
                debian/cacerts.hgrc \
                
$(CURDIR)/debian/mercurial-common/etc/mercurial/hgrc.d/cacerts.rc
        # Move templates and help installed by setup.py to their FHS-correct 
location
-       mv 
$(CURDIR)/debian/mercurial-common/usr/lib/python*/dist-packages/mercurial/templates
 $(CURDIR)/debian/mercurial-common/usr/lib/python*/dist-packages/mercurial/help 
$(CURDIR)/debian/mercurial-common/usr/share/mercurial
-       mv 
$(CURDIR)/debian/mercurial-common/usr/lib/python*/dist-packages/mercurial/locale
 $(CURDIR)/debian/mercurial-common/usr/share
+       mv 
$(CURDIR)/debian/mercurial-common/usr/lib/python$(DEFAULT_PYVER)/dist-packages/mercurial/templates
 
$(CURDIR)/debian/mercurial-common/usr/lib/python$(DEFAULT_PYVER)/dist-packages/mercurial/help
 $(CURDIR)/debian/mercurial-common/usr/share/mercurial
+       mv 
$(CURDIR)/debian/mercurial-common/usr/lib/python$(DEFAULT_PYVER)/dist-packages/mercurial/locale
 $(CURDIR)/debian/mercurial-common/usr/share
        # remove arch-dependent python stuff
        find debian/mercurial-common/usr/lib \
                -name '*.so' ! -type d -delete , \

Reply via email to