diff --git a/README b/README index db1a48a..96589fc 100644 --- a/README +++ b/README @@ -194,9 +194,11 @@ depending on the impact of your changes. Use scripts/tar-up.sh for creating an OBS package directory. The kernel source tree that scripts/sequence-patch.sh creates can be -test compiled as follows: +test-compiled. Before that, make sure all prerequisites are installed. +These include libopenssl-devel, libelf-devel, and dwarves (look into +rpm/kernel-binary.spec.in for a complete list). Then, the compilation +can be done as follows: - $ cp config/i386/default /var/tmp/scratch/linux-5.3-SLE15-SP3 $ cd /var/tmp/scratch/linux-5.3-SLE15-SP3 $ make oldconfig $ make diff --git a/rpm/group-source-files.pl b/rpm/group-source-files.pl index 768ecff..89fa8e8 100755 --- a/rpm/group-source-files.pl +++ b/rpm/group-source-files.pl @@ -66,7 +66,7 @@ sub calc_dirs do { $path =~ s{/[^/]+$}{}; $dirs{$path} = 1; - } while ($path ne $base); + } while ($path ne $base and $path ne ""); # This loop also makes sure that $base itself is included. } diff --git a/rpm/kernel-module-subpackage b/rpm/kernel-module-subpackage index 6645965..3a3d18c 100644 --- a/rpm/kernel-module-subpackage +++ b/rpm/kernel-module-subpackage @@ -82,23 +82,28 @@ END { exit(! good) } ' $spec ) %pre -n %{-n*}-kmp-%1 -%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-pre --name "%{-n*}-kmp-%1" \ +%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD} +/usr/lib/module-init-tools/kernel-scriptlets/kmp-pre --name "%{-n*}-kmp-%1" \ --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %post -n %{-n*}-kmp-%1 -%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-post --name "%{-n*}-kmp-%1" \ +%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD} +/usr/lib/module-init-tools/kernel-scriptlets/kmp-post --name "%{-n*}-kmp-%1" \ --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %preun -n %{-n*}-kmp-%1 -%{-b:KMP_NEEDS_MKINITRD=1} %run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-preun --name "%{-n*}-kmp-%1" \ +%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD} +%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-preun --name "%{-n*}-kmp-%1" \ --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %postun -n %{-n*}-kmp-%1 -%{-b:KMP_NEEDS_MKINITRD=1} %run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-postun --name "%{-n*}-kmp-%1" \ +%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD} +%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-postun --name "%{-n*}-kmp-%1" \ --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %posttrans -n %{-n*}-kmp-%1 -%{-b:KMP_NEEDS_MKINITRD=1} /usr/lib/module-init-tools/kernel-scriptlets/kmp-posttrans --name "%{-n*}-kmp-%1" \ +%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD} +/usr/lib/module-init-tools/kernel-scriptlets/kmp-posttrans --name "%{-n*}-kmp-%1" \ --version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \ --flavor "%1" --usrmerged "0%{?usrmerged}" "$@" %files -n %{-n*}-kmp-%1 diff --git a/scripts/git_sort/tests/opensuse-15.3/Dockerfile b/scripts/git_sort/tests/opensuse-15.3/Dockerfile deleted file mode 100644 index 6c45bc6..0000000 --- a/scripts/git_sort/tests/opensuse-15.3/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# https://hub.docker.com/r/opensuse/leap/ -FROM opensuse/leap:15.3 AS base - -RUN zypper -n ref - -FROM base AS packages - -RUN zypper -n in git python3 python3-dbm rcs - -RUN git config --global user.email "you@example.com" -RUN git config --global user.name "Your Name" - -RUN zypper -n ar -G https://download.opensuse.org/repositories/Kernel:/tools/openSUSE_Leap_15.3/Kernel:tools.repo -RUN zypper -n in python3-pygit2 quilt - -FROM packages - -VOLUME /scripts - -WORKDIR /scripts/git_sort - -CMD python3 -m unittest discover -v diff --git a/scripts/git_sort/tests/opensuse-15.4/Dockerfile b/scripts/git_sort/tests/opensuse-15.4/Dockerfile new file mode 100644 index 0000000..1d5cbc7 --- /dev/null +++ b/scripts/git_sort/tests/opensuse-15.4/Dockerfile @@ -0,0 +1,24 @@ +# https://hub.docker.com/r/opensuse/leap/ +FROM opensuse/leap:15.4 AS base + +RUN zypper -n ref + +FROM base AS packages + +RUN zypper -n in git python3 python3-dbm rcs + +RUN git config --global user.email "you@example.com" +RUN git config --global user.name "Your Name" + +COPY Kernel.gpg /tmp +RUN rpmkeys --import /tmp/Kernel.gpg +RUN zypper -n ar https://download.opensuse.org/repositories/Kernel:/tools/SLE_15_SP4/Kernel:tools.repo +RUN zypper -n in python3-pygit2 quilt + +FROM packages + +VOLUME /scripts + +WORKDIR /scripts/git_sort + +CMD python3 -m unittest discover -v diff --git a/scripts/git_sort/tests/opensuse-tumbleweed/Dockerfile b/scripts/git_sort/tests/opensuse-tumbleweed/Dockerfile index 205d2c8..af6cfbc 100644 --- a/scripts/git_sort/tests/opensuse-tumbleweed/Dockerfile +++ b/scripts/git_sort/tests/opensuse-tumbleweed/Dockerfile @@ -10,7 +10,9 @@ RUN zypper -n in git python3 python3-dbm python3-pygit2 rcs util-linux RUN git config --global user.email "you@example.com" RUN git config --global user.name "Your Name" -RUN zypper -n ar -G https://download.opensuse.org/repositories/Kernel:/tools/openSUSE_Factory/Kernel:tools.repo +COPY Kernel.gpg /tmp +RUN rpmkeys --import /tmp/Kernel.gpg +RUN zypper -n ar https://download.opensuse.org/repositories/Kernel:/tools/openSUSE_Factory/Kernel:tools.repo RUN zypper -n in --from Kernel_tools quilt FROM packages diff --git a/scripts/git_sort/tests/run_all.sh b/scripts/git_sort/tests/run_all.sh index 0177c1a..f63ab5b 100755 --- a/scripts/git_sort/tests/run_all.sh +++ b/scripts/git_sort/tests/run_all.sh @@ -6,13 +6,19 @@ for release in \ sle12-sp4 \ sle12-sp5 \ sle15 \ - opensuse-15.3 \ + opensuse-15.4 \ opensuse-tumbleweed \ ; do echo "Building container image for $release..." + cp -a $libdir/../../lib/SUSE/Kernel.gpg $libdir/$release docker build -q -t gs-test-$release "$libdir/$release" + ret=$? + rm -f $libdir/$release/Kernel.gpg + [ $ret -eq 0 ] || exit $? echo "Running tests in $release:" docker run --rm --name=gs-test-$release \ --mount type=bind,source="$libdir/../../",target=/scripts,readonly \ gs-test-$release + ret=$? + [ $ret -eq 0 ] || exit $? done diff --git a/scripts/git_sort/tests/sle12-sp4/Dockerfile b/scripts/git_sort/tests/sle12-sp4/Dockerfile index e0c545b..49d8f9c 100644 --- a/scripts/git_sort/tests/sle12-sp4/Dockerfile +++ b/scripts/git_sort/tests/sle12-sp4/Dockerfile @@ -2,13 +2,13 @@ FROM registry.suse.de/suse/containers/sle-server/12-sp4/containers/suse/sles12sp4:latest AS base RUN rpm -e container-suseconnect -RUN zypper -n ar -G http://download.suse.de/ibs/SUSE:/SLE-12:/GA/standard/SUSE:SLE-12:GA.repo -RUN zypper -n ar -G http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard/SUSE:SLE-12:Update.repo -RUN zypper -n ar -G http://download.suse.de/install/SLP/SLE-12-SP4-Server-GM/$(rpm -E %_arch)/DVD1/ DVD1 -RUN zypper -n ar -G http://download.suse.de/install/SLP/SLE-12-SP4-Server-GM/$(rpm -E %_arch)/DVD2/ DVD2 -RUN zypper -n ar -G http://download.suse.de/install/SLP/SLE-12-SP4-Server-GM/$(rpm -E %_arch)/DVD3/ DVD3 +RUN zypper -n ar http://download.suse.de/ibs/SUSE:/SLE-12:/GA/standard/SUSE:SLE-12:GA.repo +RUN zypper -n ar http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard/SUSE:SLE-12:Update.repo +RUN zypper -n ar http://download.suse.de/install/SLP/SLE-12-SP4-Server-GM/$(rpm -E %_arch)/DVD1/ DVD1 +RUN zypper -n ar http://download.suse.de/install/SLP/SLE-12-SP4-Server-GM/$(rpm -E %_arch)/DVD2/ DVD2 +RUN zypper -n ar http://download.suse.de/install/SLP/SLE-12-SP4-Server-GM/$(rpm -E %_arch)/DVD3/ DVD3 # RUN zypper -n ar -G http://updates.suse.de/SUSE/Products/SLE-SDK/12-SP4/$(rpm -E %_arch)/product/ SDK -RUN zypper -n ar -G http://download.suse.de/update/build.suse.de/SUSE/Updates/SLE-SERVER/12-SP4/$(rpm -E %_arch)/update/SUSE:Updates:SLE-SERVER:12-SP4:$(rpm -E %_arch).repo +RUN zypper -n ar http://download.suse.de/update/build.suse.de/SUSE/Updates/SLE-SERVER/12-SP4/$(rpm -E %_arch)/update/SUSE:Updates:SLE-SERVER:12-SP4:$(rpm -E %_arch).repo RUN zypper -n ref @@ -19,7 +19,9 @@ RUN zypper -n in git-core python3 python3-dbm rcs RUN git config --global user.email "you@example.com" RUN git config --global user.name "Your Name" -RUN zypper -n ar -G https://download.opensuse.org/repositories/Kernel:/tools/SLE_12_SP4/Kernel:tools.repo +COPY Kernel.gpg /tmp +RUN rpmkeys --import /tmp/Kernel.gpg +RUN zypper -n ar https://download.opensuse.org/repositories/Kernel:/tools/SLE_12_SP4/Kernel:tools.repo RUN zypper -n in python3-pygit2 quilt FROM packages diff --git a/scripts/git_sort/tests/sle12-sp5/Dockerfile b/scripts/git_sort/tests/sle12-sp5/Dockerfile index c8b601d..f5e2f58 100644 --- a/scripts/git_sort/tests/sle12-sp5/Dockerfile +++ b/scripts/git_sort/tests/sle12-sp5/Dockerfile @@ -2,13 +2,13 @@ FROM registry.suse.de/suse/containers/sle-server/12-sp5/containers/suse/sles12sp5:latest AS base RUN rpm -e container-suseconnect -RUN zypper -n ar -G http://download.suse.de/ibs/SUSE:/SLE-12:/GA/standard/SUSE:SLE-12:GA.repo -RUN zypper -n ar -G http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard/SUSE:SLE-12:Update.repo -RUN zypper -n ar -G http://download.suse.de/install/SLP/SLE-12-SP5-Server-GM/$(rpm -E %_arch)/DVD1/ DVD1 -RUN zypper -n ar -G http://download.suse.de/install/SLP/SLE-12-SP5-Server-GM/$(rpm -E %_arch)/DVD2/ DVD2 -RUN zypper -n ar -G http://download.suse.de/install/SLP/SLE-12-SP5-Server-GM/$(rpm -E %_arch)/DVD3/ DVD3 +RUN zypper -n ar http://download.suse.de/ibs/SUSE:/SLE-12:/GA/standard/SUSE:SLE-12:GA.repo +RUN zypper -n ar http://download.suse.de/ibs/SUSE:/SLE-12:/Update/standard/SUSE:SLE-12:Update.repo +RUN zypper -n ar http://download.suse.de/install/SLP/SLE-12-SP5-Server-GM/$(rpm -E %_arch)/DVD1/ DVD1 +RUN zypper -n ar http://download.suse.de/install/SLP/SLE-12-SP5-Server-GM/$(rpm -E %_arch)/DVD2/ DVD2 +RUN zypper -n ar http://download.suse.de/install/SLP/SLE-12-SP5-Server-GM/$(rpm -E %_arch)/DVD3/ DVD3 # RUN zypper -n ar -G http://updates.suse.de/SUSE/Products/SLE-SDK/12-SP5/$(rpm -E %_arch)/product/ SDK -RUN zypper -n ar -G http://download.suse.de/update/build.suse.de/SUSE/Updates/SLE-SERVER/12-SP5/$(rpm -E %_arch)/update/SUSE:Updates:SLE-SERVER:12-SP5:$(rpm -E %_arch).repo +RUN zypper -n ar http://download.suse.de/update/build.suse.de/SUSE/Updates/SLE-SERVER/12-SP5/$(rpm -E %_arch)/update/SUSE:Updates:SLE-SERVER:12-SP5:$(rpm -E %_arch).repo RUN zypper -n ref @@ -19,7 +19,9 @@ RUN zypper -n in git-core python3 python3-dbm rcs RUN git config --global user.email "you@example.com" RUN git config --global user.name "Your Name" -RUN zypper -n ar -G https://download.opensuse.org/repositories/Kernel:/tools/SLE_12_SP5/Kernel:tools.repo +COPY Kernel.gpg /tmp +RUN rpmkeys --import /tmp/Kernel.gpg +RUN zypper -n ar https://download.opensuse.org/repositories/Kernel:/tools/SLE_12_SP5/Kernel:tools.repo RUN zypper -n in python3-pygit2 quilt FROM packages diff --git a/scripts/git_sort/tests/sle15/Dockerfile b/scripts/git_sort/tests/sle15/Dockerfile index 3fd5bf4..002074f 100644 --- a/scripts/git_sort/tests/sle15/Dockerfile +++ b/scripts/git_sort/tests/sle15/Dockerfile @@ -1,9 +1,9 @@ # http://registry.suse.de/ -FROM registry.suse.de/suse/containers/sle-server/15/containers/bci/python:3.9 AS base +FROM registry.suse.de/suse/containers/sle-server/15/containers/bci/python:3.6 AS base RUN rpm -e container-suseconnect -RUN zypper -n ar -G http://download.suse.de/ibs/SUSE:/SLE-15:/GA/standard/SUSE:SLE-15:GA.repo -RUN zypper -n ar -G http://download.suse.de/ibs/SUSE:/SLE-15:/Update/standard/SUSE:SLE-15:Update.repo +RUN zypper -n ar http://download.suse.de/ibs/SUSE:/SLE-15:/GA/standard/SUSE:SLE-15:GA.repo +RUN zypper -n ar http://download.suse.de/ibs/SUSE:/SLE-15:/Update/standard/SUSE:SLE-15:Update.repo RUN zypper -n ref FROM base AS packages @@ -13,7 +13,9 @@ RUN zypper -n in git-core python3 python3-dbm rcs awk RUN git config --global user.email "you@example.com" RUN git config --global user.name "Your Name" -RUN zypper -n ar -G https://download.opensuse.org/repositories/Kernel:/tools/SLE_15/Kernel:tools.repo +COPY Kernel.gpg /tmp +RUN rpmkeys --import /tmp/Kernel.gpg +RUN zypper -n ar https://download.opensuse.org/repositories/Kernel:/tools/SLE_15/Kernel:tools.repo RUN zypper -n in python3-pygit2 quilt FROM packages diff --git a/scripts/git_sort/tests/test_series_sort.py b/scripts/git_sort/tests/test_series_sort.py index f0ffe5b..25f80a9 100755 --- a/scripts/git_sort/tests/test_series_sort.py +++ b/scripts/git_sort/tests/test_series_sort.py @@ -293,8 +293,8 @@ class TestFromPatch(unittest.TestCase): self.repo.remotes.create("rdma", self.rdma_repo) self.dledford_repo = k_org_canon_prefix + "dledford/rdma.git" self.repo.remotes.create("dledford/rdma", self.dledford_repo) - self.nf_repo = k_org_canon_prefix + "pablo/nf.git" - self.repo.remotes.create("pablo/nf", self.nf_repo) + self.nf_repo = k_org_canon_prefix + "netfilter/nf.git" + self.repo.remotes.create("netfilter/nf", self.nf_repo) self.commits = {} self.commits["mainline 0"] = self.repo.create_commit( @@ -377,7 +377,7 @@ class TestFromPatch(unittest.TestCase): tree.write(), [self.commits["mainline 0"]] ) - self.repo.references.create("refs/remotes/pablo/nf/master", + self.repo.references.create("refs/remotes/netfilter/nf/master", self.commits["nf 0"]) self.commits["mainline 2"] = self.repo.create_commit( @@ -822,13 +822,13 @@ class TestFromPatch(unittest.TestCase): with open("series.conf", mode="w") as f: f.write(tests.support.format_series(( - ("pablo/nf-next", ( + ("netfilter/nf-next", ( name, )), ))) series2 = tests.support.format_series(( - ("pablo/nf", ( + ("netfilter/nf", ( name, )), )) @@ -838,9 +838,9 @@ class TestFromPatch(unittest.TestCase): def test_found_notindexed_upstream_bad2_moveupstream(self): """ - patch sorted in pablo nf-next (not fetched), commit found in pablo nf, + patch sorted in netfilter nf-next (not fetched), commit found in netfilter nf, git-repo tag is bad - moves to pablo nf + moves to netfilter nf tag is NOT updated This is a special case. See the log of commit 0ac6457e94e8 @@ -854,7 +854,7 @@ class TestFromPatch(unittest.TestCase): def test_found_notindexed_upstream_bad2_nomoveupstream(self): """ - patch sorted in pablo nf-next (not fetched), commit found in pablo nf, + patch sorted in netfilter nf-next (not fetched), commit found in netfilter nf, git-repo tag is bad error, possible causes: section is wrong or Git-repo is wrong diff --git a/scripts/lib/SUSE/Kernel.gpg b/scripts/lib/SUSE/Kernel.gpg new file mode 100644 index 0000000..4d7dbc7 --- /dev/null +++ b/scripts/lib/SUSE/Kernel.gpg @@ -0,0 +1,20 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +mQENBFEaM/IBCADo3+2CX4/tZoGIooy7QF8+J94rwr7Tov3kXFADlXr+aG7zHMrz +r398QiSCmLsE7kJ8DcapHH+TaYrpy5yuS06RV4euhlJjo2+SHEcSzTGDIjrPTDvM +8KZE3CWZgyRTVZnTq7bRPtVhSIzkTPNyJe1AMMDZH8YYgDgo0zleZWR3w3VA75dC +fGUYjFTjymAM2QtzK3WAgywqZK0F21MKOCUWrz8ZFbCmdcZh/mAYDhmNlFcN6mZS +E/yD5E6pqGEF1Pr4dfwP0NbPBpsYq8wP3T5TIdaD5wr38u2QJNORxCKi8fuCqpf7 +HQx5v3x2EVz4VhRzzc31TPVz1LX5MPby8ypBABEBAAG0Lktlcm5lbCBPQlMgUHJv +amVjdCA8S2VybmVsQGJ1aWxkLm9wZW5zdXNlLm9yZz6JATwEEwECACYFAmFcgfcC +GwMFCRRg/gUGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRDs7vIQA1ecHYjiB/9j +HSpLuZUnN2YIg6BFTXs4thRLcH0oaYqqvn9j9B4JR9ORHkCharrsBGLRw8zk+Rxt +fCKkty0hkF8yEnnrQV1SaTIBotadf+OnK3Rll4XTO/i7ww7vNcBklYDl801j8z21 +rDoDt9WPRMO748XFHbc1lcQxw7kyfT5XrmpMA1aKcP8jGk2Zs0+1dR4ZlHMs5yq3 +txVIq5dZE+cB+5F4ab3QhFdtGJlW5oM4kzojLSvPJq2NMH4NZPM0fbotbrKSiVDO +QjYURv7Crh/3uPs2OHgh3QRaEva4rU7z2Q/z6Lo5iinQJ9WcRfL8cMOHxSMArUCw +IwudjqU4hN/AyJ+OIYK0iEYEExECAAYFAlEaM/IACgkQOzARt2udZSOyewCguDRQ +jsRPwMa3DqdijMtrGaWTtdcAn20WA8ufB0LM8evtkMiv4PmlYfEz +=ehs+ +-----END PGP PUBLIC KEY BLOCK----- diff --git a/scripts/lib/SUSE/SUSE_Trust_Root.pem b/scripts/lib/SUSE/SUSE_Trust_Root.pem index 27cb843..85975b5 100644 --- a/scripts/lib/SUSE/SUSE_Trust_Root.pem +++ b/scripts/lib/SUSE/SUSE_Trust_Root.pem @@ -1,4 +1,4 @@ ------BEGIN TRUSTED CERTIFICATE----- +-----BEGIN CERTIFICATE----- MIIG6DCCBNCgAwIBAgIBATANBgkqhkiG9w0BAQsFADCBqDELMAkGA1UEBhMCREUx EjAQBgNVBAgTCUZyYW5jb25pYTESMBAGA1UEBxMJTnVyZW1iZXJnMSEwHwYDVQQK ExhTVVNFIExpbnV4IFByb2R1Y3RzIEdtYkgxFTATBgNVBAsTDE9QUyBTZXJ2aWNl @@ -35,6 +35,5 @@ OL+vEVNBlzGiU2mPuk/E75V43dhnaI3ktqph5oNq6gEZWArLkze2nksWdexjH7G5 42cij0RBO/+5RjmVzG9IXzmScE2V57McJpVDf0lPV57+xCkn6msqyRiJoDS3DPfV ySq1QlcPxhQUNSbDIL663gwirdJyf98C4W/zVcwjnUc+zGgxVInqhJVpuWvte9h/ bIf8cLGxGtSyQ616qwdS92vg1atJoG51Jdxw0EhzFtxJ8QVrfkGn1IT2ngUYYaOK -W8NcaXbJ/yeblISOdtHRxuCpZs8P9MxDAQn/X873eYfcim1xfqSimgJ2dpAwEQwP -U1VTRSBUcnVzdCBSb290 ------END TRUSTED CERTIFICATE----- +W8NcaXbJ/yeblISOdtHRxuCpZs8P9MxDAQn/X873eYfcim1xfqSimgJ2dpA= +-----END CERTIFICATE----- diff --git a/scripts/osc_wrapper b/scripts/osc_wrapper index 83f98c1..1869e6c 100755 --- a/scripts/osc_wrapper +++ b/scripts/osc_wrapper @@ -251,11 +251,7 @@ do_build() shift ;; *.spec) - if test $# -eq 1; then - spec=$1 - else - osc_args=("${osc_args[@]}" "$1") - fi + spec=$1 shift ;; *) diff --git a/scripts/renamepatches b/scripts/renamepatches index f86d7da..81a4e44 100755 --- a/scripts/renamepatches +++ b/scripts/renamepatches @@ -29,14 +29,20 @@ fi branch=$1 trap 'rm -f "$temp"' EXIT temp=$(mktemp) -git grep -iE '^(Git-commit:|No-fix:|\(cherry picked from commit)' $branch | grep -vF patches.kernel.org > $temp +git grep -iE '^(Git-commit:|No-fix:|\(cherry picked from commit)' $branch -- 'patches.*' | tr ':' ' ' | \ + awk '!/patches.kernel.org/ {fn=$2; hash=$NF; map[hash]=map[hash] fn;} + END { for (hash in map) printf("map[%s]=\"%s\"\n", hash, map[hash]); }' \ + >$temp -grep -E "^[[:space:]]*patches\.[a-z]+\/" < series.conf | while read patch ; do - commit="$([ -f $patch ] && { grep -iE "^(Git-commit|No-fix):" < $patch | awk '{ print $2}' ; - grep -i "^(cherry picked from commit" < $patch | awk '{ print $5}' ; } )" - [ -n "$commit" ] && echo "$commit" | while read c ; do - grep -F $c < $temp | tr ':' ' ' | while read junk fn blah ; do - [ -n "$fn" ] && [ $fn != $patch ] && git mv $patch $fn && sed -i -e "s,$patch,$fn," series.conf - done - done +declare -A map +source $temp + +grep -E "^[[:space:]]*patches\.[a-z]+/" < series.conf | while read patch ; do + [ ! -f "$patch" ] && continue + commit="$(awk -v IGNORECASE=1 '/^(Git-commit|No-fix):/ { print $2} + /^\(cherry picked from commit/ { print $5}' $patch)" + [ -z "$commit" ] && continue + for fn in ${map[$commit]} ; do + [ $fn != $patch ] && git mv $patch $fn && sed -i -e "s,$patch,$fn," series.conf + done done diff --git a/scripts/sequence-patch.sh b/scripts/sequence-patch.sh index 15f9409..bdfac19 100755 --- a/scripts/sequence-patch.sh +++ b/scripts/sequence-patch.sh @@ -503,7 +503,7 @@ if ! [ -d $ORIG_DIR ]; then fi if $VANILLA; then - PATCHES=( $(scripts/guards $SYMBOLS < series.conf | egrep '^patches\.(kernel\.org|rpmify)/') ) + PATCHES=( $(scripts/guards $SYMBOLS < series.conf | grep -E '^patches\.(kernel\.org|rpmify)/') ) else PATCHES=( $(scripts/guards $SYMBOLS < series.conf) ) fi