File: cmake_uninstall.sh

package info (click to toggle)
kernelshark 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,744 kB
  • sloc: cpp: 12,517; ansic: 11,546; makefile: 89; sh: 89
file content (28 lines) | stat: -rwxr-xr-x 480 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

CYAN='\e[36m'
PURPLE='\e[35m'
NC='\e[0m' # No Color

uninstall () {
    NAME=$1
    NAME=${NAME##*_}
    NAME=${NAME%.*}
    NAME=${NAME/manifest/the project}
    if [ -e $1 ]
    then
        echo -e "${CYAN}Uninstall " $NAME"...${NC}"
        xargs rm -v < $1
        rm -f $1
    fi
}

if [[ $EUID -ne 0 ]]; then
   echo -e "${PURPLE}Permission denied${NC}" 1>&2
   exit 100
fi

for manifest in "$search_dir"${PWD}/install_manifest*
do
   uninstall $manifest
done