}
}
+sub mount_source_check {
+ my $build_root = canonpath(shift);
+
+ my (undef, $tmp_file) = tempfile(CLEANUP=>1, OPEN => 0);
+ if (my_system("mount -l >$tmp_file 2>/dev/null") == 0) {
+ open my $file, '<', $tmp_file or die $!;
+ while (<$file>) {
+ chomp;
+ next if ($_ !~ /$build_root/);
+ my @mount_info= split(' ', $_);
+ if (-e $mount_info[0] and -e "$mount_info[0]/.git"){
+ error("$mount_info[0] has been mounted to $mount_info[2]. " .
+ "Please unmount it manually to avoid being deleted " .
+ "unexpectly.");
+ }
+ }
+ }
+}
+
sub build_package {
my ($name, $thread, $index) = @_;
use vars qw(@package_repos);
# trigger 'ALRM' immediately
kill 'ALRM', $$;
+for(my $i = 0; $i < $MAX_THREADS; $i++) {
+ mount_source_check("$scratch_dir.$i");
+}
+
# only one package need to be built, do it directly
if ($noinit == 1 || $incremental == 1) {
my $ret = 0;
}
}
+
while (! $TERM) {
my @order = ();
my @o = ();