1
0
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:
freesource 2001-10-14 19:55:34 +00:00
parent f2c8510e31
commit e1b6276caf
2 changed files with 31 additions and 5 deletions

View File

@ -238,7 +238,9 @@ $longswim = "$pre/lib/SWIM/longswim";
# explanation for making such a disk. There is also # explanation for making such a disk. There is also
# /usr/src/kernel-source.version/Documentation. Whether this will speed # /usr/src/kernel-source.version/Documentation. Whether this will speed
# things up is a subject of experimentation. # 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 # # MAIN CONFFILES #
@ -466,6 +468,30 @@ if (!-d $swim_conf) {
please make the directories which are needed.\n"; 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; 1;
__END__ __END__

View File

@ -109,7 +109,7 @@ sub database {
if (-e "$main::home$parent$library/packages.deb" && if (-e "$main::home$parent$library/packages.deb" &&
-e "$main::home$parent$library/fileindex.deb") { -e "$main::home$parent$library/fileindex.deb") {
print STDERR "swim: use --rebuilddb\n"; print STDERR "swim: use --rebuilddb\n";
exit; return "rebuilddb";
} }
else { else {
# if a database happens to be missing # if a database happens to be missing
@ -156,7 +156,7 @@ sub database {
} }
else { else {
print STDERR "swim: use --initdb to create databases\n"; 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" && if (-e "$main::home$parent$base/packages.deb" &&
-e "$main::home$parent$base/fileindex.deb") { -e "$main::home$parent$base/fileindex.deb") {
print STDERR "swim: use --rebuilddb\n"; print STDERR "swim: use --rebuilddb\n";
exit; return "rebuilddb";
} }
else { else {
# if a database happens to be missing # if a database happens to be missing
@ -212,7 +212,7 @@ sub database {
} }
else { else {
print STDERR "swim: use --initdb to create databases\n"; print STDERR "swim: use --initdb to create databases\n";
exit; return "initdb";
} }
} }
} }