gdb/import-fedora.sh
Tom de Vries 4a53ebe1ed - Patch added (swo#31524, bsc#1222188):
* make-pascal_language-print_type-handle-varstring-nul.patch
- Renable gcc-fortran for SLE-11.
- Use system compiler (gcc 4.3.4) for testing all languages on
  SLE-11.
- Maintenance script qa.sh:
  * Ignore all fails for SLE-11.
- Maintenance script import-fedora.sh:
  * Use %patch -P N instead of deprecated %patchN.
  * Drop patch skips:
    * gdb-6.5-readline-long-line-crash-test.patch
    * gdb-6.7-charsign-test.patch
    * gdb-test-ivy-bridge.patch
    * gdb-ppc-power7-test.patch
    * gdb-6.3-bz140532-ppc-unwinding-test.patch
- Patches added (import from fedora rawhide @ a27201b):
  * gdb-bz2196395-debuginfod-legacy-openssl-crash.patch
  * gdb-rhbz-2232086-cpp-ify-mapped-symtab.patch
  * gdb-rhbz-2232086-generate-dwarf-5-index-consistently.patch
  * gdb-rhbz-2232086-generate-gdb-index-consistently.patch
  * gdb-rhbz-2232086-reduce-size-of-gdb-index.patch
  * gdb-rhbz2232086-refactor-selftest-support.patch
- Patches updated (import from fedora rawhide @ a27201b):
  * gdb-6.6-buildid-locate-rpm.patch
  * gdb-6.6-buildid-locate.patch
  * gdb-fedora-libncursesw.patch
  * gdb-rhbz2233961-CVE-2022-4806.patch
  * gdb-rhbz2233965-memory-leak.patch
- Patches updated:  
  * gdb-6.6-buildid-locate-rpm-suse.patch
- Patches deleted (import from fedora rawhide @ a27201b):
  * gdb-rhbz1553104-s390x-arch12-test.patch
  * gdb-lineno-makeup-test.patch
  * gdb-6.3-bz202689-exec-from-pthread-test.patch
  * gdb-6.5-bz109921-DW_AT_decl_file-test.patch
  * gdb-6.5-ia64-libunwind-leak-test.patch
  * gdb-6.5-last-address-space-byte-test.patch
  * gdb-6.5-missed-trap-on-step-test.patch
  * gdb-6.5-sharedlibrary-path.patch
  * gdb-6.7-testsuite-stable-results.patch
  * gdb-6.8-bz442765-threaded-exec-test.patch
  * gdb-ccache-workaround.patch
  * gdb-opcodes-clflushopt-test.patch
  * gdb-rhbz1186476-internal-error-unqualified-name-re-set-test.patch
  * gdb-rhbz1350436-type-printers-error.patch
  * gdb-rhbz2196395-debuginfod-legacy-openssl-crash.patch
  * gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
  * gdb-test-pid0-core.patch
- Patches deleted:
  * fixup-gdb-rhbz1553104-s390x-arch12-test.patch
  * fixup-2-gdb-rhbz1553104-s390x-arch12-test.patch
  * fixup-gdb-lineno-makeup-test.patch
  * fixup-gdb-6.6-buildid-locate-rpm.patch
- Remove commented out mention of dropped patch
  gdb-fix-selftest-fails-with-gdb-build-with-O2-flto.patch.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=383
2024-04-24 09:31:51 +00:00

147 lines
2.7 KiB
Bash

#!/bin/bash
# Fedora Packages not copied:
#
skip_patches=(
# Not applicable for openSUSE.
gdb-add-index.patch
gdb-6.3-rh-testversion-20041202.patch
gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
gdb-6.8-bz466901-backtrace-full-prelinked.patch
gdb-container-rh-pkg.patch
# Broken.
# Over-specific test-case in a shell script.
gdb-6.5-BEA-testsuite.patch
# Fragile test-case, requires glibc to fail in a certain way.
gdb-rhbz1156192-recursive-dlopen-test.patch
# Obsolete.
gdb-6.7-ppc-clobbered-registers-O2-test.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 "$@"