summaryrefslogtreecommitdiffstats
path: root/scripts/patchfns.in
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2003-10-26 16:36:54 +0000
committerAndreas Gruenbacher <agruen@suse.de>2003-10-26 16:36:54 +0000
commit6512ed3c11524aa7f67d4568a961af10bf840732 (patch)
tree64688c0a542427f4b0debb0ac6851b99b41b28da /scripts/patchfns.in
parentfa8a69af263c29ac5243e21878f24a3b175e11e6 (diff)
downloadquilt-6512ed3c11524aa7f67d4568a961af10bf840732.tar.gz
- Get rid of patches_per cache_in `quilt patches'. Remove
patches_per_file and associated functions. `quilt patches' now is a bit slow for unapplied patches.
Diffstat (limited to 'scripts/patchfns.in')
-rw-r--r--scripts/patchfns.in100
1 files changed, 0 insertions, 100 deletions
diff --git a/scripts/patchfns.in b/scripts/patchfns.in
index 361087c..2b40830 100644
--- a/scripts/patchfns.in
+++ b/scripts/patchfns.in
@@ -367,106 +367,6 @@ next_patch_for_file()
| head -n 1 \
| @SED@ -e 's:^\.pc/::' -e 's:/\.pc$::'
fi
-
- #modified_files $file -- $patches_on_top \
- #| cut -d $'\t' -f2 \
- #| cut -d ' ' -f1
-}
-
-# Create a list of files and the patches that modify them.
-refresh_patches_per_file()
-{
- local pc_files=$(pc_file_name $(cat_series))
- local ex_pc_files pc_file
-
- if [ -e .pc/patches-per-file ]
- then
- local needs_refresh
- for pc_file in pc_files
- do
- if [ .pc/patches-per-file -ot $pc_file ]
- then
- needs_refresh=1
- break
- fi
- done
- if [ -z "$needs_refresh" ]
- then
- return 0
- fi
- fi
-
- for pc_file in $pc_files
- do
- if [ -e $pc_file ]
- then
- ex_pc_files[${#ex_pc_files[@]}]=$pc_file
- fi
- done
-
- if [ ${#ex_pc_files[@]} -eq 0 ]
- then
- rm -f .pc/patches-per-file
- return 0
- fi
-
- @AWK@ '
- ARGIND!=saved { sub(/^.pc\//, "", FILENAME)
- sub(/\/\.pc/, "", FILENAME)
- saved=ARGIND
- }
- { if (files[$0])
- files[$0]=files[$0] " " FILENAME
- else
- files[$0]=FILENAME
- }
- END { for (file in files)
- printf "%s\t%s\n", file, files[file]
- }
- ' "${ex_pc_files[@]}" > .pc/patches-per-file
-}
-
-# For a lists of patches and a list of files, compute which patches
-# modify which files. Invoked as
-# modified_files file ... [-- patch ...]
-#
-modified_files()
-{
- if ! refresh_patches_per_file
- then
- return 1
- fi
-
- @AWK@ '
- BEGIN { no_files=1
- no_patches=1
- for (i=1; i<ARGC; i++) {
- if (ARGV[i]=="--")
- break
- files[ARGV[i]]=1
- no_files=0
- }
- for (i++; i<ARGC; i++) {
- patches[ARGV[i]]=1
- no_patches=0
- }
- split("", ARGV) # read from standard input
- }
- no_files || files[$1] {
- if (no_patches) {
- print
- next
- }
- for (i=2; i<=NF; i++)
- if ($i in patches) {
- printf "%s\t%s", $1, $i
- for (i++; i<=NF; i++)
- if ($i in patches)
- printf " %s", $i
- printf "\n"
- }
- }
- ' "$@" < .pc/patches-per-file
}
add_to_db()