Patchwork [6,of,6] packaging: "make deb" no longer fails

login
register
mail settings
Submitter via Mercurial-devel
Date Oct. 9, 2018, 9:29 p.m.
Message ID <5d892da53728de160568.1539120568@cuben.lan>
Download mbox | patch
Permalink /patch/35587/
State New
Headers show

Comments

via Mercurial-devel - Oct. 9, 2018, 9:29 p.m.
# HG changeset patch
# User muxator <a.mux@inwind.it>
# Date 1539116950 -7200
#      Tue Oct 09 22:29:10 2018 +0200
# Node ID 5d892da53728de160568a72a37dda9abcf1f7e9a
# Parent  4d7d83159122473ab69f9b9c16fab69d10232d78
packaging: "make deb" no longer fails

Release 4.7 rationalized the layout of the build scripts.
Unfortunately, while "make docker-ubuntu-*" and "make docker-debian-*" worked as
expected, "make deb" was broken.

Before this change "make deb" was failing with the following error:
    You are not inside a Mercurial repository!

Or, after the latest changes:
    You are inside <fullpath>, which is not the root of a Mercurial repository

Moreover, when "make deb" failed, the cleanup routine deleted the wrong
directory (contrib/packaging/debian instead of <reporoot>/debian) resulting in
a corrupted working copy that needed to be hg revert-ed.

After this change the docker targets continue to work, and the deb one is able
to finish.
Augie Fackler - Oct. 10, 2018, 8:27 a.m.
On Tue, Oct 09, 2018 at 11:29:28PM +0200, Antonio Muci via Mercurial-devel wrote:
> # HG changeset patch
> # User muxator <a.mux@inwind.it>
> # Date 1539116950 -7200
> #      Tue Oct 09 22:29:10 2018 +0200
> # Node ID 5d892da53728de160568a72a37dda9abcf1f7e9a
> # Parent  4d7d83159122473ab69f9b9c16fab69d10232d78
> packaging: "make deb" no longer fails

queued, thanks

Patch

diff --git a/contrib/packaging/builddeb b/contrib/packaging/builddeb
--- a/contrib/packaging/builddeb
+++ b/contrib/packaging/builddeb
@@ -16,7 +16,7 @@  DEBFLAGS=-b
 
 cleanup() {
     if [ "$CLEANUP" ]; then
-        rm -r "$PWD/debian";
+        rm -r "$ROOTDIR/debian";
     fi
 }
 
@@ -51,6 +51,8 @@  while [ "$1" ]; do
     esac
 done
 
+cd "$ROOTDIR"
+
 trap 'cleanup' EXIT
 
 set -u