logo

utils

Old programs, got split in utils-std and utils-extra git clone https://anongit.hacktivis.me/git/utils.git/
commit: b3c11efaa27c0b13386b36ea2b56b742c99c7e4b
parent 6771360aaa3109e957e03f7f1dd4af10c78bb00e
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 14 Oct 2025 17:06:55 +0200

git-hooks/post-update.reuse: add

Diffstat:

Agit-hooks/post-update.reuse22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/git-hooks/post-update.reuse b/git-hooks/post-update.reuse @@ -0,0 +1,22 @@ +#!/usr/bin/env perl +# SPDX-FileCopyrightText: 2025 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me> +# SPDX-License-Identifier: BSD-3-Clause + +use JSON; +use Cwd; + +my $base = getcwd; + +chdir $base =~ s/\.git$/\.work/ if $base =~ /\.git$/; + +open(my $reuse_out, '-|', 'reuse lint -j') or die "Failed to execute reuse: $!"; +undef $/; # slurp +my $reuse_json = decode_json(<$reuse_out>); +close($reuse_out); + +my $summary = $reuse_json->{"summary"}; +if($summary->{"compliant"} != JSON::true) { + print "reuse: files_total: ", $summary->{"files_total"}, "\n"; + print "reuse: files_with_copyright_info: ", $summary->{"files_with_copyright_info"}, "\n"; + print "reuse: files_with_licensing_info: ", $summary->{"files_with_licensing_info"}, "\n"; +}