[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



Package: dh-make-elpa
Version: 0.18
Severity: wishlist

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

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.6.0-2-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages dh-make-elpa depends on:
ii  dh-elpa                 2.0.4
ii  dh-make-perl            0.112
ii  libarray-utils-perl     0.5-1
ii  libfile-find-rule-perl  0.34-1
ii  libfile-grep-perl       0.02-1
ii  libgit-repository-perl  1.324-1
ii  libtrycatch-perl        1.003002-2+b6
ii  perl                    5.30.3-4

Versions of packages dh-make-elpa recommends:
ii  devscripts  2.20.3

dh-make-elpa suggests no packages.

-- no debconf information


Reply to: