SHA256
8
0
forked from pool/gdb
Files
gdb/import-fedora.sh
Tom de Vries 0e155d6874 - Simplify outdated comment in gdb.spec.
- Update to fedora rawhide @ 0481d32.
  Maintenance script import-fedora.sh:
  * Skip gdb-fix-bg-execution-repeat.patch.
- Add MIT in License tag due to gdbsupport/unordered_dense.h.
- Update to fedora rawhide @ 89e3933.
  Maintenance script import-fedora.sh:
  * Drop gdb-6.8-bz466901-backtrace-full-prelinked.patch from
    skip_patches.
- Update to fedora rawhide @ 660c52f.
  Drop patches:
  * gdb-rhbz1149205-catch-syscall-after-fork-test.patch
- Update to fedora rawhide @ 885cdf8.
  Update patches:
  * gdb-add-rpm-suggestion-script.patch
  Drop patches:
  * fixup-gdb-add-rpm-suggestion-script.patch
- Update to fedora rawhide @ 9c718a5.
  Drop patches:
  * gdb-6.3-mapping-zero-inode-test.patch
- Update to fedora rawhide @ 15778f3.
  Drop patches:
  * gdb-archer-next-over-throw-cxx-exec.patch
- Update to fedora rawhide @ 152468c.
  Maintenance script import-fedora.sh:
  * Rename gdb-6.3-rh-testversion-20041202.patch to
    gdb-test-show-version.patch in skip_patches.
  Patches dropped (Renamed to ...):
  * gdb-add-rpm-suggestion-script.patch
  Patches added (... this):
  * gdb-rpm-suggestion-script.patch
- Move some patches from "Backport from gdb-patches" to
  "Backports from master, available in GDB 17".
- Add patches (swo#33000):
  * gdb-tdep-fix-gdb.ada-finish-var-size.exp-on-ppc64le-.patch
- Add patches (swo#32409):
  * gdb-ada-fix-gdb.ada-overloads.exp-on-s390x.patch
- Add patches:
  * gdb-testsuite-make-gdb.reverse-time-reverse.exp-more.patch
  * gdb-testsuite-fix-gdb.reverse-time-reverse.exp-timeo.patch
  * gdb-testsuite-handle-asm-frame-in-gdb.python-py-miss.patch
  * gdb-testsuite-fix-gdb.base-ptype.exp-with-gcc-15.patch
  * gdb-testsuite-fix-gdb.python-py-objfile.exp-with-gcc.patch
  * gdb-testsuite-fix-gdb.ada-scalar_storage.exp-on-s390.patch
  * gdb-testsuite-fix-gdb.base-bp-permanent.exp-with-gcc.patch
  * gdb-testsuite-don-t-run-to-main-in-gdb.cp-cplusfuncs.patch

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=465
2025-06-05 13:03:19 +00:00

139 lines
2.4 KiB
Bash

#!/bin/bash
# Fedora Packages not copied:
#
skip_patches=(
# Not applicable for openSUSE.
gdb-add-index.patch
gdb-test-show-version.patch
# Dropped by fedora.
# Already present.
gdb-fix-bg-execution-repeat.patch
)
usage ()
{
echo "usage: $(basename "$0") <fedora package dir> "
}
dir="$1"
if [ ! -f "$dir"/_patch_order ]; then
usage
exit 1
fi
mark1="^#Fedora Packages begin"
mark2="^#Fedora Packages end"
mark3="^#Fedora patching start"
mark4="^#Fedora patching end"
remove_current_patches ()
{
# shellcheck disable=SC2207
current_patches=($(awk "/$mark1/,/$mark2/{ print }" gdb.spec \
| grep Patch \
| awk '{print $2}'))
for current_patch in "${current_patches[@]}"; do
rm -f "$current_patch"
done
}
skip ()
{
local p
p="$1"
for skip_patch in "${skip_patches[@]}"; do
if [ "$p" = "$skip_patch" ]; then
return 0
fi
done
return 1
}
import_patches ()
{
# Get the parts of gdb.spec that we want to keep unchanged.
awk "NR==1,/$mark1/" gdb.spec \
> gdb.spec.1
awk "/$mark2/,/$mark3/" gdb.spec \
> gdb.spec.3
awk "/$mark4/,0" gdb.spec \
> gdb.spec.5
# Start generating the parts of gdb.spec that we want to change.
f1=gdb.spec.2
f2=gdb.spec.4
rm -f $f1 $f2
# Handle each fedora patch.
skipped_patches=()
n=1
# shellcheck disable=SC2013
for p in $(cat "$dir"/_patch_order); do
if skip "$p"; then
echo "Skipped: $p"
skipped_patches=("${skipped_patches[@]}" "$p")
# Keep numbers the same as in fedora package.
n=$((n + 1))
continue
fi
cp "$dir"/"$p" .
printf \
"%-16s%s\n" "Patch$n:" "$p" \
>> $f1
echo \
"%patch -P $n -p1" \
>> $f2
n=$((n + 1))
done
# Report which patches did not get skipped.
for skip_patch in "${skip_patches[@]}"; do
found=false
for skipped_patch in "${skipped_patches[@]}"; do
if [ "$skip_patch" = "$skipped_patch" ]; then
found=true
break
fi
done
if ! $found; then
echo "Not skipped: $skip_patch"
fi
done
# Assemble new gdb.spec.
rm -f gdb.spec.new
for n in $(seq 1 5); do
cat gdb.spec."$n" \
>> gdb.spec.new
done
# Cleanup.
for n in $(seq 1 5); do
rm -f gdb.spec."$n"
done
# Update gdb.spec.
mv gdb.spec.new gdb.spec
}
main ()
{
remove_current_patches
import_patches
}
main "$@"