From 20f61fd51ddd3de890a0e25fe91f76d844ad92fc Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Mon, 30 Jan 2017 17:37:50 +0000 Subject: [PATCH] linux-doc: Fix up symlinks to gzipped docs Some files are moving around under Documentation and being replaced with symlinks. gzip -r doesn't even check for symlinks, and fails when they're broken (which happens if the destination was found first). So use find and xargs instead, and deal with the symlinks separately. --- debian/changelog | 1 + debian/rules.real | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1e52817db..17751e4be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ linux (4.10~rc6-1~exp1) UNRELEASED; urgency=medium * net: Enable SFC_FALCON as module; SFC_FALCON_MTD * cpupower: Fix compiler options for turbostat on 4.10 * linux-doc: Update documentation file list for 4.10 + * linux-doc: Fix up symlinks to gzipped docs [ Roger Shimizu ] * debian/copyright: Add GPL/X11 Dual License diff --git a/debian/rules.real b/debian/rules.real index effda69b5..9685b0520 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -245,7 +245,16 @@ install-doc: $(STAMPS_DIR)/build-doc find * -name '*.rst' -prune -o -name objects.inv -prune \ -o -name xml -prune -o -print | \ cpio -pd --preserve-modification-time '$(CURDIR)/$(OUT_DIR)/html/newstyle' - gzip -9nqfr $(OUT_DIR)/Documentation + find $(OUT_DIR)/Documentation -type f | xargs gzip -9n +# Fix up symlinks to gzipped docs + cd $(OUT_DIR)/Documentation; \ + find -type l | while read link; do \ + dest="$$(readlink -f "$$link")"; \ + if [ -f "$$dest.gz" ]; then \ + rm -f "$$link"; \ + ln -sr "$$dest.gz" "$$link.gz"; \ + fi; \ + done +$(MAKE_SELF) install-base install-manual: PACKAGE_NAME = $(SOURCE_PACKAGE_NAME)-manual-$(VERSION)