mirror of
https://github.com/fspc/dswim.git
synced 2025-02-22 00:23:28 -05:00
Added home_builder so that personal dirs are created in $tmp for each user and
return value when rebuilddb or initdb present themselves.
This commit is contained in:
parent
f2c8510e31
commit
e1b6276caf
28
SWIM/Conf.pm
28
SWIM/Conf.pm
@ -238,7 +238,9 @@ $longswim = "$pre/lib/SWIM/longswim";
|
||||
# explanation for making such a disk. There is also
|
||||
# /usr/src/kernel-source.version/Documentation. Whether this will speed
|
||||
# things up is a subject of experimentation.
|
||||
$tmp = '/tmp';
|
||||
my $tmp_home = substr($main::home,1,);
|
||||
$tmp = "/tmp/.gbootroot_$tmp_home";
|
||||
home_builder($tmp);
|
||||
|
||||
##################
|
||||
# MAIN CONFFILES #
|
||||
@ -466,6 +468,30 @@ if (!-d $swim_conf) {
|
||||
please make the directories which are needed.\n";
|
||||
}
|
||||
|
||||
|
||||
# Pulled this from *_pkg from the gbootroot project.
|
||||
sub home_builder {
|
||||
|
||||
my ($home_builder) = @_;
|
||||
|
||||
if (!-d $home_builder) {
|
||||
if (-e $home_builder) {
|
||||
print "ERROR: A file exists where $home_builder should be.\n";
|
||||
}
|
||||
else {
|
||||
my @directory_parts = split(m,/,,$home_builder);
|
||||
my $placement = "/";
|
||||
for (1 .. $#directory_parts) {
|
||||
$_ == 1 ? ($placement = "/$directory_parts[$_]")
|
||||
: ($placement = $placement . "/" . $directory_parts[$_]);
|
||||
-d $placement or mkdir $placement;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} # end home_builder
|
||||
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
@ -109,7 +109,7 @@ sub database {
|
||||
if (-e "$main::home$parent$library/packages.deb" &&
|
||||
-e "$main::home$parent$library/fileindex.deb") {
|
||||
print STDERR "swim: use --rebuilddb\n";
|
||||
exit;
|
||||
return "rebuilddb";
|
||||
}
|
||||
else {
|
||||
# if a database happens to be missing
|
||||
@ -156,7 +156,7 @@ sub database {
|
||||
}
|
||||
else {
|
||||
print STDERR "swim: use --initdb to create databases\n";
|
||||
exit;
|
||||
return "initdb";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -165,7 +165,7 @@ sub database {
|
||||
if (-e "$main::home$parent$base/packages.deb" &&
|
||||
-e "$main::home$parent$base/fileindex.deb") {
|
||||
print STDERR "swim: use --rebuilddb\n";
|
||||
exit;
|
||||
return "rebuilddb";
|
||||
}
|
||||
else {
|
||||
# if a database happens to be missing
|
||||
@ -212,7 +212,7 @@ sub database {
|
||||
}
|
||||
else {
|
||||
print STDERR "swim: use --initdb to create databases\n";
|
||||
exit;
|
||||
return "initdb";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user