diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-01-10 09:05:56 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-01-10 09:05:56 -0700 |
commit | 512cf91d0166f1cb024cc3d3517516242cbddf09 (patch) | |
tree | fec589a832be9db7505cec44cb5973a6e6bb0477 /lib | |
parent | 7bfe95e5810d68f1ed9aa04b473a8ebd10c6762b (diff) |
if MELPA dl fails, use single binary pkg
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DhMakeELPA/Command/Packaging.pm | 10 | ||||
-rw-r--r-- | lib/DhMakeELPA/MELPA.pm | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/DhMakeELPA/Command/Packaging.pm b/lib/DhMakeELPA/Command/Packaging.pm index b928989..ff6607e 100644 --- a/lib/DhMakeELPA/Command/Packaging.pm +++ b/lib/DhMakeELPA/Command/Packaging.pm @@ -94,7 +94,15 @@ sub find_bins { # see if this package is a root package file: either it has an # accompanying -pkg.el, or it contains a Package-Version: line if (-f "$pkg" || fgrep { /^;; Package-Version:/ } $el) { - my @files = package_files_list($name); + my @files; + try { + @files = package_files_list($name); + } catch { + print "W: Could not download recipe for $name from MELPA\n"; + print "W: Falling back to a single binary package\n"; + &$single_bin(); + last; + } $self->bins->{$name} = \@files; } } diff --git a/lib/DhMakeELPA/MELPA.pm b/lib/DhMakeELPA/MELPA.pm index ab70568..0825ab4 100644 --- a/lib/DhMakeELPA/MELPA.pm +++ b/lib/DhMakeELPA/MELPA.pm @@ -41,7 +41,7 @@ their repo since the release being packaged. sub package_files_list { my ($package) = @_; my $recipe = get("https://raw.githubusercontent.com/melpa/melpa/master/recipes/" . $package) - or die "Could not download recipe for $package from MELPA!"; + or die "W: Could not download recipe for $package from MELPA"; # insert MELPA's default globs if necessary (edited slightly) my $defaults = <<EOT; |