Skip to content
Permalink
077d6ef2a4
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 75 lines (66 sloc) 1.87 KB
#! /usr/bin/perl
# This script can be used to compare the bee packages installed in the system with
# the bee files in the current working directory, which is assumend to be the checked
# out master branch of git@github.molgen.mpg.de:mariux64/bee-files.git
#
# git checkout master
# git pull --rebase
# scripts/check-installed
use strict;
use warnings;
sub scandir {
my ($dirname)=@_;
opendir my $dir,$dirname or die "$dirname: $!\n";
return sort grep !/^\./,readdir $dir;
}
sub save_qx {
my (@cmd)=@_;
my $pid=open my $pipe,'-|';
defined $pid or die "$!\n";
unless ($pid) {
exec @cmd or die "$!";
exit(1);
}
return join('',<$pipe>);
}
our %GIT_FILE;
for my $beefile (scandir('.')) {
$beefile=~/\.(bee|be0)$/ or next;
$beefile eq 'TEMPLATE.be0' and next;
-f $beefile or next;
my $pkg=save_qx('beeversion','--format','%A',$beefile);
chomp($pkg);
unless ($pkg) {
print "# can't parse version of $beefile\n";
next;
}
unless ($pkg =~ /.x86_64$/) {
if ($pkg =~ '^(iana-etc-2.30-0|lesspipe-1-0)$') {
$pkg.='.noarch';
} else {
$pkg.='.x86_64';
}
}
if (exists($GIT_FILE{$pkg})) {
print "# bee file $beefile overwrites package $pkg from $GIT_FILE{$pkg}\n";
}
$GIT_FILE{$pkg}=$beefile;
}
%GIT_FILE or die "no bee files here. Are you sitting in a checked out bee-files repository (git\@github.molgen.mpg.de:mariux64/bee-files.git) ?\n";
for my $dir (scandir('/usr/share/bee')) {
my $pkg=$dir;
$pkg eq 'mxtools-0.0-0' and next;
my $beefile=save_qx('beeversion', '--format', '%F.bee', $pkg);
unless (-e "/usr/share/bee/$pkg/$beefile") {
print "# no such file /usr/share/bee/$pkg/$beefile\n";
next;
}
unless (exists($GIT_FILE{$pkg})) {
print "# package in system but not in git: $pkg\n";
}
delete $GIT_FILE{$pkg};
}
for my $pkg (sort(keys(%GIT_FILE))) {
my $beefile=$GIT_FILE{$pkg};
print "# package in git but not in system: $pkg ($beefile)\n";
}