Obtain TZ_BUILD_DATE in the same manner from OBS and QuickBuild
[platform/upstream/meta-generic.git] / scripts / generic-console-tools.post
1 #!/bin/sh
2 echo "#################### generic-console-tools.post ####################"
3
4 # customize bash prompt
5 cat >/etc/profile.d/bash_prompt_custom.sh <<'EOF'
6 if [ "$PS1" ]; then
7
8         function proml {
9                 # set a fancy prompt (overwrite the one in /etc/profile)
10                 local default="\[\e[0m\]"
11                 local usercol='\[\e[1;34m\]' # blue
12                 local hostcol='\[\e[1;32m\]' # green
13                 local pathcol='\[\e[1;33m\]' # yellow
14                 local gitcol='\[\e[1;31m\]' # light red
15                 local termcmd=''
16                 local _p="$";
17
18                 if [ "`id -u`" -eq 0 ]; then
19                         usercol='\[\e[1;31m\]'
20                         _p="#"
21                 fi
22
23                 PS1="${usercol}\u${default}@${hostcol}\h${default}:${pathcol}\w${default}${gitcol}${default}${_p} ${termcmd}"
24         }
25
26         proml
27
28         function rcd () {
29       [ "${1:0:1}" == "/" ] && { cd $1; } || { cd $(pwd -P)/$1; }
30    }
31
32         alias ll="ls -lZ"
33         alias lr="ls -ltrZ"
34         alias la="ls -alZ"
35
36         function get_manifest () {
37                 rpm -qa --queryformat="%{name} %{Version} %{Release} %{VCS}\n" | sort
38         }
39 fi
40 EOF
41