[Git][haskell-team/haskell-devscripts][master] Revert "Get name-version from the config file instead of its filename"

Clint Adams (@clint) gitlab at salsa.debian.org
Tue Jan 20 16:15:08 GMT 2026



Clint Adams pushed to branch master at Debian Haskell Group / haskell-devscripts


Commits:
144e8d37 by Clint Adams at 2026-01-20T11:14:58-05:00
Revert "Get name-version from the config file instead of its filename"

This reverts commit d8b27931da841bb14ae84bd2d856d8c950cc8aaf.

- - - - -


1 changed file:

- lib/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm


Changes:

=====================================
lib/Debian/Debhelper/Buildsystem/Haskell/Recipes.pm
=====================================
@@ -422,30 +422,7 @@ sub own_cabal_prerequisites {
         my $ghc_pkg = ghc_pkg_command();
         load_ghc_database($ghc_pkg, $tmp_db, $pkg_config);
 
-	# This should be factored out into a helper function
-        my $name;
-        my $path_namever = path($pkg_config)->basename(qr { [.]conf $}x);
-        $path_namever =~ m/^([^ ]*?)-(\d[\d.]*)(-\S+)?$/;
-        my $path_name = $1;
-        $path_namever = "$1-$2";
-
-        open(CONFIG, '<', $pkg_config);
-
-        my $config_name;
-        my $config_version;
-
-        while(<CONFIG>) {
-            if ($_ =~ /^name:\s+(\S+)/) { $config_name = $1; }
-            elsif ($_ =~ /^version:\s+(\S+)/) { $config_version = $1; }
-        }
-
-        if (defined $config_name && defined $config_version) {
-            $name = "$config_name-$config_version";
-            warn encode_utf8('Name value does not match filename.') if ($name != $path_namever);
-        } else {
-            $name = $path_namever;
-        }
-
+        my $name = path($pkg_config)->basename(qr{ [.]conf $}x);
         my $depends
           = run($ghc_pkg, '--package-db', $tmp_db, qw{--simple-output field},
             $name, 'depends');
@@ -535,29 +512,10 @@ sub hashed_id_to_virtual_installable {
 sub config_to_package_id {
     my ($config, $ghc_pkg, $package_db) = @_;
 
-    # This should be factored out into a helper function
-    my $name;
-    my $path_namever = path($config)->basename(qr { [.]conf $}x);
-    $path_namever =~ m/^([^ ]*?)-(\d[\d.]*)(-\S+)?$/;
-    my $path_name = $1;
-    $path_namever = "$1-$2";
-
-    open(CONFIG, '<', $config);
+    my $name = path($config)->basename(qr { [.]conf $}x);
 
-    my $config_name;
-    my $config_version;
-
-    while(<CONFIG>) {
-	if ($_ =~ /^name:\s+(\S+)/) { $config_name = $1; }
-	elsif ($_ =~ /^version:\s+(\S+)/) { $config_version = $1; }
-    }
-
-    if (defined $config_name && defined $config_version) {
-        $name = "$config_name-$config_version";
-        warn encode_utf8('Name value does not match filename.') if ($name != $path_namever);
-    } else {
-	$name = $path_namever;
-    }
+    $name =~ m/^([^ ]*?)-(\d[\d.]*)(-\S+)?$/;
+    $name = "$1-$2";
 
     my $package_id = run($ghc_pkg, '--package-db', $package_db,
         qw{--simple-output field}, $name, 'id');



View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/commit/144e8d371a9feebc1c93a96b7643b21e6c1b886e

-- 
View it on GitLab: https://salsa.debian.org/haskell-team/haskell-devscripts/-/commit/144e8d371a9feebc1c93a96b7643b21e6c1b886e
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/20260120/4a2c48d7/attachment-0001.htm>


More information about the Pkg-haskell-commits mailing list