[Git][haskell-team/haskell-devscripts][master] 3 commits: Avoid warnings when there is no X-Description in the Source section in d/control.

Felix Lechner (@lechner) gitlab at salsa.debian.org
Fri Apr 8 23:06:30 BST 2022



Felix Lechner pushed to branch master at Debian Haskell Group / haskell-devscripts


Commits:
20690638 by Felix Lechner at 2022-04-08T14:23:14-07:00
Avoid warnings when there is no X-Description in the Source section in d/control.

Avoids those warnings:

Use of uninitialized value $long_description in scalar chomp at /usr/bin/dh_haskell_blurbs line 115.
Use of uninitialized value $long_description in substitution (s///) at /usr/bin/dh_haskell_blurbs line 118.
Use of uninitialized value $long_description in substitution (s///) at /usr/bin/dh_haskell_blurbs line 121.
Use of uninitialized value $value in concatenation (.) or string at /usr/bin/dh_haskell_blurbs line 146.
Use of uninitialized value $value in concatenation (.) or string at /usr/bin/dh_haskell_blurbs line 146.

- - - - -
29cd73a3 by Felix Lechner at 2022-04-08T14:28:24-07:00
Use new Lintian tag name custom-library-search-path instead of binary-or-shlib-defines-rpath.

- - - - -
7b3f7467 by Felix Lechner at 2022-04-08T14:28:24-07:00
Combine a few build targets in hlibrary.mk.

Makes it easier to share recipes with the Debhelper build system.

- - - - -


3 changed files:

- dh_haskell_blurbs
- hlibrary.mk
- lib/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm


Changes:

=====================================
dh_haskell_blurbs
=====================================
@@ -112,6 +112,9 @@ for my $installable (@installables) {
       );
     my ($short_description, $long_description) = split(m{\n}, $description, 2);
 
+    $short_description //= $EMPTY;
+    $long_description //= $EMPTY;
+
     chomp $long_description;
 
     # drop initial spaces
@@ -139,6 +142,8 @@ exit;
 sub replace_line {
     my ($path, $field, $value) = @_;
 
+    $value //= $EMPTY;
+
     path($path)->touch;
 
     my @lines = grep { !m{^ $field = }x } path($path)->lines_utf8;


=====================================
hlibrary.mk
=====================================
@@ -1,4 +1,6 @@
 # -*- mode: makefile -*-
+#
+# Copyright 2022 Felix Lechner <felix.lechner at lease-up.com>
 # Copyright 2008 Kari Pahula <kaol at debian.org>
 # Description: A class for Haskell library packages
 #
@@ -110,6 +112,8 @@ endif
 
 DEB_BUILD_DEPENDENCIES = build-arch
 
+DEB_LINTIAN_OVERRIDES_FILE = debian/libghc-$(CABAL_PACKAGE)-dev.lintian-overrides
+
 # We call the shell for most things, so make our variables available to it
 export DEB_SETUP_BIN_NAME
 export CABAL_PACKAGE
@@ -131,64 +135,32 @@ export MAKEFILE
 export GHC_HAS_SMP 
 
 clean::
-	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ -E 'clean_recipe'
-	rm -f configure-ghc-stamp configure-ghcjs-stamp
-	rm -f build-ghc-stamp build-ghcjs-stamp build-hugs-stamp build-haddock-stamp
+	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ \
+		-E 'clean_recipe'
+	rm -f build-ghc-stamp build-hugs-stamp
 	rm -rf debian/tmp-inst-ghc debian/tmp-inst-ghcjs
 
 $(DEB_SETUP_BIN_NAME):
-	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ -E 'make_setup_recipe'
+	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ \
+		-E 'make_setup_recipe'
 
-configure-ghc-stamp: $(DEB_SETUP_BIN_NAME)
-	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ -E 'configure_recipe'
-	touch $@
-
-build-ghc-stamp: configure-ghc-stamp
-	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ -E 'build_recipe'
-	touch $@
-
-ifeq ($(DEB_ENABLE_TESTS),yes)
-ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-check-ghc-stamp: build-ghc-stamp
-	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ -E 'check_recipe'
-	touch $@
-else
-check-ghc-stamp: build-ghc-stamp
-	@echo DEB_BUILD_OPTIONS contains nocheck, not running checks
+build-ghc-stamp: $(DEB_SETUP_BIN_NAME)
+	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ \
+		-E 'configure_recipe; build_recipe; haddock_recipe; check_recipe'
 	touch $@
-endif
-else
-check-ghc-stamp: build-ghc-stamp
-	@echo DEB_ENABLE_TESTS not set to yes, not running any tests.
-	touch $@
-endif
-
-build/libghc-$(CABAL_PACKAGE)-prof build/libghc-$(CABAL_PACKAGE)-dev:: build-ghc-stamp check-ghc-stamp
-
-build/libghcjs-$(CABAL_PACKAGE)-prof build/libghcjs-$(CABAL_PACKAGE)-dev:: build-ghc-stamp check-ghc-stamp
 
-build-haddock-stamp:
-	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ -E 'haddock_recipe'
-	touch build-haddock-stamp
+build/%-dev build/%-prof build/%-doc:: build-ghc-stamp
 
-build/libghc-$(CABAL_PACKAGE)-doc:: configure-ghc-stamp build-haddock-stamp
-
-build/libghcjs-$(CABAL_PACKAGE)-doc:: configure-ghc-stamp build-haddock-stamp
+debian/tmp-inst-%: $(DEB_SETUP_BIN_NAME) build-ghc-stamp
+	$(DEB_SETUP_BIN_NAME) copy --builddir=dist-$* --destdir=$@
 
 dist-hugs: $(DEB_SETUP_BIN_NAME)
-	$(DEB_SETUP_BIN_NAME) configure --hugs --prefix=/usr -v2 --builddir=dist-hugs $(DEB_SETUP_HUGS_CONFIGURE_ARGS)
+	$(DEB_SETUP_BIN_NAME) configure --hugs --prefix=/usr -v2 \
+		--builddir=dist-hugs $(DEB_SETUP_HUGS_CONFIGURE_ARGS)
 
 build/libhugs-$(CABAL_PACKAGE):: dist-hugs
 	$(DEB_SETUP_BIN_NAME) build --builddir=dist-hugs
 
-debian/tmp-inst-ghc: $(DEB_SETUP_BIN_NAME) build-ghc-stamp
-	$(DEB_SETUP_BIN_NAME) copy --builddir=dist-ghc --destdir=debian/tmp-inst-ghc
-
-debian/tmp-inst-ghcjs: $(DEB_SETUP_BIN_NAME) build-ghc-stamp
-	$(DEB_SETUP_BIN_NAME) copy --builddir=dist-ghcjs --destdir=debian/tmp-inst-ghcjs
-
-DEB_LINTIAN_OVERRIDES_FILE = debian/libghc-$(CABAL_PACKAGE)-dev.lintian-overrides
-
 install/libghc-$(CABAL_PACKAGE)-dev:: debian/tmp-inst-ghc
 	. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
 	install_dev_recipe "$(notdir $@)"
@@ -205,11 +177,11 @@ install/libghcjs-$(CABAL_PACKAGE)-prof:: debian/tmp-inst-ghcjs install/libghcjs-
 	. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
 	install_prof_recipe "$(notdir $@)"
 
-install/libghc-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghc build-haddock-stamp
+install/libghc-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghc
 	. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
 	install_doc_recipe "$(notdir $@)"
 
-install/libghcjs-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghcjs build-haddock-stamp
+install/libghcjs-$(CABAL_PACKAGE)-doc:: debian/tmp-inst-ghcjs
 	. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
 	install_doc_recipe "$(notdir $@)"
 


=====================================
lib/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm
=====================================
@@ -866,7 +866,7 @@ sub clean_recipe {
     if (-e $ENV{DEB_LINTIAN_OVERRIDES_FILE}) {
         run(
             qw{sed -i},
-            '/binary-or-shlib-defines-rpath/ d',
+            '/custom-library-search-path/ d',
             $ENV{DEB_LINTIAN_OVERRIDES_FILE});
         run('find',$ENV{DEB_LINTIAN_OVERRIDES_FILE},qw{-empty -delete});
     }
@@ -1025,6 +1025,22 @@ sub build_recipe {
 sub check_recipe {
     my () = @_;
 
+    if ($ENV{DEB_ENABLE_TESTS} ne 'yes') {
+
+        say encode_utf8(
+'DEB_ENABLE_TESTS not set to yes, not running any build-time tests.'
+        );
+        return;
+    }
+
+    if ($ENV{DEB_BUILD_OPTIONS} =~ m{ nocheck }x) {
+
+        say encode_utf8(
+'DEB_BUILD_OPTIONS contains nocheck, not running any build-time tests.'
+        );
+        return;
+    }
+
     my $compiler = packages_hc();
     my $output = run($ENV{DEB_SETUP_BIN_NAME},
         'test', "--builddir=dist-$compiler", '--show-details=direct');
@@ -1113,10 +1129,10 @@ sub install_dev_recipe {
     }
 
     path($ENV{DEB_LINTIAN_OVERRIDES_FILE})
-      ->append_utf8('binary-or-shlib-defines-rpath' . $NEWLINE)
+      ->append_utf8('custom-library-search-path' . $NEWLINE)
       unless -e $ENV{DEB_LINTIAN_OVERRIDES_FILE}
       && path($ENV{DEB_LINTIAN_OVERRIDES_FILE})->slurp_utf8
-      =~ m{^ binary-or-shlib-defines-rpath }x;
+      =~ m{^ custom-library-search-path }x;
 
     run('dh_haskell_provides', "--package=$installable");
     run('dh_haskell_depends', "--package=$installable");



View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/compare/82f4f1ac484d51cd40de05dc384f49493cd72aab...7b3f74676497c4ef3da5cb7132a57142266d303b

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/compare/82f4f1ac484d51cd40de05dc384f49493cd72aab...7b3f74676497c4ef3da5cb7132a57142266d303b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20220408/ae46b79f/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list