vivi情景分析(一): 配置管理(五)

上一篇 / 下一篇  2008-06-13 17:29:17 / 个人分类:arm

readln函数实现在scrīpts/Configure内
113 #
114 # readln reads a line into $ans.
115 #
116 #       readln prompt default oldval
117 #
118 #"    Support OS Switching ($CONFIG_S3C2400_GAMEPARK_OSSWITCH) [Y/n/?]" "y" "y"
119 #"    Support OS Switching ($CONFIG_S3C2400_GAMEPARK_OSSWITCH) [N/y/?]" "n" "n"
120 #"    Support OS Switching ($CONFIG_S3C2400_GAMEPARK_OSSWITCH) [N/y/?]" "n"
121 #def $2, old $3
122 function readln () {
123         if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
124                 #如果$DEFAULT为-d, 且$3不为空
125                 #make oldconfig时,"$DEFAULT" = "-d"
126                 #使用默认值(如果.config对该选项赋值了,则取该值,如没有,则取n)
127                 echo "$1"
128                 ans=$2
129         else
130                 #make config
131                 #或者arch/config.in里存在,但.config中没有的选项
132                 echo -n "$1"
133                 #-z空串,如果是空串则显示
134                 [ -z "$3" ] && echo -n "(NEW) "
135                 #以@作为分隔符,将字符串读入ans
136                 IFS='@' read ans || exit 1
137                 #如果ans是空串,则取默认值
138                 [ -z "$ans" ] && ans=$2
139         fi
140 }


运行make config时,由于"$DEFAULT" = ""值,因此会给出提示,要用户进行选择,
运行make oldconfig时,如果config.in中有.config-is-not.$$没有涉及的选项,则也会给出
提示,要用户选择,如果config.in的选项已经赋值了,则采用缺省值



TAG: arm

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

我的栏目

日历

« 2008-12-05  
 123456
78910111213
14151617181920
21222324252627
28293031   

数据统计

  • 访问量: 4945
  • 日志数: 43
  • 建立时间: 2008-06-01
  • 更新时间: 2008-07-20

RSS订阅

Open Toolbar