Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1078709
  • 博文数量: 165
  • 博客积分: 3900
  • 博客等级: 中校
  • 技术积分: 1887
  • 用 户 组: 普通用户
  • 注册时间: 2007-04-06 15:15
文章分类

全部博文(165)

文章存档

2020年(3)

2019年(8)

2017年(2)

2016年(8)

2015年(14)

2013年(15)

2012年(32)

2011年(11)

2010年(14)

2009年(7)

2008年(20)

2007年(31)

分类:

2010-08-05 17:11:42


#!/bin/bash
DEST=/vobs/android/src/nec/hal/ # the dest to import to
PKG=sec_test   # the package name
BRANCH=sec_iw_sec_testcode  #the branch name import onto
deepls() {
pushd $1
  for x in `ls`
  do
  tail=${PWD}/$x
  tail_1=${tail#/tmp/}  #/get the sufix for mkbranch
  if [ -f $x ]; then
     #touch  ${DEST}/${tail_1}
     cleartool mkelem -nc -nco ${DEST}/${tail_1}
     cleartool mkbranch -nc ${BRANCH} ${DEST}/${tail_1}
     cp -rf ${PWD}/$x ${DEST}/${tail_1}
     cleartool ci -nc ${DEST}/${tail_1}
  fi
  if [ -d $x ]; then
      cleartool mkdir  -nc -nco  ${DEST}/${tail_1}
      cleartool mkbranch -nc ${BRANCH} ${DEST}/${tail_1}
      deepls "$x"
      cleartool ci -nc ${DEST}/${tail_1}
      popd
  fi
  done
}
#cleartool mkdir -nc -nco ${DEST}/${PKG}   # mkdir(/main/0) first
 
cleartool mkbranch -nc ${BRANCH} ${DEST}/${PKG} # make the first branch
deepls $1

阅读(1208) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~