[pkg-perl-tools] 01/01: dpt-salsa: (stubs of) mrconfig and githashes functions
gregor herrmann
gregoa at debian.org
Tue Feb 6 18:05:13 UTC 2018
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 96cb3e96faf668357d5fb420c6b0508e0a472420
Author: gregor herrmann <gregoa at debian.org>
Date: Tue Feb 6 19:03:19 2018 +0100
dpt-salsa: (stubs of) mrconfig and githashes functions
Gbp-Dch: Ignore
---
scripts/salsa | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/scripts/salsa b/scripts/salsa
index 85493c8..7545730 100755
--- a/scripts/salsa
+++ b/scripts/salsa
@@ -111,6 +111,10 @@ if ( $command eq 'version' ) {
configurerepo();
} elsif ( $command eq 'changerepo' ) {
changerepo();
+} elsif ( $command eq 'mrconfig' ) {
+ mrconfig();
+} elsif ( $command eq 'githashes' ) {
+ githashes();
} elsif ( $command eq 'help' ) {
pod2usage(1);
} else {
@@ -337,6 +341,50 @@ sub changerepo {
if $property eq 'name';
}
+## mrconfig
+## XXX: TODO: this is a sketch
+sub mrconfig {
+
+ # XXX outfh
+ # XXX read template/header for .mrconfig before dumping packages
+
+ my $paginator = $api->paginator(
+ 'group_projects',
+ $config{perl_team_modules_packages_id},
+ { order_by => 'name', sort => 'asc' }
+ );
+ while ( my $repo = $paginator->next() ) {
+ my $reponame = $repo->{name};
+ say "[packages/$reponame]";
+ say "checkout = git_checkout $reponame\n";
+ }
+}
+
+## githashes
+## XXX: TODO: this is a sketch
+sub githashes {
+ my $paginator = $api->paginator(
+ 'group_projects',
+ $config{perl_team_modules_packages_id},
+ { order_by => 'name', sort => 'asc' }
+ );
+ while ( my $repo = $paginator->next() ) {
+ my ( $repotags, $repobranches, $repohashes );
+ my $tags = $api->tags( $repo->{id} );
+ my $branches = $api->branches( $repo->{id} );
+ $repotags->{ 'refs/tags/' . $_->{name} } = $_->{commit}->{id}
+ foreach @{$tags};
+ $repobranches->{ 'refs/heads/' . $_->{name} } = $_->{commit}->{id}
+ foreach @{$branches};
+ $repohashes->{tags} = $repotags if $repotags;
+ $repohashes->{branches} = $repobranches if $repobranches;
+ # $repohashes->{trunk} seems to be a PET artifact and not used by compare-hashes
+
+ # XXX outfh
+ say prettyjson($repohashes);
+ }
+}
+
# helper functions
## prettyjson($data)
sub prettyjson {
@@ -601,6 +649,21 @@ internal use.
=head2 others
+=head3 I<mrconfig>
+
+Helper for creating a F<.mrconfig> file for all active packages of the
+I<modules> subgroup of the I<perl-team> group.
+
+B<WARNING>: Currently just a stub.
+
+=head3 I<githashes>
+
+Helper for creating F<.git.hashes/PKGNAME> files for all active packages of
+the I<modules> subgroup of the I<perl-team> group which are then used by
+B<compare-hashes> in F<.mrconfig>.
+
+B<WARNING>: Currently just a stub.
+
=head3 I<current_user> [--json]
Outputs information about the user whose I<GitLab> token is used.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/pkg-perl-tools.git
More information about the Pkg-perl-cvs-commits
mailing list