diff options
author | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2016-05-21 20:26:08 -0700 |
---|---|---|
committer | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2016-05-21 20:26:08 -0700 |
commit | 76b0050b2abdd472c06541c22c244642cb9ffa32 (patch) | |
tree | a8f2b22fb8b1c2039b92c0f7c3569dc88c3a5568 | |
parent | e266b29c1b68130e441696f49cd40ef644e46425 (diff) | |
download | carton-76b0050b2abdd472c06541c22c244642cb9ffa32.tar.gz |
Write undef properly for 02packages index as well
-rw-r--r-- | lib/Carton/Index.pm | 2 | ||||
-rw-r--r-- | lib/Carton/Package.pm | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Carton/Index.pm b/lib/Carton/Index.pm index 3ce215c..43ab608 100644 --- a/lib/Carton/Index.pm +++ b/lib/Carton/Index.pm @@ -35,7 +35,7 @@ Last-Updated: @{[ scalar localtime ]} EOF for my $p ($self->packages) { - print $fh $self->_format_line($p->name, $p->version || 'undef', $p->pathname); + print $fh $self->_format_line($p->name, $p->version_format, $p->pathname); } } diff --git a/lib/Carton/Package.pm b/lib/Carton/Package.pm index 6b1f381..01eaa1f 100644 --- a/lib/Carton/Package.pm +++ b/lib/Carton/Package.pm @@ -7,6 +7,11 @@ sub BUILDARGS { return { name => $args[0], version => $args[1], pathname => $args[2] }; } +sub version_format { + my $self = shift; + defined $self->version ? $self->version : 'undef'; +} + 1; |