ADC "rmrepo" replaced by "rm" and "trash", with helper ADCs
helpers for 'rm': lock, unlock helpers for 'trash': list-trash, undelete common functions updated with local settings for ADCs as well
This commit is contained in:
parent
a0aecbb012
commit
cb0a9bdb0c
10 changed files with 204 additions and 17 deletions
|
@ -2,6 +2,39 @@
|
|||
|
||||
# please make sure this file is NOT chmod +x
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# settings for various ADCs, collected in one place for ease of keeping local
|
||||
# settings intact during upgrades (you only have to worry about this file
|
||||
# now). Documentation for the variables, however, is in the respective ADC
|
||||
|
||||
# settings for 'rm' ADC
|
||||
ARE_YOU_SURE=1
|
||||
USE_LOCK_UNLOCK=1
|
||||
|
||||
# settings for 'trash' ADC
|
||||
TRASH_CAN=$GL_REPO_BASE_ABS/deleted
|
||||
TRASH_SUFFIX=`date +%Y-%m-%d_%H:%M:%S`
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# test an option value more concisely
|
||||
opt() {
|
||||
[ "$1" = "1" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
valid_owned_repo() {
|
||||
# check that an arg passed is a valid repo and the current user owns it
|
||||
repo=$1
|
||||
[ -z "$1" ] && die need a repo name
|
||||
get_rights_and_owner $repo
|
||||
[ "$owner" = "$GL_USER" ] || die "$repo does not exist or is not yours!"
|
||||
|
||||
# and we sneak this in too, quietly :)
|
||||
cd $GL_REPO_BASE_ABS
|
||||
}
|
||||
|
||||
die() { echo "$@"; exit 1; }
|
||||
|
||||
get_rights_and_owner() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue