chdir "$FindBin::Bin/..";
$ENV{TOPDIR}=getcwd();
+$ENV{GIT_CONFIG_PARAMETERS}="'core.autocrlf=false'";
-my $mk=`which gmake`; # select the right 'make' program
+my $mk=`which gmake 2>/dev/null`; # select the right 'make' program
chomp($mk); # trim trailing newline
$mk or $mk = "make"; # default to 'make'
'src-git' => {
'init' => "git clone --depth 1 '%s' '%s'",
'init_branch' => "git clone --depth 1 --branch '%s' '%s' '%s'",
- 'update' => "git pull",
+ 'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
+ 'update' => "git pull --ff",
'controldir' => ".git",
'revision' => "git show --abbrev-commit HEAD | head -n 1 | cut -d ' ' -f 2 | tr -d '\n'"},
'src-gitsvn' => {
my $localpath = "./feeds/$name";
my $safepath = $localpath;
$safepath =~ s/'/'\\''/;
- my ($base, $branch) = split(/;/, $src, 2);
+ my ($base_branch, $branch) = split(/;/, $src, 2);
+ my ($base_commit, $commit) = split(/\^/, $src, 2);
if( $relocate || !$m->{'update'} || !-d "$localpath/$m->{'controldir'}" ) {
system("rm -rf '$safepath'");
if ($m->{'init_branch'} and $branch) {
- system(sprintf($m->{'init_branch'}, $branch, $base, $safepath)) == 0 or return 1;
+ system(sprintf($m->{'init_branch'}, $branch, $base_branch, $safepath)) == 0 or return 1;
+ } elsif ($m->{'init_commit'} and $commit) {
+ system(sprintf($m->{'init_commit'}, $base_commit, $safepath, $safepath, $commit, $commit)) == 0 or return 1;
} else {
system(sprintf($m->{'init'}, $src, $safepath)) == 0 or return 1;
}
+ } elsif ($m->{'init_commit'} and $commit) {
+ # in case git hash has been provided don't update the feed
} else {
system("cd '$safepath'; $m->{'update'}") == 0 or return 1;
}
return;
}
+sub is_core_package($) {
+ my $package = shift;
+ foreach my $file ("tmp/info/.packageinfo-$package", glob("tmp/info/.packageinfo-*_$package")) {
+ next unless index($file, "tmp/info/.packageinfo-feeds_");
+ return 1 if -s $file;
+ }
+ return 0;
+}
+
sub install_package {
my $feed = shift;
my $name = shift;
$feed or do {
$installed{$name} and return 0;
# TODO: check if it's already installed within ./package directory
- $feed_src->{$name} or -d "./package/$name" or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n";
+ $feed_src->{$name} or is_core_package($name) or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n";
return 0;
};