update generate-*-from-*.sh so they can apply patches to any directory, not just a subdir
This commit is contained in:
parent
c14e8367f2
commit
b3cbe4b669
@ -51,12 +51,12 @@ test -f _patch_order || die "Cannot find _patch_order file."
|
|||||||
|
|
||||||
last_ancestor_commit=`cat _git_upstream_commit`
|
last_ancestor_commit=`cat _git_upstream_commit`
|
||||||
|
|
||||||
|
f=`pwd`
|
||||||
cd $1
|
cd $1
|
||||||
|
|
||||||
git name-rev $last_ancestor_commit
|
git name-rev $last_ancestor_commit
|
||||||
test $? -eq 0 || die "Could not find $last_ancestor_commit in the repository $1. Did you run 'git fetch'?"
|
test $? -eq 0 || die "Could not find $last_ancestor_commit in the repository $1. Did you run 'git fetch'?"
|
||||||
|
|
||||||
f=`cd .. && pwd`
|
|
||||||
|
|
||||||
# Create a branch for the checkout if using stgit; use the distro name in
|
# Create a branch for the checkout if using stgit; use the distro name in
|
||||||
# the name of this branch.
|
# the name of this branch.
|
||||||
@ -69,8 +69,8 @@ fi
|
|||||||
git checkout $branch $last_ancestor_commit
|
git checkout $branch $last_ancestor_commit
|
||||||
|
|
||||||
echo "Applying patches..."
|
echo "Applying patches..."
|
||||||
for p in `cat ../_patch_order` ; do
|
for p in `cat $f/_patch_order` ; do
|
||||||
git am ../$p
|
git am $f/$p
|
||||||
test $? -eq 0 || die "Could not apply patch '$p'."
|
test $? -eq 0 || die "Could not apply patch '$p'."
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ for f in `cat _patch_order` ; do
|
|||||||
git rm -f $f
|
git rm -f $f
|
||||||
done
|
done
|
||||||
|
|
||||||
|
orig_dir=`pwd`
|
||||||
cd $1
|
cd $1
|
||||||
|
|
||||||
# If patches were uncommitted when the patches were applied,
|
# If patches were uncommitted when the patches were applied,
|
||||||
@ -82,8 +83,8 @@ for c in `git rev-list --reverse ${common_ancestor}..HEAD` ; do
|
|||||||
# before, even if nothing has changed. This is bad, so we replace
|
# before, even if nothing has changed. This is bad, so we replace
|
||||||
# the commit hash by something constant (the string
|
# the commit hash by something constant (the string
|
||||||
# "FEDORA_PATCHES").
|
# "FEDORA_PATCHES").
|
||||||
git format-patch --no-signature --no-stat --keep-subject -1 --stdout $c | sed -e '1 s/^From [0-9a-f]\+ \(.*\)/From FEDORA_PATCHES \1/' -e '/^index [0-9a-f]\+\.\.[0-9a-f]\+.*$/d' > ../$fname
|
git format-patch --no-signature --no-stat --keep-subject -1 --stdout $c | sed -e '1 s/^From [0-9a-f]\+ \(.*\)/From FEDORA_PATCHES \1/' -e '/^index [0-9a-f]\+\.\.[0-9a-f]\+.*$/d' > $orig_dir/$fname
|
||||||
(cd .. && git add $fname)
|
(cd $orig_dir && git add $fname)
|
||||||
|
|
||||||
cat >> $temp_PATCH_file <<EOF
|
cat >> $temp_PATCH_file <<EOF
|
||||||
`git log -1 --pretty='format:%b' $c | sed -n 's/^;;/#/p'`
|
`git log -1 --pretty='format:%b' $c | sed -n 's/^;;/#/p'`
|
||||||
@ -94,7 +95,7 @@ EOF
|
|||||||
idx=`expr $idx + 1`
|
idx=`expr $idx + 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
cd ..
|
cd $orig_dir
|
||||||
mv $temp_PATCH_file _gdb.spec.Patch.include
|
mv $temp_PATCH_file _gdb.spec.Patch.include
|
||||||
mv $temp_patch_file _gdb.spec.patch.include
|
mv $temp_patch_file _gdb.spec.patch.include
|
||||||
mv $temp_patch_order_file _patch_order
|
mv $temp_patch_order_file _patch_order
|
||||||
|
Loading…
Reference in New Issue
Block a user