mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-04-28 13:00:18 +00:00
cleanup: replace repoid.pl script by simple git commands
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
86a76b2875
commit
de79fdddbf
3
Makefile
3
Makefile
@ -36,7 +36,8 @@ $(DEB):
|
||||
|
||||
.PHONY: upload
|
||||
upload: ${DEB} check
|
||||
./repoid.pl .git check
|
||||
# check if working directory is clean
|
||||
git diff --exit-code --stat && git diff --exit-code --stat --staged
|
||||
tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com upload --product pve --dist stretch
|
||||
|
||||
.PHONY: install
|
||||
|
40
repoid.pl
40
repoid.pl
@ -1,40 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# use use the first 8 characters from the master commit ID
|
||||
|
||||
# git status --porcelain
|
||||
|
||||
use strict;
|
||||
use lib qw(.);
|
||||
use PVE::Tools qw(run_command);
|
||||
|
||||
my $gitdir = shift;
|
||||
die "no repository" if !$gitdir;
|
||||
|
||||
my $path = "$gitdir/refs/heads/master";
|
||||
die "master branch does not exists" if ! -f $path;
|
||||
|
||||
my $arg1 = shift;
|
||||
|
||||
if ($arg1) {
|
||||
die "unknown parameter '$arg1'" if $arg1 ne 'check';
|
||||
|
||||
my $testfunc = sub {
|
||||
my $line = shift;
|
||||
return if $line =~ m/^#/;
|
||||
return if $line =~ m/^\?\?/;
|
||||
|
||||
die "detected modified content: $line\n";
|
||||
};
|
||||
|
||||
my $cmd = ['git', '--git-dir', $gitdir ,'status', '--porcelain'];
|
||||
run_command($cmd, outfunc => $testfunc);
|
||||
}
|
||||
|
||||
my $repoid = `cat $path`;
|
||||
chomp $repoid;
|
||||
|
||||
die "invalid commit format" if $repoid !~ m/^[0-9a-f]{40}$/;
|
||||
|
||||
my $res = substr $repoid, 0, 8;
|
||||
print "$res\n";
|
Loading…
Reference in New Issue
Block a user