Home Home > GIT Browse > vanilla
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-06-27 12:57:36 +0200
committerKernel Build Daemon <kbuild@suse.de>2019-06-27 12:57:36 +0200
commit694468b697d23717f92da60fcf36787d8b8d80f3 (patch)
treeb10a7cbeb5507e295c566859db592f59840b7cc5
parentf9e546095bc71363b268f20c03eec261ea977fbe (diff)
parentf74c585012200ef77cbe99f8d759d0f95f1651ea (diff)
Merge branch 'scripts' into vanilla
-rw-r--r--README4
-rwxr-xr-xscripts/bugzilla-cli2
-rwxr-xr-xscripts/bugzilla-create1
-rw-r--r--scripts/bugzilla/_cli.py2
-rw-r--r--scripts/git_sort/README.md13
-rwxr-xr-xscripts/git_sort/git_sort.py13
-rw-r--r--scripts/git_sort/lib.py12
-rwxr-xr-xscripts/git_sort/merge_tool.py3
-rw-r--r--scripts/git_sort/pygit2_wrapper.py30
-rwxr-xr-xscripts/git_sort/qcp.py8
-rwxr-xr-xscripts/git_sort/qdupcheck.py3
-rw-r--r--scripts/git_sort/quilt-mode.sh4
-rwxr-xr-xscripts/git_sort/series_insert.py3
-rwxr-xr-xscripts/git_sort/series_sort.py38
-rw-r--r--scripts/git_sort/tests/sle12-sp2/Dockerfile2
-rw-r--r--scripts/git_sort/tests/support.py3
-rwxr-xr-xscripts/git_sort/tests/test_git_sort.py3
-rwxr-xr-xscripts/git_sort/tests/test_quilt_mode.py3
-rwxr-xr-xscripts/git_sort/tests/test_series_insert.py3
-rwxr-xr-xscripts/git_sort/tests/test_series_sort.py3
-rwxr-xr-xscripts/git_sort/update_clone.py3
-rwxr-xr-xscripts/log21
-rwxr-xr-xscripts/python/suse_git/header.py2
-rwxr-xr-xscripts/tar-up.sh2
24 files changed, 119 insertions, 42 deletions
diff --git a/README b/README
index d7a29d1739..1c91eca8f0 100644
--- a/README
+++ b/README
@@ -361,8 +361,8 @@ Related Information
===================
Internal:
-https://wiki.innerweb.novell.com/index.php/SUSE/Labs_Publications/Kernel_Building.html
-https://wiki.innerweb.novell.com/index.php/SUSE/Labs_Publications/kernel_patches_rules
+https://wiki.suse.net/index.php/SUSE-Labs_Publications/Kernel_Building
+https://wiki.suse.net/index.php/SUSE-Labs_Publications/kernel_patches_rules
Public:
TBD
diff --git a/scripts/bugzilla-cli b/scripts/bugzilla-cli
index c06c04b6dc..c1eca50a0d 100755
--- a/scripts/bugzilla-cli
+++ b/scripts/bugzilla-cli
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
# This is a small wrapper script to simplify running the 'bugzilla'
# cli tool from a git checkout
diff --git a/scripts/bugzilla-create b/scripts/bugzilla-create
index 6036c60cd9..5d6de3c426 100755
--- a/scripts/bugzilla-create
+++ b/scripts/bugzilla-create
@@ -24,6 +24,7 @@ handle_one_patch() {
${BUGZILLA} new -p "${PRODUCT}" -c "${COMPONENT}" -a "${EMAIL}" \
${QA_EMAIL} -t "${SUBJ}" -v "${VERSION}" \
--comment "${COMMENT}" -s "CONFIRMED" \
+ --keywords Proactive-Upstream-Fix \
--no-refresh --ids > ${tmpdir}/bugid
if [ $? -ne 0 ]; then
diff --git a/scripts/bugzilla/_cli.py b/scripts/bugzilla/_cli.py
index a0a6d8302b..d314d38e9c 100644
--- a/scripts/bugzilla/_cli.py
+++ b/scripts/bugzilla/_cli.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python3
+#!/usr/bin/python3
#
# bugzilla - a commandline frontend for the python bugzilla module
#
diff --git a/scripts/git_sort/README.md b/scripts/git_sort/README.md
index ca8c799de5..b9881372cd 100644
--- a/scripts/git_sort/README.md
+++ b/scripts/git_sort/README.md
@@ -360,3 +360,16 @@ Untracked files:
ben@f1:~/local/src/kernel-source$ git commit
```
+
+Reporting Problems
+==================
+If you encounter problems while using any git-sort command, please send a
+report to <kernel@suse.de> which includes the following information:
+* the command you're trying to run and its output
+* which kernel-source.git commit you are working on. If your tree has
+ local changes before the command you're trying to run, commit them using
+ `git commit -n` and push to a dummy user branch (ex:
+ "users/<user>/SLE15/bugreport1") so that others can examine the tree and try
+ to reproduce the issue.
+* the output of
+ kernel-source$ GIT_DIR=$LINUX_GIT scripts/git_sort/git_sort.py -d
diff --git a/scripts/git_sort/git_sort.py b/scripts/git_sort/git_sort.py
index a07d737172..85d9cec0fd 100755
--- a/scripts/git_sort/git_sort.py
+++ b/scripts/git_sort/git_sort.py
@@ -27,13 +27,14 @@ import operator
import os
import os.path
import pprint
-import pygit2
import re
import shelve
import subprocess
import sys
import types
+import pygit2_wrapper as pygit2
+
class GSException(BaseException):
pass
@@ -214,6 +215,7 @@ remotes = (
Head(RepoURL("klassert/ipsec.git")),
Head(RepoURL("klassert/ipsec-next.git")),
Head(RepoURL("mkp/scsi.git"), "4.19/scsi-queue"),
+ Head(RepoURL("mkp/scsi.git"), "5.0/scsi-fixes"),
Head(RepoURL("git://git.kernel.dk/linux-block.git"), "for-next"),
Head(RepoURL("git://git.kernel.org/pub/scm/virt/kvm/kvm.git"), "queue"),
Head(RepoURL("git://git.infradead.org/nvme.git"), "nvme-4.18"),
@@ -224,6 +226,7 @@ remotes = (
Head(RepoURL("viro/vfs.git"), "for-linus"),
Head(RepoURL("jeyu/linux.git"), "modules-next"),
Head(RepoURL("nvdimm/nvdimm.git"), "libnvdimm-for-next"),
+ Head(RepoURL("herbert/crypto-2.6.git"), "master"),
)
@@ -640,10 +643,14 @@ if __name__ == "__main__":
path = os.environ["GIT_DIR"]
except KeyError:
try:
+ # depending on the pygit2 version, discover_repository() will either
+ # raise KeyError or return None if a repository is not found.
path = pygit2.discover_repository(os.getcwd())
except KeyError:
- print("Error: Not a git repository", file=sys.stderr)
- sys.exit(1)
+ path = None
+ if path is None:
+ print("Error: Not a git repository", file=sys.stderr)
+ sys.exit(1)
repo = pygit2.Repository(path)
if args.dump_heads:
diff --git a/scripts/git_sort/lib.py b/scripts/git_sort/lib.py
index f029267b7e..9f7da0efb6 100644
--- a/scripts/git_sort/lib.py
+++ b/scripts/git_sort/lib.py
@@ -22,12 +22,13 @@ import collections
import operator
import os
import os.path
-import pygit2
import re
import signal
import subprocess
import sys
+import pygit2_wrapper as pygit2
+
import exc
import git_sort
from patch import Patch
@@ -419,6 +420,15 @@ def series_sort(index, entries):
# no entry.dest
result[entry.dest_head].append(entry.value)
+ mainline = git_sort.remotes[0]
+ if mainline not in index.repo_heads:
+ raise exc.KSError(
+ "Did not find mainline information (ref \"%s\" from the repository "
+ "at \"%s\") in the repository at LINUX_GIT (\"%s\"). For more "
+ "information, please refer to the \"Configuration Requirements\" "
+ "section of \"scripts/git_sort/README.md\"." % (
+ mainline.rev, mainline.repo_url.url, index.repo.path,))
+
for head in index.repo_heads:
result[head] = flatten([
e[1]
diff --git a/scripts/git_sort/merge_tool.py b/scripts/git_sort/merge_tool.py
index f3a148d946..fda4c3478f 100755
--- a/scripts/git_sort/merge_tool.py
+++ b/scripts/git_sort/merge_tool.py
@@ -33,11 +33,12 @@ git mergetool --tool=git-sort series.conf
"""
import os.path
-import pygit2
import shutil
import subprocess
import sys
+import pygit2_wrapper as pygit2
+
import exc
import lib
import series_conf
diff --git a/scripts/git_sort/pygit2_wrapper.py b/scripts/git_sort/pygit2_wrapper.py
new file mode 100644
index 0000000000..0fff6a16b7
--- /dev/null
+++ b/scripts/git_sort/pygit2_wrapper.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Copyright (C) 2019 SUSE LLC
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+# USA.
+
+import sys
+
+try:
+ from pygit2 import *
+except ImportError as err:
+ print("Error: %s" % (err,), file=sys.stderr)
+ print("Please install the \"pygit2\" python3 module. For more details, "
+ "please refer to the \"Installation Requirements\" section of "
+ "\"scripts/git_sort/README.md\".", file=sys.stderr)
+ sys.exit(1)
diff --git a/scripts/git_sort/qcp.py b/scripts/git_sort/qcp.py
index 1b69943372..7ac02514df 100755
--- a/scripts/git_sort/qcp.py
+++ b/scripts/git_sort/qcp.py
@@ -22,12 +22,13 @@ import argparse
import io
import os
import os.path
-import pygit2
import shutil
import subprocess
import sys
import tempfile
+import pygit2_wrapper as pygit2
+
import exc
import lib
from patch import Patch
@@ -51,7 +52,10 @@ def format_import(references, tmpdir, dstdir, rev, poi=[]):
src,))
subprocess.check_call(("quilt", "import", "-P", dst, src,))
# This will remind the user to run refresh_patch.sh
- lib.touch(".pc/%s~refresh" % (dst,))
+ target_dir = os.path.join(".pc", dstdir)
+ if not os.path.isdir(target_dir):
+ os.mkdir(target_dir)
+ lib.touch(os.path.join(".pc", "%s~refresh" % (dst,)))
return 0
diff --git a/scripts/git_sort/qdupcheck.py b/scripts/git_sort/qdupcheck.py
index d8c7920feb..a82ff49af1 100755
--- a/scripts/git_sort/qdupcheck.py
+++ b/scripts/git_sort/qdupcheck.py
@@ -21,10 +21,11 @@
import argparse
import os
import os.path
-import pygit2
import subprocess
import sys
+import pygit2_wrapper as pygit2
+
import exc
import lib
import series_conf
diff --git a/scripts/git_sort/quilt-mode.sh b/scripts/git_sort/quilt-mode.sh
index b6ab09c380..99aae1b874 100644
--- a/scripts/git_sort/quilt-mode.sh
+++ b/scripts/git_sort/quilt-mode.sh
@@ -257,7 +257,7 @@ qadd () {
(
[ ${#series[@]} -gt 0 ] && printf "%s\n" "${series[@]}"
[ -n "$_series" ] && echo "$_series"
- ) | GIT_DIR=$git_dir "$_libdir"/git-sort
+ ) | GIT_DIR=$git_dir "$_libdir"/git_sort.py
)"
if [ -z "${series[0]}" ]; then
@@ -281,7 +281,7 @@ qedit () {
${EDITOR:-${VISUAL:-vi}} "$tmpfile"
mapfile -t series <<< "$(grep . "$tmpfile" |
- GIT_DIR=$git_dir $_libdir/git-sort)"
+ GIT_DIR=$git_dir $_libdir/git_sort.py)"
if [ -z "${series[0]}" ]; then
unset series[0]
diff --git a/scripts/git_sort/series_insert.py b/scripts/git_sort/series_insert.py
index d55d7d0d79..91297d2f17 100755
--- a/scripts/git_sort/series_insert.py
+++ b/scripts/git_sort/series_insert.py
@@ -25,9 +25,10 @@ commits that the patches backport.
import argparse
import collections
-import pygit2
import sys
+import pygit2_wrapper as pygit2
+
import exc
import git_sort
import lib
diff --git a/scripts/git_sort/series_sort.py b/scripts/git_sort/series_sort.py
index ae50761a97..444a24d0e7 100755
--- a/scripts/git_sort/series_sort.py
+++ b/scripts/git_sort/series_sort.py
@@ -37,14 +37,7 @@ import argparse
import os
import sys
-try:
- import pygit2
-except ImportError as err:
- print("Error: %s" % (err,), file=sys.stderr)
- print("Please install the \"pygit2\" python3 module. For more details, "
- "please refer to the \"Installation Requirements\" section of "
- "\"scripts/git_sort/README.md\".", file=sys.stderr)
- sys.exit(1)
+import pygit2_wrapper as pygit2
import exc
import git_sort
@@ -67,22 +60,31 @@ if __name__ == "__main__":
"as appropriate. Default: false.")
parser.add_argument("series", nargs="?", metavar="series.conf",
help="series.conf file which will be modified in "
- "place. Default: read input from stdin.")
+ "place. Default: if stdin is a terminal, "
+ "\"series.conf\"; otherwise, read input from stdin.")
args = parser.parse_args()
repo_path = lib.repo_path()
repo = pygit2.Repository(repo_path)
index = git_sort.SortIndex(repo)
- if args.series is not None:
+ filter_mode = False
+ if args.series is None:
+ if sys.stdin.isatty():
+ path = "series.conf"
+ else:
+ filter_mode = True
+ else:
+ path = args.series
+ if filter_mode:
+ f = sys.stdin
+ else:
try:
- f = open(args.series)
+ f = open(path)
except FileNotFoundError as err:
print("Error: %s" % (err,), file=sys.stderr)
sys.exit(1)
- series = os.path.abspath(args.series)
- else:
- f = sys.stdin
+ series_path = os.path.abspath(path)
lines = f.readlines()
if args.prefix is not None:
@@ -91,7 +93,7 @@ if __name__ == "__main__":
try:
before, inside, after = series_conf.split(lines)
except exc.KSNotFound as err:
- if args.series is None:
+ if filter_mode:
before = []
inside = lines
after = []
@@ -137,10 +139,10 @@ if __name__ == "__main__":
after,
])
- if args.series is not None:
- f = open(series, mode="w")
- else:
+ if filter_mode:
f = sys.stdout
+ else:
+ f = open(series_path, mode="w")
f.writelines(output)
try:
lib.update_tags(index, to_update)
diff --git a/scripts/git_sort/tests/sle12-sp2/Dockerfile b/scripts/git_sort/tests/sle12-sp2/Dockerfile
index 9de8830e78..f5bfc48455 100644
--- a/scripts/git_sort/tests/sle12-sp2/Dockerfile
+++ b/scripts/git_sort/tests/sle12-sp2/Dockerfile
@@ -1,6 +1,6 @@
FROM benjamin_poirier/docker_images/sle-12-sp2:latest AS base
-RUN zypper -n ref
+RUN zypper -n --no-gpg-checks ref
FROM base AS packages
diff --git a/scripts/git_sort/tests/support.py b/scripts/git_sort/tests/support.py
index dfff2b855f..31e4c5e45a 100644
--- a/scripts/git_sort/tests/support.py
+++ b/scripts/git_sort/tests/support.py
@@ -3,7 +3,8 @@
import datetime
import os.path
-import pygit2
+
+import pygit2_wrapper as pygit2
# from http://www.pygit2.org/recipes/git-show.html
diff --git a/scripts/git_sort/tests/test_git_sort.py b/scripts/git_sort/tests/test_git_sort.py
index 187b38cfbd..5d6b82395c 100755
--- a/scripts/git_sort/tests/test_git_sort.py
+++ b/scripts/git_sort/tests/test_git_sort.py
@@ -4,7 +4,6 @@
import collections
import os
import os.path
-import pygit2
import shelve
import shutil
import subprocess
@@ -12,6 +11,8 @@ import sys
import tempfile
import unittest
+import pygit2_wrapper as pygit2
+
import git_sort
import lib
diff --git a/scripts/git_sort/tests/test_quilt_mode.py b/scripts/git_sort/tests/test_quilt_mode.py
index 95f35a74b4..1b32e4aa95 100755
--- a/scripts/git_sort/tests/test_quilt_mode.py
+++ b/scripts/git_sort/tests/test_quilt_mode.py
@@ -3,13 +3,14 @@
import os
import os.path
-import pygit2
import shutil
import subprocess
import sys
import tempfile
import unittest
+import pygit2_wrapper as pygit2
+
import git_sort
import lib
import series_conf
diff --git a/scripts/git_sort/tests/test_series_insert.py b/scripts/git_sort/tests/test_series_insert.py
index c93489a0c9..9be2e1ee6a 100755
--- a/scripts/git_sort/tests/test_series_insert.py
+++ b/scripts/git_sort/tests/test_series_insert.py
@@ -2,13 +2,14 @@
# -*- coding: utf-8 -*-
import os
-import pygit2
import shutil
import subprocess
import tempfile
import unittest
import sys
+import pygit2_wrapper as pygit2
+
import git_sort
import lib
import tests.support
diff --git a/scripts/git_sort/tests/test_series_sort.py b/scripts/git_sort/tests/test_series_sort.py
index 66317c2025..67e2e4ae56 100755
--- a/scripts/git_sort/tests/test_series_sort.py
+++ b/scripts/git_sort/tests/test_series_sort.py
@@ -3,13 +3,14 @@
import os
import os.path
-import pygit2
import shutil
import subprocess
import sys
import tempfile
import unittest
+import pygit2_wrapper as pygit2
+
import git_sort
import lib
import tests.support
diff --git a/scripts/git_sort/update_clone.py b/scripts/git_sort/update_clone.py
index 0223235dfa..098fff56ee 100755
--- a/scripts/git_sort/update_clone.py
+++ b/scripts/git_sort/update_clone.py
@@ -20,10 +20,11 @@
import argparse
import collections
-import pygit2
import re
import shlex
+import pygit2_wrapper as pygit2
+
import git_sort
import lib
diff --git a/scripts/log2 b/scripts/log2
index 8e159d72ea..25ad680b4e 100755
--- a/scripts/log2
+++ b/scripts/log2
@@ -402,6 +402,7 @@ deleted=($(git diff --name-only --diff-filter=D HEAD))
scripts/check-patch-dirs "${added[@]}" "${modified[@]}" || exit 1
if only_patches; then
+ git add -u
"$_libdir"/git-pre-commit || exit
commit_single_patches || exit
else
diff --git a/scripts/python/suse_git/header.py b/scripts/python/suse_git/header.py
index e820bb56fd..262dfc8743 100755
--- a/scripts/python/suse_git/header.py
+++ b/scripts/python/suse_git/header.py
@@ -167,7 +167,7 @@ tag_map = {
'accepted' : [
{
'name' : 'SUSE',
- 'match' : '(bsc|boo|bnc|fate)#\d+',
+ 'match' : '((bsc|boo|bnc|fate)#\d+|jsc#\w+-\d+)',
},
{
'match' : '\S+',
diff --git a/scripts/tar-up.sh b/scripts/tar-up.sh
index c50e4da377..9e5ece204b 100755
--- a/scripts/tar-up.sh
+++ b/scripts/tar-up.sh
@@ -195,7 +195,7 @@ CLEANFILES=()
trap 'if test -n "$CLEANFILES"; then rm -rf "${CLEANFILES[@]}"; fi' EXIT
tmpdir=$(mktemp -dt ${0##*/}.XXXXXX)
CLEANFILES=("${CLEANFILES[@]}" "$tmpdir")
-rpmfiles=$(echo rpm/* | grep -v "~$")
+rpmfiles=$(ls rpm/* | grep -v "~$")
cp -p $rpmfiles config.conf supported.conf doc/* $build_dir
match="${flavor:+\\/$flavor$}"