mirror of
https://codeberg.org/scip/jaildk.git
synced 2025-12-17 04:31:02 +01:00
clean up dist dir before building a new base (fixes #13)
This commit is contained in:
33
jaildk
33
jaildk
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
version=1.18
|
version=1.19
|
||||||
|
|
||||||
usage_jaildk() {
|
usage_jaildk() {
|
||||||
beg=`tput -T ${TERM:-cons25} md`
|
beg=`tput -T ${TERM:-cons25} md`
|
||||||
@@ -637,23 +637,27 @@ jaildk_uninstall() {
|
|||||||
|
|
||||||
|
|
||||||
usage_base() {
|
usage_base() {
|
||||||
fin "Usage: $0 base -b <basename|basedir> [-w]
|
fin "Usage: $0 base [-f] -b <basename|basedir> [-w]
|
||||||
Build a base directory from bsd install media. Options:
|
Build a base directory from bsd install media. Options:
|
||||||
-b <name> <name> can be the name of a base (e.g. 12.2-RELEASE)
|
-b <name> <name> can be the name of a base (e.g. 12.2-RELEASE)
|
||||||
or a directory where it shall be created
|
or a directory where it shall be created
|
||||||
-w Create a writable base, including compiler and other
|
-w Create a writable base, including compiler and other
|
||||||
build stuff. Use this if you want to use the ports
|
build stuff. Use this if you want to use the ports
|
||||||
collection."
|
collection.
|
||||||
|
-f force mode, remove any old dist files.
|
||||||
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
jaildk_base() {
|
jaildk_base() {
|
||||||
base=""
|
base=""
|
||||||
|
force=""
|
||||||
rw=""
|
rw=""
|
||||||
|
|
||||||
while getopts "b:w" arg; do
|
while getopts "b:wf" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
w) rw=1;;
|
w) rw=1;;
|
||||||
b) base=${OPTARG};;
|
b) base=${OPTARG};;
|
||||||
|
f) force=1;;
|
||||||
*) usage_base;;
|
*) usage_base;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -737,6 +741,27 @@ var/tmp"
|
|||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
ex mkdir -p $basedir
|
ex mkdir -p $basedir
|
||||||
|
|
||||||
|
if test -e /usr/freebsd-dist/MANIFEST; then
|
||||||
|
clean=''
|
||||||
|
if test -n "$force"; then
|
||||||
|
clean=1
|
||||||
|
else
|
||||||
|
echo "Found old dist files:"
|
||||||
|
ls -l /usr/freebsd-dist
|
||||||
|
echo -n "Want to remove them [Yn]? "
|
||||||
|
read yesno
|
||||||
|
case $yesno in
|
||||||
|
n) clean='';;
|
||||||
|
*) clean=1;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test -n "$clean"; then
|
||||||
|
ex rm -f /usr/freebsd-dist/*
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
bsdinstall jail $basedir || exit 1
|
bsdinstall jail $basedir || exit 1
|
||||||
|
|
||||||
if test -z "$rw"; then
|
if test -z "$rw"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user