Move featureset patches and series file to debian/patches-<featureset>.

Fixes lintian warning patch-file-present-but-not-mentioned-in-series.

Also preparation for using dgit, which will remove everything except
the main patch series under debian/patches.
This commit is contained in:
Ben Hutchings 2018-08-10 14:46:09 +01:00
parent 07b57afec5
commit 26224f8bb8
269 changed files with 455 additions and 464 deletions

3
debian/.gitignore vendored
View File

@ -1,6 +1,7 @@
!/patches
!/patches*
!*.patch
!*.diff
!series
*.debhelper*
*.local
*.pyc

View File

@ -98,8 +98,8 @@ features/ and debian/. Patches are in the standard kernel patch
format (unified diff to be applied with patch -p1) and generally have
DEP-3 headers.
The series file 'series' is used for all configurations and a series
file 'series-<featureset>' is used for each optional featureset.
For each optional featureset there is an additional patch directory
debian/patches-<featureset>.
If you want to generate a source tree with all patches applied, run
make -f debian/rules source

View File

@ -2,8 +2,10 @@
TMPDIR=$(mktemp -d)
trap "rm -rf $TMPDIR" EXIT
sed '/^#/d; /^[[:space:]]*$/d; /^X /d; s/^+ //; s,^,debian/patches/,' debian/patches/series* | sort -u > $TMPDIR/used
find debian/patches ! -path '*/series*' -type f -name "*.diff" -o -name "*.patch" -printf "%p\n" | sort > $TMPDIR/avail
for patchdir in debian/patches*; do
sed '/^#/d; /^[[:space:]]*$/d; /^X /d; s/^+ //; s,^,'"$patchdir"'/,' "$patchdir"/series
done | sort -u > $TMPDIR/used
find debian/patches* ! -path '*/series' -type f -name "*.diff" -o -name "*.patch" -printf "%p\n" | sort > $TMPDIR/avail
echo "Used patches"
echo "=============="
cat $TMPDIR/used

View File

@ -3,9 +3,8 @@
import codecs, errno, io, os, os.path, re, shutil, subprocess, sys, tempfile
def main(source, version=None):
patch_dir = 'debian/patches'
rt_patch_dir = 'features/all/rt'
series_name = 'series-rt'
patch_dir = 'debian/patches-rt'
series_name = 'series'
old_series = set()
new_series = set()
@ -19,10 +18,8 @@ def main(source, version=None):
pass
with open(os.path.join(patch_dir, series_name), 'w') as series_fh:
# Add directory prefix to all filenames.
# Add Origin to all patch headers.
def add_patch(name, source_patch, origin):
name = os.path.join(rt_patch_dir, name)
path = os.path.join(patch_dir, name)
try:
os.unlink(path)
@ -37,8 +34,6 @@ def main(source, version=None):
patch.write('\n')
in_header = False
patch.write(line)
series_fh.write(name)
series_fh.write('\n')
new_series.add(name)
if os.path.isdir(os.path.join(source, '.git')):
@ -60,13 +55,12 @@ def main(source, version=None):
args = ['git', 'format-patch', 'v%s..v%s-rebase' % (up_ver, version)]
format_proc = subprocess.Popen(args,
cwd=os.path.join(patch_dir, rt_patch_dir),
cwd=patch_dir,
env=env, stdout=subprocess.PIPE)
with io.open(format_proc.stdout.fileno(), encoding='utf-8') as pipe:
for line in pipe:
name = line.strip('\n')
with open(os.path.join(patch_dir, rt_patch_dir, name)) as \
source_patch:
with open(os.path.join(patch_dir, name)) as source_patch:
patch_from = source_patch.readline()
match = re.match(r'From ([0-9a-f]{40}) ', patch_from)
assert match
@ -115,9 +109,7 @@ def main(source, version=None):
if name != '' and name[0] != '#':
with open(os.path.join(source_dir, name)) as source_patch:
add_patch(name, source_patch, origin)
else:
# Leave comments and empty lines unchanged
series_fh.write(line)
series_fh.write(line)
finally:
shutil.rmtree(temp_dir)

View File

@ -64,25 +64,24 @@ if [ "${version%a~test}" = "$version" ]; then
dch -v "$version" --distribution UNRELEASED "Testing patches $*"
fi
# Make new directory for patches
mkdir -p debian/patches/test
# Ignore user's .quiltrc
alias quilt='quilt --quiltrc -'
# Try to clean up any previous test patches
if [ "$featureset" = none ]; then
patchdir=debian/patches
while patch="$(quilt next 2>/dev/null || quilt top 2>/dev/null)" && \
[ "${patch#test/}" != "$patch" ]; do
quilt delete -r "$patch"
done
else
sed -i '/^test\//d' debian/patches/series-${featureset}
patchdir=debian/patches-${featureset}
sed -i '/^test\//d' $patchdir/series
fi
# Prepare a new directory for the patches
rm -rf debian/patches/test/
mkdir debian/patches/test
rm -rf $patchdir/test/
mkdir $patchdir/test
# Regenerate control and included rules
rm debian/control debian/rules.gen

1
debian/changelog vendored
View File

@ -3,6 +3,7 @@ linux (4.18.6-2) UNRELEASED; urgency=medium
[ Ben Hutchings ]
* [x86] wireless: Enable R8822BE as module (Closes: #908330)
* Move all patch generation scripts to debian/bin
* [rt] genpatch-rt: Store patches and series file in debian/patches-rt
[ Salvatore Bonaccorso ]
* mac80211: don't update the PM state of a peer upon a multicast frame

Some files were not shown because too many files have changed in this diff Show More