Thursday, April 30, 2009

CVS Enhancement

Code Freeze:

Following can be used to prevent developers check in any file by accident when the source tree is ready for a release.

First, create a new directory $CVSROOT/CVSROOT/Freeze to keep the files for tree freeze. Each file is for a either a HEAD (at trunk) or branch. Following function check if the current tree is under freeze policy before perform the commit or import commands. This cvs function can be part of profile, so once the user login the system, it is loaded right away.

cvs ()
{
# check for code freeze
if [ "$1" = commit -o "$1" = import ]; then
if [ ! -f "CVS/Repository" ]; then
echo "Cannot find CVS/Repository.Please check
you current directory."
return 1
fi
if [ -f CVS/Tag ]; then
CVSTAG=`cat CVS/Tag | sed -e 's/.//'`
if [ -f $CVSROOT/CVSROOT/Freeze/$CVSTAG ]; then
echo "Sorry. Code freeze for the branch
$CVSTAG."
return 2
fi
elif [ -f $CVSROOT/CVSROOT/Freeze/HEAD ]; then
echo "Sorry. Code freeze for the main trunk."
return 3
fi
fi
command cvs "$@"
}


Time Stamp for Tags or Branches

The "cvs log" command displays the tag and branch names with the revision of the file without date information.

To have a clear history for tags, create a tag history file in $CVSROOT/CVSROOT/logs/tags.history. Put following lines in the release script to append the tag to the history with the date information. To create new branch, a similar script can be created.

HISTORY=$CVSROOT/CVSROOT/logs/tags.history
cvs tag $1 source database document tools buildlogs
echo "Tagged $1 source, database, document, tools, and \
buildlogs at `date`" | tee -a $HISTORY

Thursday, April 23, 2009

Powerful Unix find command

List the files contain the word Unix in the current tree:

find . -type f -exec grep -l Unix {} \;

Set permission to 644 for all files in the current tree:

find . -type f -exec chmod 644 {} \;

The number of files in the current tree:

find . -type f -exec ls -l {} \; | wc -l

All the text type files in the current tree:

find . -type f -exec file {} \; | grep text

Wednesday, April 22, 2009

Power Schemes problem in Windows XP

If the Power Schemes of Power Options Properties in Windows XP is set to Portable/Laptop, The system will be switched to standby state say after 20 minutes. However, this is a problem for the systems that provide the services to others, one of the example is the build system. The scheduled build tasks won't be able to start to perform the builds. Once a system could not start up scheduled tasks and stay in standby state, make sure the power schemes is not set to Portable/Laptop.

Thursday, April 16, 2009

Extract files from DAA/UIF disc image file with PowerISO

After download a CD/DVD image file in DAA or UIF format instead of the popular ISO, it's a headache to find a converter to open such image file, or retrieve some files from the image. I have tried daa2iso, MagicISO, and Active@ISO Burner but found various problems.

PowerISO can convert CD/DVD image file formats from BIN, NRG, CDI, DAA, and UIF, etc. to ISO format, extract files from the image to the hard disk, and make image file in ISO, BIN, or DAA formats.

To find out more PowerISO's features, please check http://www.poweriso.com.