File: gen-deps.sh

package info (click to toggle)
refpolicy 2%3A2.20190201-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,440 kB
  • sloc: python: 1,915; makefile: 612; ansic: 336; sh: 174; sed: 20; xml: 13; awk: 7
file content (19 lines) | stat: -rwxr-xr-x 459 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
cd /usr/share/selinux/default || exit 1

SEP="my %Deps = ("
semodule_deps base.pp a*pp backup.pp b[i-z]*pp [c-z]*pp | while read INPUT ; do
  echo $INPUT | grep -q ^module
  if [ "$?" = "0" ]; then
    MODULE=$(echo $INPUT|sed -e s/^module..//)
  else
    echo $INPUT | grep -q "no dependencies"
    if [ "$?" = "1" -a "$INPUT" != "}" ]; then
      echo -n "$SEP"
      SEP=", "
      echo -n " '$MODULE' => '$INPUT'"
    fi
  fi
done

echo " );"