[Git][haskell-team/haskell-devscripts][master] 2 commits: Call install_recipe via Perl hook; encode_utf8 was incorrect for the path, anyway.

Felix Lechner (@lechner) gitlab at salsa.debian.org
Mon Apr 11 16:39:10 BST 2022



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


Commits:
cb4c82ce by Felix Lechner at 2022-04-11T07:30:41-07:00
Call install_recipe via Perl hook; encode_utf8 was incorrect for the path, anyway.

- - - - -
71fa2f66 by Felix Lechner at 2022-04-11T07:45:20-07:00
Try Description field in Source section before X-Description in d/control. (See: #1009162)

- - - - -


3 changed files:

- Dh_Haskell.sh
- dh_haskell_blurbs
- hlibrary.mk


Changes:

=====================================
Dh_Haskell.sh
=====================================
@@ -28,7 +28,3 @@ recipe(){
 hashed_dependency(){
     recipe "${FUNCNAME[0]}" "$@"
 }
-
-install_recipe(){
-    recipe "${FUNCNAME[0]}" "$@"
-}


=====================================
dh_haskell_blurbs
=====================================
@@ -108,11 +108,12 @@ for my $installable (@installables) {
     replace_line($substvars_path, 'haskell:ShortBlurb',$short_blurb // $EMPTY);
     replace_line($substvars_path, 'haskell:Blurb', $blurb // $EMPTY);
 
-    # need regex to avoid the empty string, which would be filtered by run()
-    my $description
-      = run(
-        qw{grep-dctrl --no-field-names --show-field=X-Description --field=Source --regex .* debian/control}
-      );
+    # see Bug#1009162
+    my $description = get_source_field('Description');
+
+    # otherwise try X-Description
+    $description ||= get_source_field('X-Description');
+
     my ($short_description, $long_description) = split(m{\n}, $description, 2);
 
     $short_description //= $EMPTY;
@@ -142,6 +143,19 @@ for my $installable (@installables) {
 
 exit;
 
+sub get_source_field {
+    my ($name) = @_;
+
+    # need regex to avoid the empty string, which would be filtered by run()
+    my $value= run(
+        qw{grep-dctrl --no-field-names},
+        "--show-field=$name",
+        qw{--field=Source --regex .* debian/control}
+    );
+
+    return $value;
+}
+
 sub replace_line {
     my ($path, $field, $value) = @_;
 


=====================================
hlibrary.mk
=====================================
@@ -152,8 +152,8 @@ build-ghc-stamp: $(DEB_SETUP_BIN_NAME)
 build/%-dev build/%-prof build/%-doc:: build-ghc-stamp
 
 debian/tmp-inst-%: $(DEB_SETUP_BIN_NAME) build-ghc-stamp
-	. /usr/share/haskell-devscripts/Dh_Haskell.sh && \
-	install_recipe "$@"
+	perl -d:Confess -MDebian::Debhelper::Buildsystem::Haskell::Recipes=/.*/ \
+		-E 'install_recipe($ARGV[0])' "$@"
 
 dist-hugs: $(DEB_SETUP_BIN_NAME)
 	$(DEB_SETUP_BIN_NAME) configure --hugs --prefix=/usr -v2 \



View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/compare/97b51e7da3c9734f027147b02253d945dc9678e4...71fa2f669350ed4e9e0013c8d749b45166c78196

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/compare/97b51e7da3c9734f027147b02253d945dc9678e4...71fa2f669350ed4e9e0013c8d749b45166c78196
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/20220411/59ed47a1/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list