diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:32:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:32:59 +0000 |
commit | 4d57e0a8dab2139a631a21aab862487481548702 (patch) | |
tree | f7cea0b9939e2ecb7a301de6c83bada29452046d /lib/Devscripts/Uscan/svn.pm | |
parent | Initial commit. (diff) | |
download | devscripts-4d57e0a8dab2139a631a21aab862487481548702.tar.xz devscripts-4d57e0a8dab2139a631a21aab862487481548702.zip |
Adding upstream version 2.23.7.upstream/2.23.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/Devscripts/Uscan/svn.pm')
-rw-r--r-- | lib/Devscripts/Uscan/svn.pm | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/lib/Devscripts/Uscan/svn.pm b/lib/Devscripts/Uscan/svn.pm new file mode 100644 index 0000000..65dacae --- /dev/null +++ b/lib/Devscripts/Uscan/svn.pm @@ -0,0 +1,67 @@ +package Devscripts::Uscan::svn; + +use strict; +use Cwd qw/abs_path/; +use Devscripts::Uscan::Output; +use Devscripts::Uscan::Utils; +use Devscripts::Uscan::_vcs; +use Dpkg::IPC; +use File::Path 'remove_tree'; +use Moo::Role; + +###################################################### +# search $newfile $newversion (svn mode/versionless) +###################################################### +sub svn_search { + my ($self) = @_; + my ($newfile, $newversion); + if ($self->versionless) { + $newfile = $self->parse_result->{base}; + spawn( + exec => [ + 'svn', 'info', + '--show-item', 'last-changed-revision', + '--no-newline', $self->parse_result->{base} + ], + wait_child => 1, + to_string => \$newversion + ); + chomp($newversion); + $newversion = sprintf '0.0~svn%d', $newversion; + if ( + mangle( + $self->watchfile, \$self->line, + 'uversionmangle:', \@{ $self->uversionmangle }, + \$newversion + ) + ) { + return undef; + } + + } + ################################################ + # search $newfile $newversion (svn mode w/tag) + ################################################ + elsif ($self->mode eq 'svn') { + my @args = ('list', $self->parse_result->{base}); + ($newversion, $newfile) + = get_refs($self, ['svn', @args], qr/(.+)/, 'subversion'); + return undef if !defined $newversion; + } + return ($newversion, $newfile); +} + +sub svn_upstream_url { + my ($self) = @_; + my $upstream_url = $self->parse_result->{base}; + if (!$self->versionless) { + $upstream_url .= '/' . $self->search_result->{newfile}; + } + return $upstream_url; +} + +*svn_newfile_base = \&Devscripts::Uscan::_vcs::_vcs_newfile_base; + +sub svn_clean { } + +1; |