Richard Marian Thomaiyar | 14fddef | 2018-07-13 23:55:56 +0530 | [diff] [blame] | 1 | Upstream Status: Inappropriate [No upstream maintenance] |
| 2 | |
| 3 | Signed-off-by: Anne Mulhern <mulhern@yoctoproject.org> |
| 4 | |
| 5 | --- |
| 6 | |
| 7 | Index: Bastille/bin/bastille |
| 8 | =================================================================== |
| 9 | --- Bastille.orig/bin/bastille 2013-06-20 14:58:01.065796000 -0400 |
| 10 | +++ Bastille/bin/bastille 2013-08-20 15:16:18.472378000 -0400 |
| 11 | @@ -102,8 +102,9 @@ |
| 12 | # defines OS specific file locations based on uname |
| 13 | systemFileLocations |
| 14 | |
| 15 | + config_files=`find $config_repository -type f -name \*config 2>/dev/null` |
| 16 | + |
| 17 | if [ -f $last_config ]; then |
| 18 | - config_files=`find $config_repository -type f -name \*config 2>/dev/null` |
| 19 | for config_cursor in `echo $config_files` |
| 20 | do |
| 21 | if /usr/bin/diff $last_config $config_cursor >/dev/null 2>&1 |
| 22 | @@ -112,8 +113,8 @@ |
| 23 | fi |
| 24 | done |
| 25 | if [ -n "$match" ]; then |
| 26 | - echo "The last bastille run corresponds to the following profiles:" |
| 27 | - echo "$match" |
| 28 | + printf "The last Bastille run corresponds to the following profiles:\n" |
| 29 | + printf "$match" |
| 30 | else |
| 31 | cat >&2 << EOF |
| 32 | NOTE: The last config file applied, |
| 33 | @@ -122,18 +123,28 @@ |
| 34 | $ERRSPACES $config_repository. |
| 35 | $ERRSPACES This probably means that Bastille was last run interactively and |
| 36 | $ERRSPACES changes were made to the config file, but they have not yet been |
| 37 | -$ERRSPACES applied, or that the source config file was moved. If you do have pending |
| 38 | +$ERRSPACES applied, or that the source config file was moved. If you do have pending |
| 39 | $ERRSPACES changes in a config file, you can apply them by running |
| 40 | $ERRSPACES 'bastille -b -f <config file>.' |
| 41 | EOF |
| 42 | |
| 43 | fi |
| 44 | else |
| 45 | - echo "NOTE: The system is in its pre-bastilled state.\n" |
| 46 | + for config_cursor in `echo $config_files` |
| 47 | + do |
| 48 | + match="$match $config_cursor\n" |
| 49 | + done |
| 50 | + if [ -n "$match" ]; then |
| 51 | + printf "The following Bastille profiles were located:\n" |
| 52 | + printf "$match" |
| 53 | + else |
| 54 | + printf "No Bastille profiles were located.\n" |
| 55 | + fi |
| 56 | + printf "No log files of profiles from previous executions of Bastille have been found. It is likely that Bastille has not been run on this machine.\n" |
| 57 | fi |
| 58 | - |
| 59 | } |
| 60 | |
| 61 | + |
| 62 | # First, make sure we're root |
| 63 | if [ `PATH="/usr/bin:/bin"; id -u` -ne 0 ]; then |
| 64 | echo "ERROR: Bastille must be run as root user" >&2 |