public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gdb] gdb-17.2-rebase-f44: update generate-*-from-*.sh so they can apply patches to any directory, not just a subdir
@ 2026-06-28  0:00 Bruno Larsen
  0 siblings, 0 replies; only message in thread
From: Bruno Larsen @ 2026-06-28  0:00 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/gdb
Branch : gdb-17.2-rebase-f44
Commit : b3cbe4b669cd1ed23884d9cc9c3da9fd08d314ca
Author : Bruno Larsen <blarsen@redhat.com>
Date   : 2022-06-06T16:28:12-03:00
Stats  : +7/-6 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/gdb/c/b3cbe4b669cd1ed23884d9cc9c3da9fd08d314ca?branch=gdb-17.2-rebase-f44

Log:
update generate-*-from-*.sh so they can apply patches to any directory, not just a subdir

---
diff --git a/generate-git-repo-from-patches.sh b/generate-git-repo-from-patches.sh
index 8477e30..8646c4e 100755
--- a/generate-git-repo-from-patches.sh
+++ b/generate-git-repo-from-patches.sh
@@ -51,12 +51,12 @@ test -f _patch_order || die "Cannot find _patch_order file."
 
 last_ancestor_commit=`cat _git_upstream_commit`
 
+f=`pwd`
 cd $1
 
 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'?"
 
-f=`cd .. && pwd`
 
 # Create a branch for the checkout if using stgit; use the distro name in
 # the name of this branch.
@@ -69,8 +69,8 @@ fi
 git checkout $branch $last_ancestor_commit
 
 echo "Applying patches..."
-for p in `cat ../_patch_order` ; do
-    git am ../$p
+for p in `cat $f/_patch_order` ; do
+    git am $f/$p
     test $? -eq 0 || die "Could not apply patch '$p'."
 done
 

diff --git a/generate-patches-from-git-repo.sh b/generate-patches-from-git-repo.sh
index c9bc3a9..7947c8a 100755
--- a/generate-patches-from-git-repo.sh
+++ b/generate-patches-from-git-repo.sh
@@ -50,6 +50,7 @@ for f in `cat _patch_order` ; do
     git rm -f $f
 done
 
+orig_dir=`pwd`
 cd $1
 
 # 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
     # the commit hash by something constant (the string
     # "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
-    (cd .. && git add $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 $orig_dir && git add $fname)
 
     cat >> $temp_PATCH_file <<EOF
 `git log -1 --pretty='format:%b' $c | sed -n 's/^;;/#/p'`
@@ -94,7 +95,7 @@ EOF
     idx=`expr $idx + 1`
 done
 
-cd ..
+cd $orig_dir
 mv $temp_PATCH_file _gdb.spec.Patch.include
 mv $temp_patch_file _gdb.spec.patch.include
 mv $temp_patch_order_file _patch_order

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-28  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-28  0:00 [rpms/gdb] gdb-17.2-rebase-f44: update generate-*-from-*.sh so they can apply patches to any directory, not just a subdir Bruno Larsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox