throw error, if package does not exist on delete
This commit is contained in:
parent
ab0f7a38c5
commit
90bc34b49d
1 changed files with 7 additions and 2 deletions
|
@ -159,13 +159,18 @@ function sign_repo() {
|
|||
|
||||
function delete_pkg_from_repo() {
|
||||
check_container_image_existance
|
||||
local VERSION_ID=$(container_run "grep VERSION_ID= /etc/os-release")
|
||||
|
||||
if [[ -z $(find $REPO_DIR/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64 -name $1*.apk) ]]; then
|
||||
message_error "Package does not exist: $1!"
|
||||
fi
|
||||
|
||||
message_green_double_arrow "Deleting package: $1"
|
||||
if [ "$1" = "" ]; then
|
||||
>&2 message_error "Please provide a package name!"
|
||||
else
|
||||
message_blue_single_arrow "Removing package from database"
|
||||
local VERSION_ID=$(container_run "grep VERSION_ID= /etc/os-release")
|
||||
find $REPO_DIR/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64 -name $1* -exec rm -f {} \;
|
||||
find $REPO_DIR/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64 -name $1*.apk -exec rm -f {} \;
|
||||
refresh_repo
|
||||
sign_repo
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue