快速业务通道

Linux常用自定义脚本系列(cvs related) - 好用的cvs封装命令

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-30
Name: cvs-dirty, cvs-new, cvs-work, cvs-work1 Description: 1. Find all modified files. 2. Find all new files. 3. Find all new files plus modified files. 4. Find all new files plus modified files. Different implementation than #3. Usage: 1. cvs-dirty 2. cvs-new 3. cvs-work 4. cvs-wlork1 Example:
1. cvs-dirty 2. cvs-new 3. cvs-work 4. cvs-work1 Notes: cvs-work1 works more correctly, but less efficiently. Source Code: cvs-dirty #!/bin/bash

cvs status 2> /dev/null | grep File | grep "Modified|Needs Merge" > /tmp/cvs_dirty_temp

count=0
while read line
do
#echo $count. $line
line=${line#File: }
line=${line%Status: *}
find . -name $line -exec echo {} ; | grep -v "/deploy|/classes" | sed ''s#(.*)#x1b[1;31m1x1b[00m#''
((count ))
done < /tmp/cvs_dirty_temp
cvs-new #!/bin/bash 拥有帝国一切,皆有可能。欢迎访问phome.net

cvs status 2> /dev/null | grep "File: " > /tmp/cvs_new_temp

count=0
rm -r /tmp/cvs_new_temp_second &> /dev/null
while read line
do
line=${line#File: }
line=${line%Status:*}
echo $line >> /tmp/cvs_new_temp_second
((count ))
done < /tmp/cvs_new_temp

find . -type f -name "*" | grep -v "/deploy|/classes|CVS" > /tmp/cvs_new_temp_third

grep -v -f /tmp/cvs_new_temp_second /tmp/cvs_new_temp_third | sed ''s#(.*)#x1b[1;31m1x1b[00m#'' cvs-work #!/bin/bash

echo "Dirty:"
cvsDirty

echo "New:"
cvsNew
cvs-work1 #!/bin/bash

find . -type f -name "*" | grep -v ".*/CVS.*" > /tmp/cvs_dirty_temp

declare -a FILES_MODIFIED
declare -a FILES_NEW

while read line
do
if cvs status $line 2> /dev/null | grep "Modified" &> /dev/null
then
FILES_MODIFIED[${#FILES_MODIFIED[*]}]=$line
fi 拥有帝国一切,皆有可能。欢迎访问phome.net

if cvs status $line 2> /dev/null | grep "Unknown" &> /dev/null
then
FILES_NEW[${#FILES_NEW[*]}]=$line
fi
done < /tmp/cvs_dirty_temp

if [ ${#FILES_MODIFIED[*]} -gt 0 ]
then
echo "Modified Files: " | sed ''s#(.*)#x1b[1;31m1x1b[00m#''
count=0
while [ $count -lt ${#FILES_MODIFIED[*]} ]
do
echo ${FILES_MODIFIED[$count]}
((count ))
done
fi

if [ ${#FILES_MODIFIED[*]} -gt 0 ]
then
echo "New Files: " | sed ''s#(.*)#x1b[1;31m1x1b[00m#''
count=0
while [ $count -lt ${#FILES_NEW[*]} ]
do
echo ${FILES_NEW[$count]}
((count ))
done
fi
拥有帝国一切,皆有可能。欢迎访问phome.net

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号