URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 30 |
Rev 173 |
#!@KSH@
|
#!@KSH@
|
#
|
#
|
# $Id: lock-directory.in,v 1.2 2001-09-27 12:02:53 chris Exp $
|
# $Id: lock-directory.in,v 1.2 2001-09-27 12:02:53 chris Exp $
|
#
|
#
|
# Make a directory write protected
|
# Make a directory write protected
|
# Used to write protect the install point after a build
|
# Used to write protect the install point after a build
|
# to prevent inadvertant overwriting.
|
# to prevent inadvertant overwriting.
|
#
|
#
|
|
|
# is a particular command available on this machine?
|
# is a particular command available on this machine?
|
#
|
#
|
cmd_avail()
|
cmd_avail()
|
{
|
{
|
set -- `type $1 2>&1`
|
set -- `type $1 2>&1`
|
if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
|
if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
|
then
|
then
|
return 1
|
return 1
|
else
|
else
|
return 0
|
return 0
|
fi
|
fi
|
}
|
}
|
|
|
lock_directory() {
|
lock_directory() {
|
l_dir=$1/. # get any symlink out of the way using '.'
|
l_dir=$1/. # get any symlink out of the way using '.'
|
if [ -d $l_dir ]
|
if [ -d $l_dir ]
|
then
|
then
|
find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
|
find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
|
fi
|
fi
|
}
|
}
|
|
|
# Use gnu xargs if available; faster, more reliable in general
|
# Use gnu xargs if available; faster, more reliable in general
|
XARGS=xargs
|
XARGS=xargs
|
cmd_avail gxargs && XARGS=gxargs
|
cmd_avail gxargs && XARGS=gxargs
|
|
|
for dir
|
for dir
|
do
|
do
|
lock_directory $dir
|
lock_directory $dir
|
done
|
done
|
|
|
# Local Variables: ***
|
# Local Variables: ***
|
# mode:ksh ***
|
# mode:ksh ***
|
# End: ***
|
# End: ***
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.