OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems/] [tools/] [build/] [lock-directory.in] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 158 chris
#!@KSH@
2
#
3 208 chris
# $Id: lock-directory.in,v 1.2 2001-09-27 12:02:53 chris Exp $
4 158 chris
#
5
# Make a directory write protected
6
# Used to write protect the install point after a build
7
# to prevent inadvertant overwriting.
8
#
9
 
10
# is a particular command available on this machine?
11
#
12
cmd_avail()
13
{
14
    set -- `type $1 2>&1`
15
    if [ "$2" = "not" -a "$3" = "found" ] || [ "$3" = "not" -a "$4" = "found" ]
16
    then
17
        return 1
18
    else
19
        return 0
20
    fi
21
}
22
 
23
lock_directory() {
24
    l_dir=$1/.                  # get any symlink out of the way using '.'
25
    if [ -d $l_dir ]
26
    then
27
        find $l_dir -type d -perm -0200 -print | $XARGS chmod -w
28
    fi
29
}
30
 
31
# Use gnu xargs if available; faster, more reliable in general
32
XARGS=xargs
33
cmd_avail gxargs && XARGS=gxargs
34
 
35
for dir
36
do
37
    lock_directory $dir
38
done
39
 
40
# Local Variables: ***
41
# mode:ksh ***
42
# End: ***
43
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.