[cmd_fsck] Now permits choice in what tests one does
This commit is contained in:
parent
88c6e17d52
commit
ff71d6530d
1 changed files with 20 additions and 4 deletions
24
src/cmd_fsck
24
src/cmd_fsck
|
@ -12,13 +12,29 @@
|
||||||
|
|
||||||
cmd_fsck() {
|
cmd_fsck() {
|
||||||
local GIT_DIR="${1}"
|
local GIT_DIR="${1}"
|
||||||
local TARGET="${2}"
|
local TARGET="${2}"; shift 2
|
||||||
|
local cmdList=(${@})
|
||||||
local DB_FILE="${TARGET}/${_OPT_DB_FILE}"
|
local DB_FILE="${TARGET}/${_OPT_DB_FILE}"
|
||||||
[[ ! -f "${DB_FILE}" ]] && return 3
|
[[ ! -f "${DB_FILE}" ]] && return 3
|
||||||
[[ ! -d "${GIT_DIR}/.git" ]] && return 2
|
[[ ! -d "${GIT_DIR}/.git" ]] && return 2
|
||||||
|
|
||||||
chk_deployed_ids "${TARGET}" "${DB_FILE}"
|
case ${cmdList[@]} in
|
||||||
chk_nonexistent_ids "${TARGET}" "${DB_FILE}"
|
--deployed-ids)
|
||||||
chk_metadata "${GIT_DIR}" "${TARGET}" "${DB_FILE}"
|
chk_deployed_ids "${TARGET}" "${DB_FILE}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
--non-existent-ids)
|
||||||
|
chk_nonexistent_ids "${TARGET}" "${DB_FILE}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
--metadata)
|
||||||
|
chk_metadata "${GIT_DIR}" "${TARGET}" "${DB_FILE}"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
chk_deployed_ids "${TARGET}" "${DB_FILE}"
|
||||||
|
chk_nonexistent_ids "${TARGET}" "${DB_FILE}"
|
||||||
|
chk_metadata "${GIT_DIR}" "${TARGET}" "${DB_FILE}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue