[sagemath] 01/01: Better way of preserving the docs

Ximin Luo infinity0 at debian.org
Wed Nov 16 13:38:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit 8708f8646c2a073b249f7879ef2184a940c6217c
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Nov 16 14:38:11 2016 +0100

    Better way of preserving the docs
---
 debian/rules | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/debian/rules b/debian/rules
index d9f1969..004d473 100755
--- a/debian/rules
+++ b/debian/rules
@@ -97,28 +97,26 @@ override_dh_sphinxdoc:
 
 # If we see "nodoc", don't clean the docs. This allows us to rebuild just the
 # non-docs without wiping away the docs we previously built, to save time.
-override_dh_clean:
 ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
 # Don't delete my precious docs debhelper! They took a whole fucking hour to build!
-	if [ -d debian/tmp/usr/share/doc ]; then \
-		mkdir -p debian/build/usr/share; \
-		mv -t debian/build/usr/share/ debian/tmp/usr/share/doc; \
+preserve_docs = \
+	set -e; \
+	if [ -d $(2)/usr/share/doc ]; then \
+		mkdir -p debian/clean-tmp/usr/share; \
+		mv -t debian/clean-tmp/usr/share/ $(2)/usr/share/doc; \
+	fi; \
+	$(1); \
+	if [ -d debian/clean-tmp/usr/share/doc ]; then \
+		mkdir -p $(2)/usr/share; \
+		mv -t $(2)/usr/share/ debian/clean-tmp/usr/share/doc; \
+		rm -rf debian/clean-tmp; \
 	fi
-	dh_clean
 else
-	dh_clean
-endif
-ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
-# Don't delete my precious docs debhelper! They took a whole fucking hour to build!
-	if [ -d debian/build/usr/share/doc ]; then \
-		mkdir -p debian/build-tmp/usr/share; \
-		mv -t debian/build-tmp/usr/share/ debian/build/usr/share/doc; \
-	fi
-	rm -rf debian/build/*
-	mv -t debian/build/usr/share/ debian/build-tmp/usr/share/doc
-else
-	rm -rf debian/build/*
+preserve_docs = $(1)
 endif
+override_dh_clean:
+	$(call preserve_docs,dh_clean,debian/tmp)
+	$(call preserve_docs,rm -rf debian/build/*,debian/build)
 
 get-orig-source:
 	cd sage && git archive --prefix=sagemath_$(DEB_VERSION_UPSTREAM)/sage/ \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list