head 1.22; access; symbols SHTOOL_2_0_8:1.22 SHTOOL_2_0_7:1.21 SHTOOL_2_0_6:1.20 SHTOOL_2_0_5:1.20 SHTOOL_2_0_4:1.20 SHTOOL_2_0_3:1.19 SHTOOL_2_0_2:1.19 SHTOOL_2_0_1:1.18 SHTOOL_2_0_0:1.18 SHTOOL_2_0b3:1.18 SHTOOL_2_0b2:1.18 SHTOOL_2_0b1:1.18 SHTOOL_1_6:1.14.0.2 SHTOOL_1_6_2:1.14 SHTOOL_1_6_1:1.14 SHTOOL_1_6_0:1.14 SHTOOL_1_5:1.12.0.2 SHTOOL_1_5_4:1.12 SHTOOL_1_5_3:1.12 SHTOOL_1_5_2:1.12 SHTOOL_1_5_1:1.11 SHTOOL_1_5_0:1.11 SHTOOL_1_4_9:1.11 SHTOOL_1_4_8:1.10 SHTOOL_1_4_7:1.8 SHTOOL_1_4_6:1.8 SHTOOL_1_4_5:1.8 SHTOOL_1_4_4:1.8 SHTOOL_1_4_3:1.8 SHTOOL_1_4_2:1.8 SHTOOL_1_4_1:1.8 SHTOOL_1_4_0:1.8 SHTOOL_1_3_3:1.7 SHTOOL_1_3_2:1.7 SHTOOL_1_3_1:1.6 SHTOOL_1_3_0:1.6 SHTOOL_1_2_9:1.2 SHTOOL_1_2_8:1.2 SHTOOL_1_2_7:1.2 SHTOOL_1_2_6:1.2 SHTOOL_1_2_5:1.1.1.1 SHTOOL_1_2_4:1.1.1.1 SHTOOL_1_2_3:1.1.1.1 SHTOOL_1_2_2:1.1.1.1 SHTOOL_1_2_1:1.1.1.1 SHTOOL_1_2_0:1.1.1.1 SHTOOL_1_1_0:1.1.1.1 RSE:1.1.1; locks; strict; comment @# @; 1.22 date 2008.04.02.20.13.43; author rse; state Exp; branches; next 1.21; commitid eB5Wirx8MdMyDzXs; 1.21 date 2007.05.19.19.09.39; author rse; state Exp; branches; next 1.20; commitid OPUF1UBbllBTwzis; 1.20 date 2006.02.04.09.43.25; author rse; state Exp; branches; next 1.19; commitid oWk7BmnyAitJtfkr; 1.19 date 2005.06.15.08.14.35; author rse; state Exp; branches; next 1.18; 1.18 date 2004.02.12.16.06.26; author rse; state Exp; branches; next 1.17; 1.17 date 2004.01.01.16.54.20; author rse; state Exp; branches; next 1.16; 1.16 date 2003.02.11.13.00.50; author rse; state Exp; branches; next 1.15; 1.15 date 2002.12.16.13.50.20; author rse; state Exp; branches; next 1.14; 1.14 date 2001.12.31.15.06.04; author rse; state Exp; branches; next 1.13; 1.13 date 2001.09.23.10.58.10; author rse; state Exp; branches; next 1.12; 1.12 date 2001.01.17.09.55.11; author rse; state Exp; branches; next 1.11; 1.11 date 2000.03.24.15.22.51; author rse; state Exp; branches; next 1.10; 1.10 date 2000.03.12.13.28.24; author rse; state Exp; branches; next 1.9; 1.9 date 2000.03.12.11.12.21; author rse; state Exp; branches; next 1.8; 1.8 date 99.07.01.14.56.58; author rse; state Exp; branches; next 1.7; 1.7 date 99.06.28.15.18.44; author rse; state Exp; branches; next 1.6; 1.6 date 99.06.17.14.49.22; author rse; state Exp; branches; next 1.5; 1.5 date 99.06.17.07.35.08; author rse; state Exp; branches; next 1.4; 1.4 date 99.06.12.14.46.37; author rse; state Exp; branches; next 1.3; 1.3 date 99.06.12.14.08.49; author rse; state Exp; branches; next 1.2; 1.2 date 99.05.13.12.31.37; author rse; state Exp; branches; next 1.1; 1.1 date 99.04.29.11.19.49; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.04.29.11.19.49; author rse; state Exp; branches; next ; desc @@ 1.22 log @adjust copyright for year 2008 @ text @## ## fixperm -- Fix file permissions inside a source tree ## Copyright (c) 1996-2008 Ralf S. Engelschall ## ## This file is part of shtool and free software; you can redistribute ## it and/or modify it under the terms of the GNU General Public ## License as published by the Free Software Foundation; either version ## 2 of the License, or (at your option) any later version. ## ## This file is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## str_tool="fixperm" str_usage="[-v|--verbose] [-t|--trace] [ ...]" arg_spec="1+" opt_spec="v.t." opt_alias="v:verbose,t:trace" opt_v=no opt_t=no . ./sh.common paths="$*" # check whether the test command supports the -x option if [ -x /bin/sh ] 2>/dev/null; then minusx="-x" else minusx="-r" fi # iterate over paths for p in $paths; do for file in `find $p -depth -print`; do if [ -f $file ]; then if [ $minusx $file ]; then if [ ".$opt_v" = .yes ]; then echo "-rwxr-xr-x $file" 2>&1 fi if [ ".$opt_t" = .yes ]; then echo "chmod 755 $file" 2>&1 fi chmod 755 $file else if [ ".$opt_v" = .yes ]; then echo "-rw-r--r-- $file" 2>&1 fi if [ ".$opt_t" = .yes ]; then echo "chmod 644 $file" 2>&1 fi chmod 644 $file fi continue fi if [ -d $file ]; then if [ ".$opt_v" = .yes ]; then echo "drwxr-xr-x $file" 2>&1 fi if [ ".$opt_t" = .yes ]; then echo "chmod 755 $file" 2>&1 fi chmod 755 $file continue fi if [ ".$opt_v" = .yes ]; then echo "?????????? $file" 2>&1 fi done done shtool_exit 0 ## ## manual page ## =pod =head1 NAME B - B file permission fixing command =head1 SYNOPSIS B [B<-v>|B<--verbose>] [B<-t>|B<--trace>] I [I ...] =head1 DESCRIPTION B fixes file permissions inside a source tree under I by cleaning up the permission bits. It determines the cleaned up permission from the already set bits. It is intended to be run before a tarball is rolled (usually with B) out of a source tree. The trick is that this is more convenient than having to set the permissions manually or by using a large file list. =head1 OPTIONS The following command line options are available. =over 4 =item B<-v>, B<--verbose> Display some processing information. =item B<-t>, B<--trace> Enable the output of the essential shell commands which are executed. =back =head1 EXAMPLE # Makefile.in dist: shtool fixperm -v * ... =head1 HISTORY The B B command was originally written by Ralf S. Engelschall Erse@@engelschall.comE in 1996 for I. It was later taken over into B. =head1 SEE ALSO shtool(1), chmod(1). =cut @ 1.21 log @Adjust copyright for year 2007. @ text @d3 1 a3 1 ## Copyright (c) 1996-2007 Ralf S. Engelschall @ 1.20 log @Adjust copyright for year 2006 @ text @d3 1 a3 1 ## Copyright (c) 1996-2006 Ralf S. Engelschall @ 1.19 log @Adjust copyright for year 2005 @ text @d3 1 a3 1 ## Copyright (c) 1996-2005 Ralf S. Engelschall @ 1.18 log @Embedded the command documentation from shtool.pod into the individual sh.xxxx scripts and this way split the large shtool(1) manual page into individual manual pages shtool-xxxx(1). Submitted partly by: Thomas Lotterer @ text @d3 1 a3 1 ## Copyright (c) 1996-2004 Ralf S. Engelschall @ 1.17 log @Bump copyright year for 2004 @ text @a3 1 ## Originally written for ePerl d78 64 @ 1.16 log @Bump year in copyright messages to cover new year 2003. @ text @d3 1 a3 1 ## Copyright (c) 1996-2003 Ralf S. Engelschall @ 1.15 log @Changed 'shtool fixperm' to no longer set group writeability. @ text @d3 1 a3 1 ## Copyright (c) 1996-2002 Ralf S. Engelschall @ 1.14 log @bump copyright years @ text @d47 1 a47 1 echo "-rwxrwxr-x $file" 2>&1 d50 1 a50 1 echo "chmod 775 $file" 2>&1 d52 1 a52 1 chmod 775 $file d55 1 a55 1 echo "-rw-rw-r-- $file" 2>&1 d58 1 a58 1 echo "chmod 664 $file" 2>&1 d60 1 a60 1 chmod 664 $file d66 1 a66 1 echo "drwxrwxr-x $file" 2>&1 d69 1 a69 1 echo "chmod 775 $file" 2>&1 d71 1 a71 1 chmod 775 $file @ 1.13 log @*** empty log message *** @ text @d3 1 a3 1 ## Copyright (c) 1996-2001 Ralf S. Engelschall @ 1.12 log @*** empty log message *** @ text @d23 1 a23 1 str_usage="[-v] [-t] [ ...]" d26 1 @ 1.11 log @*** empty log message *** @ text @d3 1 a3 1 ## Copyright (c) 1996-2000 Ralf S. Engelschall @ 1.10 log @*** empty log message *** @ text @a23 1 gen_tmpfile=yes d34 1 a34 7 cat >$tmpfile </dev/null; then a38 1 rm -f $tmpfile @ 1.9 log @*** empty log message *** @ text @d26 3 a28 1 opt_spec="vt" @ 1.8 log @*** empty log message *** @ text @d3 1 a3 1 ## Copyright (c) 1996-1999 Ralf S. Engelschall @ 1.7 log @*** empty log message *** @ text @d23 1 a23 1 str_usage="[-v] [ ...]" d26 1 a26 1 opt_spec="v" d52 4 a55 1 echo "-rwxrwxr-x $file" d60 4 a63 1 echo "-rw-rw-r-- $file" d71 4 a74 1 echo "drwxrwxr-x $file" d80 1 a80 1 echo "?????????? $file" @ 1.6 log @*** empty log message *** @ text @d28 1 a28 1 . sh.common @ 1.5 log @*** empty log message *** @ text @d52 1 a52 1 echo " [EXE] $file" d57 1 a57 1 echo " [REG] $file" d65 1 a65 1 echo " [DIR] $file" d71 1 a71 1 echo " $file (??)" @ 1.4 log @*** empty log message *** @ text @d23 1 a23 1 str_usage="[-v] [ ...]" @ 1.3 log @*** empty log message *** @ text @d6 15 @ 1.2 log @*** empty log message *** @ text @a0 1 #!/bin/sh d2 1 a2 1 ## fixperm -- Fix file permission inside a source tree d4 1 a4 1 ## Usage: fixperm [-s] [ ...] d7 8 a14 14 # # command line parsing # silent=no while [ ".$1" != . ]; do case $1 in -s ) silent=yes ; shift; continue ;; * ) break ;; esac done if [ $# -eq 0 ]; then echo "$0:Usage: fixperm [-s] [ ...]" 1>&2 exit 1 fi a16 1 # a17 10 # tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" else if [ ".$TEMPDIR" != . ]; then tmpdir="$TEMPDIR" fi fi tmpfile="$tmpdir/shtool.path.tmp.$$" a30 1 # a31 1 # d36 2 a37 2 if [ $silent = no ]; then echo " $file (FILE/EXEC)" d41 2 a42 2 if [ $silent = no ]; then echo " $file (FILE/REGULAR)" d49 2 a50 2 if [ $silent = no ]; then echo " $file (DIR)" d55 2 a56 2 if [ $silent = no ]; then echo " $file (UNKNOWN)" @ 1.1 log @Initial revision @ text @d5 1 a5 1 ## Usage: fixperm [ ...] d8 45 a52 1 for p in $*; do d55 4 a58 2 if [ -x $file ]; then echo " $file (FILE/EXEC)" d61 3 a63 1 echo " $file (FILE/REGULAR)" d69 3 a71 1 echo " $file (DIR)" d75 3 a77 1 echo " $file (UNKNOWN)" @ 1.1.1.1 log @Import of shtool 1.1.0 @ text @@