This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository pkg-perl-tools.

commit 57ea16f18edb5062d6fb1a5af4f70505a8e6465c
Author: gregor herrmann <gre...@debian.org>
Date:   Sun Jan 28 16:55:25 2018 +0100

    dpt-salsa: new method changerepo (name or description)
    
    Gbp-Dch: Ignore
---
 scripts/salsa | 41 +++++++++++++++++++++++++++++++++++++++++
 t/spelling.st |  1 +
 2 files changed, 42 insertions(+)

diff --git a/scripts/salsa b/scripts/salsa
index 90f2c55..f30a620 100755
--- a/scripts/salsa
+++ b/scripts/salsa
@@ -107,6 +107,8 @@ if ( $command eq 'version' ) {
     createrepo();
 } elsif ( $command eq 'configurerepo' ) {
     configurerepo();
+} elsif ( $command eq 'changerepo' ) {
+    changerepo();
 } elsif ( $command eq 'help' ) {
     pod2usage(1);
 } elsif ( $command eq 'XXX' ) {
@@ -268,6 +270,20 @@ sub configurerepo {
     );
 }
 
+## changerepo
+sub changerepo {
+    my ( $repo, $property, $value ) = @args;
+    die 'Required parameter reponame|repoid missing.'  unless $repo;
+    die 'Required parameter name|description missing.' unless $property;
+    die "Unknown property '$property'. Valid cases: 'name' or 'description'."
+        unless ( $property eq 'name' or $property eq 'description' );
+    die 'Required paramter "new value" missing.' unless $value;
+
+    my $repo_id = repo2repoid($repo);
+    $api->edit_project( $repo_id, { $property => $value } );
+    $api->edit_project( $repo_id, { path => $value } ) if $property eq 'name';
+}
+
 # helper functions
 ## prettyjson($data)
 sub prettyjson {
@@ -370,6 +386,31 @@ Required.
 
 =back
 
+=head3 I<changerepo> I<repositoryid|repositoryname> I<name|description> 
C<"parameter">
+
+Changes the name (and the path) or the description of a repository.
+
+Parameters:
+
+=over
+
+=item repositoryid|repositoryname
+
+The repository to be configured. Either its id (\d+) or name (\w+).
+Required.
+
+=item name|description
+
+What should be changed? The name or the description of the repository.
+Required.
+
+=item parameter
+
+The new name or description.
+Required.
+
+=back
+
 =head3 I<listrepos>
 
 Show all repositories in the I<modules> subgroup.
diff --git a/t/spelling.st b/t/spelling.st
index a5a6ca0..69b9553 100644
--- a/t/spelling.st
+++ b/t/spelling.st
@@ -53,6 +53,7 @@ alioth
 anonscm
 bts
 bzip
+changerepo
 conf
 configurerepo
 createrepo

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to