[Resending to actual emacsen-common bug, not to ancient devscripts-el bug.
Sorry for the noise ]
On Sun, Feb 02, 2014 at 11:22:09AM +, Julian Gilbey wrote:
Hi Rob,
Please do have a look at this one - it's messy :-/
On Fri, Jan 31, 2014 at 09:57:08PM +0900, Tatsuya Kinoshita wrote:
On January 31, 2014 at 11:33AM +0100, anbe (at debian.org) wrote:
Install emacsen-common for emacs23
[...]
install/devscripts-el: Handling emacs23, logged in /tmp/elc_tCbg9i.log
ERROR: install script from devscripts-el package failed
[...]
devscripts.el:19:1:Error: Cannot open load file: mcharset
It seems apel's mcharset.elc is not found when byte-compiling.
The devscripts-el package depends on apel, so install/devscripts-el
called from devscripts-el.postinst succeed, but install/devscripts-el
called from emacsen-common or emacsen could fail as above.
I've looked into this one. I've applied a temporary patch to
devscripts-el to avoid compiling if apel is not compiled, but it seems
to me that the source of the breakage is in emacsen-common's handling
of dependencies.
I thought I had figured out what was going on, but now I have no idea:
I simply don't understand why emacs-install was attempting to
byte-compile devscripts-el when it had been unpackage earlier on
during the upgrade (and hence run the emacs-package-remove script).
The only thing I can think is that maybe the wheezy version of
emacsen-common's scripts didn't correctly remove the installed marker
file.
Hi,
I have been wondering for some time if there is a simpler way to handle all
this sorting without using explicit tsort.
I have been playing for some time with a proof of concept of a perl-only
method to handle this, and tried today to put it into emacsen-common lib.pl.
I am attaching current incarnation of it, both as a plain lib.pl and as a
git diff. I have tested in my system and it seems to work well, but consider
it highly experimental code.
To get dependencies it relies in a single 'dpkg-query' call for all add-ons
to be processed. That dependencies are processed and info put into a
dependencies hash, used to sort after its contents by perl sort function.
To make things more compact and integrated with my tests I have merged some
tightly related functions into a single `generate_add_on_install_list'
function. In my current tests, `get_installed_add_on_packages' has been
changed to return a hash reference, and `generate_add_on_install_list'
changed to accept references to either hash or array.
If `emacsen-common' is one of the packages to be processed, it will always
be put first (new dependency should have the same result), then packages
having no other dependencies, and then packages depending on other of the
add-ons to be installed.
To enable debugging output, just set
export EMACSEN_COMMON_DEBUG=1
As said, this is to be considered highly experimental, but I hope it can be
useful. Please have mercy on my perl :-).
Regards,
--
Agustin
From 12c1ce80f1a86ff27c77f3a7e81cb30761c72d7f Mon Sep 17 00:00:00 2001
From: Agustin Martin Domingo agmar...@debian.org
Date: Fri, 23 May 2014 16:59:35 +0200
Subject: [PATCH] lib.pl: First cut for using a perl-only based sorting
algorithm.
* Make more use of hashes.
* Use a single dpkg-query call for all add-ons to be installed.
* Use a perl-only sorting algorithm.
* Merged sone interrelated functions into a single function.
---
lib.pl | 185 +++--
1 file changed, 88 insertions(+), 97 deletions(-)
mode change 100755 = 100644 lib.pl
diff --git a/lib.pl b/lib.pl
old mode 100755
new mode 100644
index f0aa670..2d0097e
--- a/lib.pl
+++ b/lib.pl
@@ -3,6 +3,8 @@
use strict;
use Cwd;
+my $debug++ if $ENV{'EMACSEN_COMMON_DEBUG'};
+
# depends on: dpkg, tsort, perl
my $lib_dir = /usr/lib/emacsen-common;
@@ -63,8 +65,7 @@ sub get_installed_add_on_packages
{
delete $ready_pkgs{$p} unless (-e $::installed_package_state_dir/$p);
}
- my @result = keys %ready_pkgs;
- return \@result;
+ return \%ready_pkgs;
}
sub get_installed_flavors
@@ -73,110 +74,100 @@ sub get_installed_flavors
return @$flavors;
}
-sub get_package_status
-{
- my($pkg) = @_;
- my $status = `dpkg --status $pkg`;
- die 'emacsen-common: dpkg invocation failed' if($? != 0);
- $status =~ s/\n\s+//gmo; # handle any continuation lines...
- return $status;
-}
-
-sub filter_depends
-{
- my($depends_string, $installed_add_ons) = @_;
-
- # Filter out all the noise (version number dependencies, etc)
- # and handle or deps too, i.e. Depends: foo, bar | baz
- my @relevant_depends = split(/[,|]/, $depends_string);
- @relevant_depends = map { /\s*(\S+)/o; $1; } @relevant_depends;
-
- # Filter out all non-add-on packages.
- @relevant_depends = grep {
-my $candidate = $_;
-grep { $_ eq $candidate } @$installed_add_ons;
- } @relevant_depends;
-
- return @relevant_depends;
-}
+#