summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2014-02-21 18:27:05 +0100
committerJean Delvare <jdelvare@suse.de>2014-02-21 18:27:05 +0100
commit37d0c35ffae7bd656c06460eceed5cee4affe7bf (patch)
tree0d79630010ff517fd6a3f4ebf494f32037283a02
parent3059659624d735ef3a54d11de1f0a6e057b4d75b (diff)
downloadquilt-37d0c35ffae7bd656c06460eceed5cee4affe7bf.tar.gz
import: Move function find_patch_file
Function find_patch_file is only used by command import so move it to that file.
-rw-r--r--quilt/import.in25
-rw-r--r--quilt/scripts/patchfns.in25
2 files changed, 25 insertions, 25 deletions
diff --git a/quilt/import.in b/quilt/import.in
index 182d0e2..3798f66 100644
--- a/quilt/import.in
+++ b/quilt/import.in
@@ -49,6 +49,31 @@ current top patch, and must be pushed after import to apply them.
fi
}
+find_patch_file()
+{
+ local name="$1"
+
+ if [ ${name:0:1} = / ]
+ then
+ # Patch has absolute path
+ if [ -r "$name" ]
+ then
+ echo "$name"
+ return
+ fi
+ else
+ # Patch has a relative path
+ if [ -r "$SUBDIR$name" ]
+ then
+ echo "$SUBDIR$name"
+ return
+ fi
+ fi
+
+ printf $"Patch %s does not exist\n" "$name" >&2
+ return 1
+}
+
merge_patches()
{
local old="$1" new="$2"
diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
index c764d41..34e995e 100644
--- a/quilt/scripts/patchfns.in
+++ b/quilt/scripts/patchfns.in
@@ -623,31 +623,6 @@ find_unapplied_patch()
fi
}
-find_patch_file()
-{
- local name="$1"
-
- if [ ${name:0:1} = / ]
- then
- # Patch has absolute path
- if [ -r "$name" ]
- then
- echo "$name"
- return
- fi
- else
- # Patch has a relative path
- if [ -r "$SUBDIR$name" ]
- then
- echo "$SUBDIR$name"
- return
- fi
- fi
-
- printf $"Patch %s does not exist\n" "$name" >&2
- return 1
-}
-
file_in_patch()
{
local file=$1 patch=$2