File: framework-package-remove

package info (click to toggle)
cli-common 0.10
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 284 kB
  • sloc: perl: 1,198; sh: 103; makefile: 44
file content (33 lines) | stat: -rwxr-xr-x 651 bytes parent folder | download | duplicates (2)
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
29
30
31
32
33
#!/bin/bash

function supports_framework_remove ()
{
    echo Checking $1
    if [ -x $1 ]; then
	if $1 2>&1 | grep "remove-framework" > /dev/null; then
	    echo supported
	    return 0
	fi
    fi
    echo unsupported
    return 1
}

# If there is a second argument, it's the only runtime to remove
if [ -n "$2" ]; then
    RUNTIMES=/usr/share/cli-common/runtimes.d/$2
else
    RUNTIMES=/usr/share/cli-common/runtimes.d/*
fi

for file in $RUNTIMES
  do
  if supports_framework_remove $file ; then
      # Figure out the formal name
      F="$($file name)"

      # Remove it
      echo "Removing $1 from $F"
      $file remove-framework $1
  fi
done