/dev/null;|;grep;"Working;revision:";|;awk;"{print;$3}";>$tmpfile ) OARG1=`cat;$tmpfile` rm;-f;$tmpfile;2>/dev/null fi if;[;"$OARG1";=;"";];;t。2 CVS RCS HOWTO 原始程式码版本控制系统( 四 )。" />

2 CVS RCS HOWTO 原始程式码版本控制系统( 四 )


if;[;"$FLAG1";=;"";];;then
(
cd;$hme
cvs;status;$fdname;2>/dev/null;|;grep;"Working;revision:";|;awk;"{print;$3}";>$tmpfile
)
OARG1=`cat;$tmpfile`
rm;-f;$tmpfile;2>/dev/null
fi

if;[;"$OARG1";=;"";];;then
print;"The;file;$fdname;is;NEW,;it;is;not;in;the;CVS;repository"
else
lockfile=$cldir/$1-$OARG1
if;[;-e;$lockfile;];;then
#;Check;if;this;revision;is;owned;by;you...
aa=`;ls;-l;$lockfile;|;awk;"{print;$3}";`
userid=`id;|;cut;-d"(";-f2;|;cut;-d")";-f1;`
if;[;"$aa";!=;"$userid";];;then
print;";"
print;"The;file;$fdname;is;NOT;locked;by;you!!"
print;"It;is;locked;by;unix;user;name;$aa;and;your;login;name;is;$userid"
#;;;;;;;print;"If;you;are;working;concurrently;with;other;developer"
#;;;;;;;print;"and;you;used;-F;option;with;sedit."
print;"You;need;to;wait;untill;other;developer;does;scommit"
print;"or;sunlock"
print;"Aborting;the;$cmdname;...."
print;";"
exit;2
fi
else
if;[;-f;$CVSROOT/$subdir/$1,v;];;then
print;"You;did;not;lock;the;file;$fdname;with;sedit!!"
print;"Aborting;the;$cmdname;...."
exit;2;
else
print;"nThe;file;$fdname;does;not;exist;in;CVS;repository;yet!!"
print;"You;should;have;done;sadd;on;$fdname;...."
fi
fi
fi

if;[;-d;$1;];;then
Usage
exit;2
#;Do;not;allow;directory;commits;for;now;...
#cvs;commit
else
cvs;commit;$1
exit_status=$?
fi

if;[;$exit_status;-eq;0;];;then
print;"nDone;$cmdname.;$cmdname;successful"
#print;"nTip;(Usage):;$cmdname;n"
fi


--------------------------------------------------------------------------------

4.4;supdate;
注意;:;Korn;shell;/bin/ksh;在你从Linux;CD-ROM;安装;pdksh*.rpm;时就会产生;

请把他存成一般文字档并改变存取权限;chmod;a rx;



--------------------------------------------------------------------------------

#!/bin/ksh

#;CVS;program;supdate
#;Program;to;update;the;file;from;CVS;read/write;mode

cmdname=`basename;$0`

if;[;$#;-lt;1;];;then
print;"nUsage:;$cmdname;"
exit
fi

#;Check;if;file;already;exists....
if;[;$#;-gt;0;-a;;-f;$1;];;then
user_perms=";"
group_perms=";"
other_perms=";"
user_perms=`ls;-l;$1;|;awk;"{print;$1;}";|;cut;-b3-3;`
group_perms=`ls;-l;$1;|;awk;"{print;$1;}";|;cut;-b6-6;`
other_perms=`ls;-l;$1;|;awk;"{print;$1;}";|;cut;-b9-9;`
if;[;"$user_perms";=;"w";-o;"$group_perms";=;"w"
-o;"$other_perms";=;"w";];;then
while;:
do
print;"n$cmdname;will;backup;your;working;file;"
print;"$1;to;$1.supdate_bak;before;doing;any;merges."
print;"Are;you;sure;you;want;the;merge;the;changes;from"
print;-n;"CVS;repository;to;your;working;file;?;[n]:;"
read;ans
if;[;"$ans";=;"y";-o;"$ans";=;"Y";];;then
if;[;-f;$1.supdate_bak;];;then
print;"nWarning;:;File;$1.supdate_bak;already;exists!!"
print;"Please;examine;the;file;$1.supdate_bak;and;delete;it"
print;"and;than;re-try;this;$cmdname;"
print;"Aborting;$cmdname;...."
exit
else
cp;$1;$1.supdate_bak
break
fi
elif;[;"$ans";=;"n";-o;"$ans";=;"N";-o;"$ans";=;"";-o;"$ans";=;";";];;then
exit
fi
done
fi
fi

if;[;-d;$1;];;then
print;"nDirectory;update;is;disabled;as;cvs;update"
print;"merges;the;changes;from;repository;to;your;working;directory"
print;"So;give;the;filename;to;update;-;as;shown;below:;"
print;";Usage:;$cmdname;"
exit
#;;;;;;;cvs;update
else
cvs;update;$1
fi

print;"nDone;$cmdname.;$cmdname;successful"
#print;"nTip;(Usage):;$cmdname;n"


--------------------------------------------------------------------------------

4.5;sunlock;
注意;:;Korn;shell;/bin/ksh;在你从Linux;CD-ROM;安装;pdksh*.rpm;时就会产生;

请把他存成一般文字档并改变存取权限;chmod;a rx.;



--------------------------------------------------------------------------------

推荐阅读