#963727 dh-make-{elpa,perl}: move duplicate code to a library

#963727#5
Date:
2020-06-26 06:38:48 UTC
From:
To:
Hi,

dh-make-elpa is heavily based on dh-make-perl (thanks to all who
were/are involved into whis nice tool). Both share the same
object-oriented structure and some code. Recently, dh-make-elpa was
untied from dh-make-perl, so now the former doesn't depend on the
latter. But this was done by copying some code from dh-make-perl without
changes. The better option would be to move duplicate code to a library.

Fully duplicate code is in DhMake{ELPA,Perl}::Command::Packaging. That
is, duplicates are the following methods: main_file, debian_file,
get_user, get_email, get_name, get_developer, fill_maintainer, get_wnpp,
create_rules, write_source_format, backup_file, _file_r, and _file_w.
Currently, these methods are fully identical between dh-make-elpa and
dh-make-perl.

It would be nice to identify those methods which may be useful for
various (possible) implementations of dh-make-<something> and are
unlikely to change significantly in the future. Those methods could be
moved to, say, DhMake::Packaging.

Probably, it may be beneficial to design a core functionality for
DhMake::Config too, and then refactor both dh-make-elpa and dh-make-perl
to use it and base on it. But it requires more work, and I guess should
be done rather gradually. Therefore, it is may be a goal for some
(probably, distant) future.

I would like to implement changes for both dh-make{elpa,perl}, but first
we should discuss what should be done and in which way. So, CCing Debian
Perl Group mailing list, but I think that it's better to keep the
discussion in one place, that is, in this bug report.

Cheers!
Lev

#963727#10
Date:
2022-05-23 14:54:49 UTC
From:
To:
Sorry for replying so late, somehow this bug fell throught the
cracks.

Makes sense.

Agreed.

From a dh-make-perl perspective I think we are happy with everything
which "only" moves functionality around without breaking anything.
So if you are still planning to work on this task, please go ahead
and send patches/merge requests.


Cheers,
gregor

#963727#15
Date:
2022-05-23 16:40:34 UTC
From:
To:
Hi gregor,

Mon 23 May 2022 @ 16:54 gregor herrmann <gregoa@debian.org>:

Thanks for the update. Hope, I will have some time during the coming
summer.

Cheers!
Lev

#963727#20
Date:
2025-09-28 07:13:15 UTC
From:
To:
Hi Lev, Gregor,

Reviving this old bug report.  AAMOF I have updated the embedded Perl
code in dh-make-elpa a few times regarding repository detection, field
handling on d/control (e.g. Standard-Versions, Rules-Requires-Root,
etc.), etc.  I wonder whether there were more work done in this
direction and whether there are still interest to make this happen.

#963727#25
Date:
2025-09-28 09:50:58 UTC
From:
To:
Hi everyone,

Вс 28 сен 2025 @ 00:13 Xiyue Deng <manphiz@gmail.com>:

I haven't done anything in this direction, and unfortunately I don't
have time for it in the foreseeable future.

Best,
Lev

#963727#30
Date:
2025-09-29 01:35:13 UTC
From:
To:
Hi Lev,

Lev Lamberov <dogsleg@debian.org> writes:

Thanks for the update!  I'm not sure whether I'll continue this
initiative as I'm not a proficient Perl programmer.  But let's see :)

#963727#35
Date:
2025-09-29 05:38:09 UTC
From:
To:
Hi,

Вс 28 сен 2025 @ 18:35 Xiyue Deng <manphiz@gmail.com>:

Anyway, thanks for your interest and contribution!

Cheers!
Lev