]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: [Debian] autoreconstruct -- generate extend-diff-ignore for links
authorAndy Whitcroft <apw@canonical.com>
Sun, 24 Apr 2016 18:52:57 +0000 (19:52 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
BugLink: http://bugs.launchpad.net/bugs/1574362
Signed-off-by: Andy Whitcroft <apw@canonical.com>
debian/rules.d/1-maintainer.mk
debian/scripts/misc/gen-auto-reconstruct
debian/source/options

index b86dc4aa1021e27a9b677771aa60786064bcc55c..0c579c85195e2d114ffb2696c21966cba03ca640 100644 (file)
@@ -105,7 +105,7 @@ insertchanges: autoreconstruct
        @perl -w -f $(DROOT)/scripts/misc/insert-changes.pl $(DROOT) $(DEBIAN) 
 
 autoreconstruct:
-       $(DROOT)/scripts/misc/gen-auto-reconstruct $(release) >$(DEBIAN)/reconstruct
+       $(DROOT)/scripts/misc/gen-auto-reconstruct $(release) $(DEBIAN)/reconstruct $(DROOT)/source/options
 
 diffupstream:
        @git diff-tree -p refs/remotes/linux-2.6/master..HEAD $(shell ls | grep -vE '^(ubuntu|$(DEBIAN)|\.git.*)')
index c1b040679731784acc0a8d187723ae1fe3ff78b8..83c0428cd5a8f8db0f2ce3319c50dacf2f2dcc6e 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/bash
 
-if [ "$#" -ne 1 ]; then
-       echo "Usage: $0 <orig tag>|<base release>" 1>&2
+if [ "$#" -ne 3 ]; then
+       echo "Usage: $0 <orig tag>|<base release> <reconstruct> <options>" 1>&2
        exit 1
 fi
 tag="$1"
+reconstruct="$2"
+options="$3"
 
 case "$tag" in
 v*)    ;;
@@ -21,23 +23,50 @@ fi
 #git ls-tree -r --full-tree HEAD | grep ^120 | \
 #while read mode type blobid name
 
-# Identify all new symlinks since the proffered tag.
-echo "# Recreate any symlinks created since the orig."
-git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
-while read name
-do
-       link=$( readlink "$name" )
-
-       echo "[ ! -L '$name' ] && ln -sf '$link' '$name'"
-done
-
-# Identify all removed files since the proffered tag.
-echo "# Remove any files deleted from the orig."
-git diff "$tag.." --raw | awk '(/^:/ && $5 == "D") { print $NF }' | \
-while read name
-do
-       echo "rm -f '$name'"
-done
-
-# All done, make sure this does not complete in error.
-echo "exit 0"
+(
+       # Identify all new symlinks since the proffered tag.
+       echo "# Recreate any symlinks created since the orig."
+       git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
+       while read name
+       do
+               link=$( readlink "$name" )
+
+               echo "[ ! -L '$name' ] && ln -sf '$link' '$name'"
+       done
+
+       # Identify all removed files since the proffered tag.
+       echo "# Remove any files deleted from the orig."
+       git diff "$tag.." --raw | awk '(/^:/ && $5 == "D") { print $NF }' | \
+       while read name
+       do
+               echo "rm -f '$name'"
+       done
+
+       # All done, make sure this does not complete in error.
+       echo "exit 0"
+) >"$reconstruct"
+
+(
+       # Identify all new symlinks since the proffered tag.
+       echo "# Ignore any symlinks created since the orig which are rebuilt by reconstruct."
+       git diff "$tag.." --raw | awk '(/^:000000 120000/ && $5 == "A") { print $NF }' | \
+       while read name
+       do
+               echo "extend-diff-ignore=$name"
+       done
+) >"$options.update"
+
+
+head='^## autoreconstruct -- begin$'
+foot='^## autoreconstruct -- end$'
+sed -i -e "
+       /$head/,/$foot/{
+               /$head/{
+                       p;
+                       r $options.update
+               };
+               /$foot/p;
+               d
+       }
+" "$options"
+rm -f "$options.update"
index 628f5f5167f7a734d4126c0ae43efc1ce5b8ebb9..6ad1e314be884b03f43a939120da85fcfe129056 100644 (file)
@@ -1,4 +1,5 @@
 # Ignore vbox symlinks, we will regenerate these at clean (LP:1426113)
+## autoreconstruct -- begin
 extend-diff-ignore=ubuntu/vbox/vboxvideo/include
 extend-diff-ignore=ubuntu/vbox/vboxguest/r0drv
 extend-diff-ignore=ubuntu/vbox/vboxguest/include
@@ -18,6 +19,7 @@ extend-diff-ignore=zfs/scripts/zpios-test/large.sh
 extend-diff-ignore=zfs/scripts/zpios-test/medium.sh
 extend-diff-ignore=zfs/scripts/zpios-test/small.sh
 extend-diff-ignore=zfs/scripts/zpios-test/tiny.sh
+## autoreconstruct -- end
 
 # force "dpkg-source -I -i" behavior
 diff-ignore