Home Home > GIT Browse > linux-next
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-06-27 13:00:43 +0200
committerKernel Build Daemon <kbuild@suse.de>2019-06-27 13:00:43 +0200
commit3b59c231e1b87ed43e046ae9a00591f0b8388aae (patch)
treecec7036a5dc178e460effe8ee2287dd18405d335
parent3d280970ae8bf264e993955410bb4f1ffdce8e93 (diff)
parentf74c585012200ef77cbe99f8d759d0f95f1651ea (diff)
Merge branch 'scripts' into linux-next
-rw-r--r--README4
l---------scripts/arch-symbols1
-rwxr-xr-xscripts/bugzilla-cli2
-rwxr-xr-xscripts/bugzilla-create1
-rw-r--r--scripts/bugzilla/_cli.py2
-rwxr-xr-xscripts/git-create-branch13
-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
l---------scripts/guards1
-rwxr-xr-xscripts/log21
-rwxr-xr-xscripts/mkpatch.py417
-rwxr-xr-xscripts/old-packages.sh15
-rwxr-xr-xscripts/patch-report239
-rwxr-xr-xscripts/python/suse_git/header.py2
-rwxr-xr-xscripts/refresh97
-rwxr-xr-xscripts/tar-up.sh2
31 files changed, 119 insertions, 825 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/arch-symbols b/scripts/arch-symbols
deleted file mode 120000
index 3eea03f25f..0000000000
--- a/scripts/arch-symbols
+++ /dev/null
@@ -1 +0,0 @@
-../rpm/arch-symbols \ No newline at end of file
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-create-branch b/scripts/git-create-branch
deleted file mode 100755
index 67f880fc65..0000000000
--- a/scripts/git-create-branch
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-# git-create-branch <branch_name>
-
-if [ $# -ne 1 ]; then
- echo 1>&2 Usage: $0 branch_name
- exit 127
-fi
-
-branch_name="$1"
-git push origin origin:refs/heads/${branch_name}
-git fetch origin
-git checkout --track -b ${branch_name} origin/${branch_name}
-git pull
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/guards b/scripts/guards
deleted file mode 120000
index 709cc82776..0000000000
--- a/scripts/guards
+++ /dev/null
@@ -1 +0,0 @@
-../rpm/guards \ No newline at end of file
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/mkpatch.py b/scripts/mkpatch.py
deleted file mode 100755
index ea2a2a080e..0000000000
--- a/scripts/mkpatch.py
+++ /dev/null
@@ -1,417 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (C) 2004 Andrea Arcangeli <andrea@suse.de> SUSE
-# $Id: mkpatch.py,v 1.20 2005/06/07 17:22:58 andrea Exp $
-
-# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-# You can copy or symlink this script into ~/bin and
-# your ~/.signedoffby file should contain a string like this:
-# "Signed-off-by: Andrea Arcangeli <andrea@suse.de>"
-
-# Usage is intuitive like this:
-# ./mkpatch.py # without parameter search the backup in current dir
-# ./mkpatch.py dir2 # this search the backups in dir2
-# ./mkpatch.py dir1 dir2
-# ./mkpatch.py dir2 destination-patchfile
-# ./mkpatch.py dir1 dir2 destination-patchfile
-# ./mkpatch.py destination-patchfile # this will only parse patchfile
-
-# There are three options: -n, -s, -a (alias respectively to
-# --no-signoff, --signoff and --acked). If you're only rediffing
-# the patch you can use '-n' to avoid altering the signoff list.
-# If you're instead only reviewing the patch you can use '-a'
-# to add an Acked-by, instead of a Signed-off-by. You can use
-# bash alias with bash 'alias mkpatch.py=mkpatch.py -a' if you
-# only review patches, or you can use -n instead if you only
-# regenerate patches without even reviewing them. You can always
-# force a signoff by using -a or -s. The last option mode overrides
-# any previous signoff mode. The default is '-s' (aka '--signoff').
-
-# If you miss the ~/.signedoffby file, '-n' (aka '--no-signoff')
-# behaviour will be forced.
-
-import sys, os, re, readline, getopt
-from rfc822 import Message
-
-TAGS = (
- 'From',
- 'Subject',
- 'Patch-mainline',
- 'References',
- )
-
-DIFF_CMD = 'diff -urNp --exclude CVS --exclude BitKeeper --exclude {arch} --exclude .arch-ids --exclude .svn --exclude .git --exclude .hg'
-SIGNOFF_FILE = '~/.signedoffby'
-
-class signoff_mode_class(object):
- signedoffby = 'Signed-off-by: '
- ackedby = 'Acked-by: '
-
- def __init__(self):
- self.mode = 0
- self.my_signoff = None
- def signoff(self):
- self.mode = 0
- def no_signoff(self):
- self.mode = 1
- def acked(self):
- self.mode = 2
- def is_acked(self):
- return self.mode == 2
- def is_signingoff(self):
- return self.mode == 0
- def is_enabled(self):
- return self.is_signingoff() or self.is_acked()
- def change_prefix(self, prefix, signoff):
- if self.my_signoff is None:
- return prefix
- if self.is_signingoff():
- if signoff == self.my_signoff:
- return self.signedoffby
- elif self.is_acked():
- if signoff == self.my_signoff:
- return self.ackedby
- return prefix
-
-class tag_class(object):
- def __init__(self, name):
- self.name = name
- self.regexp = re.compile(name + r': (.*)', re.I)
- self.value = ''
-
- def parse(self, line, message):
- header = message.isheader(line)
- if header and header.lower() == self.name.lower():
- header = message.getheader(header)
- if header:
- self.value = header
- return len(self.value.split('\n'))
-
- def ask_value(self):
- self.value = ''
- first = 1
- while 1:
- this_value = raw_input('%s: ' % self.name)
- if not this_value:
- break
- if not first:
- self.value += '\n '
- first = 0
- self.value += this_value
-
-class patch_class(object):
- def __init__(self, patchfile, signoff_mode):
- self.patchfile = patchfile
- try:
- self.message = Message(file(patchfile))
- except IOError:
- self.message = None
- self.signoff_mode = signoff_mode
- self.prepare()
- self.read()
-
- def prepare(self):
- readline.add_history(os.path.basename(self.patchfile))
- readline.add_history('yes'); readline.add_history('no')
-
- my_signoff = None
- self.re_signoff = re.compile(self.signoff_mode.signedoffby + r'(.*@.*)', re.I)
- self.re_ackedby = re.compile(self.signoff_mode.ackedby + r'(.*@.*)', re.I)
- try:
- signoff = file(os.path.expanduser(SIGNOFF_FILE)).readline()
- except IOError:
- pass
- else:
- m = self.re_signoff.search(signoff)
- if m:
- my_signoff = m.group(1)
- readline.add_history(my_signoff)
-
- if not my_signoff:
- self.signoff_mode.no_signoff()
- else:
- self.signoff_mode.my_signoff = my_signoff
-
- self.tags = []
- for tag in TAGS:
- self.tags.append(tag_class(tag))
-
- self.signedoffby = self.signoff_mode.signedoffby
- self.ackedby = self.signoff_mode.ackedby
-
- def parse_metadata(self, line):
- # grab bk metadata and convert into valid header
- m = self.re_signoff.search(line)
- prefix = self.signedoffby
- if not m:
- prefix = self.ackedby
- m = self.re_ackedby.search(line)
- if m:
- this_signoff = m.group(1)
- if this_signoff not in self.signoff:
- self.signoff[this_signoff] = prefix
- self.signoff_order.append(this_signoff)
- return
-
- if self.message:
- for tag in self.tags:
- ret = tag.parse(line, self.message)
- if ret:
- return ret
-
- def read(self):
- self.metadata = ''
- self.signoff = {}
- self.signoff_order = []
- self.__payload = ''
-
- try:
- patch = file(self.patchfile, 'r')
- except IOError:
- pass
- else:
- re_index = re.compile(r'Index: .*')
- re_bk = re.compile(r'=====.*vs.*=====')
- re_diff = re.compile(r'diff .*')
- re_plus = re.compile(r'--- .*')
- re_empty = re.compile(r'^\s*$')
-
- re_signoff = self.re_signoff
- re_ackedby = self.re_ackedby
-
- emptylines = ''
- headers = 1
- state = 'is_metadata'
- while 1:
- line = patch.readline()
- if not line:
- break
-
- if re_diff.match(line) or re_plus.match(line) or \
- re_index.match(line) or re_bk.match(line):
- state = 'is_payload'
- elif state == 'is_metadata' and (re_signoff.match(line) or
- re_ackedby.match(line)):
- state = 'is_signoff'
-
- if state == 'is_metadata':
- if re_empty.search(line):
- emptylines += '\n'
- else:
- nr_lines = self.parse_metadata(line)
- if type(nr_lines) == int:
- for i in xrange(1, nr_lines):
- patch.readline()
- if not headers or not nr_lines:
- if headers:
- emptylines = ''
- headers = 0
- self.metadata += emptylines + line
- emptylines = ''
- elif state == 'is_signoff':
- m = self.re_signoff.match(line)
- prefix = self.signedoffby
- if not m:
- prefix = self.ackedby
- m = self.re_ackedby.match(line)
- if m:
- this_signoff = m.group(1)
- if this_signoff not in self.signoff:
- self.signoff[this_signoff] = prefix
- self.signoff_order.append(this_signoff)
- elif state == 'is_payload':
- self.__payload += line
- else:
- raise 'unknown state'
-
- def ask_empty_tags(self):
- for tag in self.tags:
- if not tag.value:
- tag.ask_value()
-
- def get_tags(self):
- ret = ''
- for tag in self.tags:
- if tag.value:
- ret += tag.name + ': ' + tag.value + '\n'
- return ret
-
- def get_signoff(self):
- ret = ''
- for signoff in self.signoff_order:
- prefix = self.signoff[signoff]
- prefix = self.signoff_mode.change_prefix(prefix, signoff)
- ret += prefix + signoff + '\n'
- my_signoff = self.signoff_mode.my_signoff
- if self.signoff_mode.is_enabled() and \
- my_signoff and my_signoff not in self.signoff:
- prefix = self.signoff_mode.change_prefix(None, my_signoff)
- ret += prefix + my_signoff + '\n'
- return ret
-
- def write(self):
- tags = self.get_tags()
- if tags:
- tags += '\n'
- metadata = self.metadata
- if metadata:
- metadata += '\n'
- signoff = self.get_signoff()
- if signoff:
- signoff += '\n'
- payload = self.payload
- try:
- os.unlink(self.patchfile) # handle links
- except OSError:
- pass
- file(self.patchfile, 'w').write(tags + metadata + signoff + payload)
-
- def get_payload(self):
- return self.__payload
-
- def set_payload(self, value):
- if value is not None:
- self.__payload = cleanup_patch(value)
-
- payload = property(get_payload, set_payload)
-
-def cleanup_patch(patch):
- diffline = re.compile(DIFF_CMD + r'.*')
- ret = ''
- for line in re.split('\n', patch):
- if line and not diffline.match(line):
- ret += line + '\n'
- stdin, stdout = os.popen2('diffstat')
- print >>stdin, ret,
- stdin.close()
- diffstat = stdout.read()
- if not diffstat:
- raise 'no diffstat'
- return diffstat + '\n' + ret
-
-def replace_diff(diff, patchfile, signoff_mode):
- patch = patch_class(patchfile, signoff_mode)
- patch.payload = diff
- patch.ask_empty_tags()
- patch.write()
-
-def mkpatch(*args):
- # parse opts
- try:
- opts, args = getopt.getopt(args, 'nas', ( 'no-signoff', 'acked', 'signoff', ))
- except getopt.GetoptError:
- raise 'EINVAL'
- signoff_mode = signoff_mode_class()
- for opt, arg in opts:
- if opt in ('-n', '--no-signoff', ):
- signoff_mode.no_signoff()
- elif opt in ('-a', '--acked', ):
- signoff_mode.acked()
- elif opt in ('-s', '--signoff', ):
- signoff_mode.signoff()
-
- # parse args
- nr_args = len(args)
- def cleanup_path(args):
- return map(os.path.normpath, map(os.path.expanduser, args))
- if nr_args > 3:
- raise 'EINVAL'
- elif nr_args == 0:
- olddir = None
- newdir = '.'
- patchfile = None
- elif nr_args == 1:
- olddir = None
- newdir, = cleanup_path(args)
- patchfile = None
- elif nr_args == 2:
- olddir = None
- newdir, patchfile = cleanup_path(args)
- elif nr_args == 3:
- olddir, newdir, patchfile = cleanup_path(args)
-
- #print olddir, newdir, patchfile
- if olddir and not os.path.isdir(olddir):
- print >>sys.stderr, 'olddir must be a directory'
- raise 'EINVAL'
- elif not os.path.isdir(newdir):
- if not os.path.isfile(newdir):
- print >>sys.stderr, 'newdir must be a directory or a file'
- raise 'EINVAL'
- olddir, newdir, patchfile = (None, None, newdir, )
- elif patchfile and os.path.isdir(patchfile):
- olddir = newdir
- newdir = patchfile
- patchfile = None
- #print olddir, newdir, patchfile
-
- diff = None
- if not olddir and newdir:
- # use backup files
- print >>sys.stderr, 'Searching backup files in %s ...' % newdir,
- find = os.popen('find %s -type f \( -name \*~ -or -name \*.orig \) 2>/dev/null' % newdir, 'r')
- files = find.readlines()
- if files:
- print >>sys.stderr, 'done.'
- else:
- print >>sys.stderr, 'none found.'
-
- diff = ''
- already_diffed = {}
- for backup_f in files:
- new_f = None
- backup_f = backup_f[:-1]
- backup_f = os.path.normpath(backup_f)
- if backup_f[-5:] == '.orig':
- new_f = backup_f[:-5]
- elif backup_f[-4:] == '.~1~':
- new_f = backup_f[:-4]
- elif backup_f[-1:] == '~':
- new_f = backup_f[:-1]
-
- if new_f:
- if not os.path.isfile(new_f):
- continue
- if new_f in already_diffed:
- continue
- already_diffed[new_f] = 0
- print >>sys.stderr, 'Diffing %s...' % new_f,
- this_diff = os.popen(DIFF_CMD + ' %s %s' % (backup_f, new_f) + ' 2>/dev/null').read()
- if this_diff:
- diff += 'Index: ' + new_f + '\n' + this_diff
- if this_diff:
- print >>sys.stderr, 'done.'
- else:
- print >>sys.stderr, 'unchanged.'
- elif olddir and newdir:
- # use two directories
- print >>sys.stderr, 'Creating diff between %s and %s ...' % (olddir, newdir),
- diff = os.popen(DIFF_CMD + ' %s %s' % (olddir, newdir) + ' 2>/dev/null', 'r').read()
- print >>sys.stderr, 'done.'
-
- if patchfile:
- replace_diff(diff, patchfile, signoff_mode)
- os.execvp('vi', ('vi', '-c', 'set tw=72', patchfile, ))
- else:
- if diff:
- print cleanup_patch(diff),
-
-if __name__ == '__main__':
- try:
- mkpatch(*sys.argv[1:])
- except 'EINVAL':
- print >>sys.stderr, 'Usage:', sys.argv[0], \
- '[-a|--acked] [-n|--no-signoff] [-s|--signoff] [olddir] [newdir] [patch]'
diff --git a/scripts/old-packages.sh b/scripts/old-packages.sh
deleted file mode 100755
index 8c15a36c2b..0000000000
--- a/scripts/old-packages.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/bash
-
-for arch in $(scripts/arch-symbols --list) ; do
- symbols="$(scripts/arch-symbols $arch)"
- for config in $(scripts/guards $symbols < config.conf) ; do
- config=${config#config/}
- flavor=${config#*/}
- echo "kernel-$flavor ($arch)"
- echo Provides: $(scripts/guards $symbols $flavor p \
- < rpm/old-packages.conf)
- echo Obsoletes: $(scripts/guards $symbols $flavor o \
- < rpm/old-packages.conf)
- echo
- done
-done
diff --git a/scripts/patch-report b/scripts/patch-report
deleted file mode 100755
index 694ca6da6d..0000000000
--- a/scripts/patch-report
+++ /dev/null
@@ -1,239 +0,0 @@
-#!/usr/bin/env python
-#
-# prepares a report on the patches in a series file that do not yet have
-# mainline tags.
-#
-# common usage: patch-report -s summary -r report < series
-#
-# -s specifies a file where a summary of patches per user is printed
-# -r is a report with details about each patch
-# -t does guards style tagging in the report of patches that can be reversed
-# -f tries to reverse with rej. This is very slow.
-# -u prints only details on patches corresponding to a specific user.
-# this is everything before the @ sign in the email.
-#
-# This can try to reverse all the untagged patches, use -p source-dir to
-# specify the directory where it should try to reverse things.
-
-#
-#
-
-import os, sys, select, popen2, re
-from optparse import OptionParser
-
-# counts the number of times we find a given username. We only
-# consider emails from @suse and @novell, and don't include the domain
-# name in the counting (so mason@suse.de and mason@suse.com are the same)
-def countuser(s, users, foundusers, emailre):
- found = []
- for m in emailre.finditer(s):
- u = m.group(1)
- addr = m.group(2)
- if not addr.startswith('@suse') and not addr.startswith('@novell'):
- continue
- if u in foundusers:
- continue
- foundusers[u] = 1
- n = users.get(u, 0)
- users[u] = n + 1
- found.append(m.group(0))
- return found
-
-
-parser = OptionParser(usage="usage: %prog [options]")
-parser.add_option("-u", "--user", help="find a specific user", default="")
-parser.add_option("-r", "--report-file", help="report output file", default="")
-parser.add_option("-v", "--verbose", help="verbose", action="store_true",
- default=False)
-parser.add_option("-t", "--tag", help="tag patches in report",
- action="store_true", default=False)
-parser.add_option("-f", "--rej", help="try using rej", action="store_true",
- default=False)
-parser.add_option("-p", "--patch-dir", help="try to reverse patches in path",
- default="")
-parser.add_option("-s", "--summary-file", help="summary output file",
- default="")
-(options, args) = parser.parse_args()
-
-# start a two way connection with xargs patch-tag.
-pipeout, pipein = popen2.popen2("xargs patch-tag -p From -p Signed-off-by -p Acked-by -p Patch-mainline -a Patch-mainline=empty -p Subject")
-readers = [ sys.stdin, pipeout ]
-writers = [ pipein ]
-writeq = []
-stdindone = False
-patches = {}
-
-# records details about all the patches
-patchinfo = {}
-
-# keeps the output in the same order as the series read over stdin
-patchorder = []
-# a count of the patches found for each user
-users = {}
-emailre = re.compile(r"([\w\.]+)(@[\w\.]+)")
-
-goodwords = [ '2.6', 'yes', 'obsolete', 'never' ]
-badwords = ['-mm', 'no', 'empty' ]
-
-# ugly select loop to talk with patch-tag
-while readers:
- (r, w, x) = select.select(readers, writers, [])
- for f in r:
- if f == sys.stdin:
- l = f.readline()
- if l:
- writeq.append(l)
- else:
- del readers[0]
- stdindone = True
- if len(writeq) == 0:
- pipein.close()
- writers = []
- elif f == pipeout:
- line = f.readline().rstrip()
- l = line.split()
- if l:
- # the format is:
- # file: Patch-mainline: data
- # data may be empty
- p = l[0].rstrip(':')
- if len(l) <= 1:
- continue
- htype = l[1].rstrip(':')
-
- if len(l) < 3:
- t = 'empty'
- else:
- t = " ".join(l[2:])
- patchinfo.setdefault(p, {}).setdefault(htype, []).append(t)
- if htype != 'Patch-mainline':
- continue
- good = False
- t = t.lower()
- for x in goodwords:
- if x in t:
- good = True
- break
- for x in badwords:
- # For example, 2.6.16-mm2 is bad
- if x in t:
- good = False
- break
- if not good:
- patches[p] = t
- patchorder.append(p)
- else:
- del readers[0]
-
- if w and writeq:
- w[0].write(writeq[0])
- del writeq[0]
- if stdindone and len(writeq) == 0:
- pipein.close()
- writers = []
-
-if options.report_file:
- try:
- outf = file(options.report_file, "w")
- except IOError:
- sys.stderr.write("unable to open %s for writing\n" %
- options.report_file);
- sys.exit(1)
-else:
- outf = sys.stdout
-
-# optionally try to figure out which patches we can reverse
-if options.patch_dir:
- for i in xrange(len(patchorder)-1, -1, -1):
- p = patchorder[i]
- fuzz = 0
- failed = 0
- files = 0
- reject_files = 0
- # we want to be smart about counting the failed hunks
- patchf = os.popen("patch -f -p1 -d%s -R < '%s'" %
- (options.patch_dir, p))
- for l in patchf:
- if options.verbose:
- sys.stderr.write(l)
- l = l.rstrip('\r\n')
- if l[:14] == 'patching file ':
- files += 1
- elif l.find('saving rejects to file') >= 0:
- reject_files += 1
- elif l.find('FAILED at') >= 0:
- failed += 1
- elif l.find('with fuzz') >= 0:
- fuzz += 1
-
- patcherr = patchf.close()
- if failed == 0 and patcherr == None:
- if fuzz:
- patchinfo[p]['Reverse'] = 'fuzzy'
- else:
- patchinfo[p]['Reverse'] = 'yes'
- else:
- str = "hunks failed %d fuzzy %d files %d reject files %d" % (failed,
- fuzz, files, reject_files)
- if options.rej:
- patchpath = os.path.abspath(p)
- ret = os.system("cd '%s' ; rej -R -a --dry-run -F -M -p 1 '%s'"
- % (options.patch_dir, patchpath))
- if ret == 0:
- str = "rej resolved " + str
- patchinfo[p]['Reverse'] = str
-
-for p in patchorder:
- h = patchinfo[p]
- foundusers = {}
- if options.user:
- good = False
- for x in ['Acked-by', 'Signed-off-by', 'From']:
- if options.user in "".join(h.get(x, [])):
- good = True
- break
- if not good:
- continue
- tag = "+nag "
- # always print From and Subject. Only print acked-by or signed-off-by
- # if it is a suse/novell person
- if 'From' in h:
- l = " ".join(h['From'])
- outf.write("# From: %s\n" % l)
- countuser(l, users, foundusers, emailre)
- if 'Subject' in h:
- outf.write("# Subject: %s\n" % " ".join(h['Subject']))
- for x in ['Acked-by', 'Signed-off-by']:
- if x in h:
- l = " ".join(h[x])
- found = countuser(l, users, foundusers, emailre)
- if found:
- outf.write("# %s: %s\n" % (x, " ".join(found)))
- if 'Reverse' in h:
- t = h['Reverse']
- if t == 'yes':
- tag = "+reverse "
- elif t == 'fuzzy':
- tag = "+reverse-fuzzy "
- outf.write("# Reverse: %s\n" % h['Reverse'])
- if options.tag:
- p = tag + p
- outf.write("%s\n\n" % (p))
-
-if options.summary_file:
- try:
- outf = file(options.summary_file, "w")
- except IOError:
- sys.stderr.write("unable to open %s for writing\n" %
- options.report_file);
- sys.exit(1)
-else:
- outf = sys.stdout
-userk = users.keys()
-userk.sort()
-outf.write("Total untagged patches: %d\n" % len(patchorder))
-for u in userk:
- if options.user and options.user not in u:
- continue
- outf.write("%s: %d\n" % (u, users[u]))
-
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/refresh b/scripts/refresh
deleted file mode 100755
index ce8895ee22..0000000000
--- a/scripts/refresh
+++ /dev/null
@@ -1,97 +0,0 @@
-#! /bin/sh
-
-# Extract the description of a patch.
-patch_description() {
- local patch_file=$1
-
- if [ -e "$patch_file" -o -z "$patch_file" ]
- then
- awk '
- $1 == "***" || $1 == "---" { exit }
- /^Index:[ \t]|^diff[ \t]|^==*$/ \
- { eat = eat $0 "\n"
- next }
- { print eat $0
- eat = "" }
- ' $patch_file
- fi
-}
-
-usage() {
- echo "Usage: ${0##*/} <patch> <tree-1> [<tree-2>]"
- exit 2
-}
-
-if [ $# -lt 2 -o $# -gt 3 ]; then
- usage
-fi
-
-patch=$1
-
-if [ ! -d "$2" ]; then
- echo "$2 is not a directory" >&2
- exit 1
-fi
-
-if [ $# -eq 2 ]; then
- if [ -d "$2.orig" ]; then
- tree1=$2.orig
- tree2=$2
- label=$tree2
- elif [ -d "${2%.*}.orig" ]; then
- tree1=${2%.*}.orig
- tree2=$2
- label=${tree2%.*}
- elif [ -d "${2%.*}" ]; then
- tree1=${2%.*}
- tree2=$2
- label=${2%.*}
- else
- echo "Could not guess name of second tree" >&2
- exit 1
- fi
-else
- if [ ! -d "$3" ]; then
- echo "$3 is not a directory" >&2
- exit 1
- fi
- tree1=$2
- tree2=$3
-fi
-
-if [ "$tree1" -ef "$tree2" ]; then
- echo "$tree1 and $tree2 are the same directory" >&2
- exit 1
-fi
-
-tree1=${tree1%/}
-tree2=${tree2%/}
-
-basename=${patch##*/}
-dir=${patch%/*}
-if [ "$basename" = "$patch" ]; then
- dir=.
-fi
-
-tmp=$(mktemp "$dir/.$basename.XXXXXX")
-trap 'rm -f $tmp' EXIT
-
-if [ -f "$patch" ]; then
- echo "Refreshing patch $patch ($tree1 => $tree2)"
- patch_description $patch > $tmp
-else
- echo "Creating patch $patch ($tree1 => $tree2)"
-fi
-
-# escape slashes
-re_tree1=${tree1//\//\\\/}
-re_tree2=${tree2//\//\\\/}
-re_label=${label//\//\\\/}
-
-EXCLUDE="--exclude='*.orig' --exclude='*.rej' --exclude='*~'"
-diff -Nur -p $EXCLUDE "$tree1" "$tree2" \
-| sed -e "s/^diff .* $re_tree1\/\(.*\) $re_tree2.*/Index: \1\n===================================================================/" \
- -e "s/^--- $re_tree1\([^$'\t']*\).*/--- $label.orig\1/" \
- -e "s/^+++ $re_tree2\([^$'\t']*\).*/+++ $label\1/" \
->> "$tmp"
-cat "$tmp" > "$patch"
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$}"