4 # Work out where the user's pc/, patch/ and txt/ directories live.
6 # If the user specified PATCHSCRIPTS in environment then use that (it's
7 # probably a relative path)
9 # If there is a directory ./patch-scripts then use that
14 if [ x$PATCHSCRIPTS != x ]
17 elif [ -d ./patch-scripts ]
24 echo "could not locate your pc/ and patches/ directories"
41 if echo $1 | egrep '^[0-9]*$' > /dev/null
52 if grep "^$name$" "$DB.1" > /dev/null 2>&1
65 if grep "^$name$" "$DB" > /dev/null 2>&1
75 if patch -p1 --dry-run -i "$1" -f
85 if patch -R -p1 --dry-run -i $P/patches/"$1".patch -f
95 tmpfile=$(mktemp /tmp/p_XXXXXX)
97 sed -e "/^$name$/d" < "$DB" > $tmpfile
104 ret=$(echo $ret | sed -e 's/\.patch$//')
105 ret=$(echo $ret | sed -e 's/\.pc$//')
106 ret=$(echo $ret | sed -e 's/\.txt$//')
112 patch_name=$(top_patch)
113 if [ x$patch_name == x ]
117 patch_file=$P/patches/"$patch_name".patch
118 files=$(cat $P/pc/$patch_name.pc)
121 if [ $file -nt $patch_file ]
123 echo $file newer than $patch_file
135 echo "Error: Top patch is not up-to-date"
144 echo "Warning: Top patch is not up-to-date"
153 if [ -e $P/pc/$patch.pc ]
155 if grep "^"$file"$" $P/pc/$patch.pc > /dev/null
163 # copy_file_to_bup filename patchname
172 echo "Cannot install file $file in patch $patch: backup $bup exists"
178 cp $file "$file"~"$patch"
180 echo "file $file appears to be newly added"
184 install_file_in_patch()
189 copy_file_to_bup $file $patch
190 echo $file >> $P/pc/$patch.pc
191 # touch $P/txt/$patch.txt
198 echo "File $1 does not exist"
211 elif [ x"$x" = xEDESC ]
228 if [ x"$x" = xEDESC ]
235 if [ $did_stuff = 0 ]