bluto

Release package and announcement generator
Info | Log | Files | Refs | README | LICENSE

commit a8a014aba94ca688cb7267f893178429560bab3b
parent 969f2f97b090155e8f9e1e730200407469723fc1
Author: lash <dev@holbrook.no>
Date:   Thu,  6 Mar 2025 02:06:31 +0000

Handle relative outdir path

Diffstat:
MBluto.pm | 16+++++++++++++++-
MBluto/Archive.pm | 5+++--
MBluto/Cmd.pm | 15++++++++++-----
ABluto/Export.pm | 8++++++++
MBluto/RSS.pm | 2+-
MBluto/Tree.pm | 1+
MMakefile.PL | 2++
Mbluto-pub | 12+++++++-----
Mcfg/0.0.2-alpha.2.yml | 6+++++-
9 files changed, 52 insertions(+), 15 deletions(-)

diff --git a/Bluto.pm b/Bluto.pm @@ -299,10 +299,16 @@ sub from_yaml { #my $targz = Bluto::Archive::create($m_main{slug}, $m_main{version}, $m_main{author_maintainer}[2], $m_main{tag_prefix}, $env->{src_dir}, $env->{out_dir}, 0); my $targz = Bluto::Archive::create(\%m_main, $env, 1); if (!defined $targz) { - error('failed to generate archive'); + error('failed to generate archive (yaml)'); return undef; } + my @targz_stat = stat ( $targz ); + + if (!@targz_stat) { + error('generated archive but could not find again in expected place: ' . $targz); + return undef; + } $m_main{time} = DateTime->from_epoch( epoch => $targz_stat[9] )->stringify(); foreach my $v ( @{$cfg_m->{locate}->{tgzbase}}) { warn('not checking targz base formatting for ' . $v); @@ -533,4 +539,12 @@ sub create_rss { return Bluto::RSS::to_file(\%m_main, $env, $out); } +sub create_yaml { + my $y_base = shift; + my $y_release = shift; + my $env = shift; + + my $y = YAML::Tiny->new($y_base); +} + 1; diff --git a/Bluto/Archive.pm b/Bluto/Archive.pm @@ -5,7 +5,8 @@ use File::Basename qw/basename fileparse/; use Digest::SHA; use Bluto::Log qw/error info debug warn trace/; -use Bluto::Tree qw/release_path/; +#use Bluto::Tree qw/ release_path /; +use Bluto::Tree; use File::Path qw / make_path /; @@ -72,7 +73,7 @@ sub create { } chomp($rev); my $targz = $targz_stem . '+build.' . $rev . '.tar.gz'; - my $targz_base = File::Spec->catfile(Bluto::Tree->release_path); + my $targz_base = File::Spec->catfile(Bluto::Tree->release_path()); make_path($targz_base); $targz_local = File::Spec->catfile($targz_base, $targz); diff --git a/Bluto/Cmd.pm b/Bluto/Cmd.pm @@ -29,6 +29,11 @@ sub help { exit 0; } +sub croak_ { + $v = shift; + die $v; +} + sub register_param { my $env_k = shift; my $env_v_default = shift; @@ -64,14 +69,14 @@ sub process_param { help; } - if (defined $env{version}) { - $env{version} = SemVer->new($env{version}); - } - if (defined $env{src_dir}) { make_path($env{src_dir}); } + if (defined $env{version}) { + $env{version} = SemVer->new($env{version}); + } + $env{engine} = 'bluto v' . SemVer->new(Bluto::version()). " (perl $^V)"; foreach my $k (keys %env ) { if (defined $env{$k}) { @@ -204,7 +209,7 @@ sub _check_version { sub _check_sanity { my $r = 0; - $r += _check_readme($env); + $r += _check_readme($env); $r += _check_yml($env); $r += _check_version($env); diff --git a/Bluto/Export.pm b/Bluto/Export.pm @@ -0,0 +1,8 @@ +package Bluto::Export; + +use YAML::Tiny; + +use Bluto::Log qw/error info debug warn trace/; + + +sub diff --git a/Bluto/RSS.pm b/Bluto/RSS.pm @@ -6,7 +6,7 @@ use DateTime; use XML::RSS; use Bluto::Log qw/error info debug warn trace/; -use Bluto::Tree qw/announce_path/; +use Bluto::Tree; sub get_feed_filepath { diff --git a/Bluto/Tree.pm b/Bluto/Tree.pm @@ -18,6 +18,7 @@ sub prepare { my $release = shift; my $env = shift; + $env->{out_dir} = File::Spec->rel2abs($env->{out_dir}); $_release_path = File::Spec->catfile($env->{out_dir}, 'src', $release->{slug}); make_path(release_path); $_announce_path = File::Spec->catfile($env->{out_dir}, 'announce', $release->{slug}); diff --git a/Makefile.PL b/Makefile.PL @@ -18,6 +18,8 @@ WriteMakefile( 'Template' => 2.66, 'Digest::SHA' => 2.13, 'XML::RSS' => 1.63, + # package https://metacpan.org/pod/Bitcoin::Secp256k1 + 'Bitcoin::Secp256k1' => 0.004, }, TEST_REQUIRES => {}, ); diff --git a/bluto-pub b/bluto-pub @@ -21,19 +21,16 @@ Bluto::Cmd::register_param("readme", undef, undef, undef); Bluto::Cmd::process_param(); +my $env = Bluto::Cmd::params(); my $version = Bluto::Cmd::get_version(); -if (!defined $version) { - die("version missing"); -} my $ym = Bluto::Cmd::base_config(); my $yv = Bluto::Cmd::release_config(); -my $env = Bluto::Cmd::params(); if (!defined $env) { die("not sane"); } -my $version = Bluto::from_yaml($ym, $yv, $env); +$version = Bluto::from_yaml($ym, $yv, $env); if (!defined $version) { die("config processing failed"); } @@ -47,3 +44,8 @@ my $rss = Bluto::create_rss($env); if (!defined $rss) { die("rss processing failed"); } + +my $yr = Bluto::create_yaml($ym, $yv, $env); +if (!defined $yr) { + die("yaml output processing failed"); +} diff --git a/cfg/0.0.2-alpha.2.yml b/cfg/0.0.2-alpha.2.yml @@ -1,5 +1,9 @@ --- author: 'Louis Holbrook' changelog: sha256:8333899d4b605d3466193ab5ee0a818d2d7bd5dc9f92401a415446ea0b576070 -contributors: [] +contributors: + - + name: 'Foo Bar' + email: 'foobar@zemzar.net' + PGP: DA9B363BE90CA22561513EA18A79070F329E7F46 maintainer: 'Louis Holbrook'