[reprotest] 02/05: Add script for importing autopkgtest code

Ximin Luo infinity0 at debian.org
Wed Jul 19 15:13:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository reprotest.

commit 68ecf09671e868b4ae320d4c036bd8570467db5e
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Jul 19 17:07:42 2017 +0200

    Add script for importing autopkgtest code
---
 debian/diff-adt.sh           |  3 ---
 debian/import-autopkgtest.sh | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/debian/diff-adt.sh b/debian/diff-adt.sh
deleted file mode 100755
index c083a2a..0000000
--- a/debian/diff-adt.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-# Show the patches that we made to autopkgtest code, since when we imported it
-exec git diff "$@" -M 557707f0432769e1f903545335869ded5ce881d2  -- reprotest/lib/* reprotest/{virt/,virt-subproc/adt-virt-}{chroot,lxc,lxd,null,qemu,schroot,ssh}
diff --git a/debian/import-autopkgtest.sh b/debian/import-autopkgtest.sh
new file mode 100755
index 0000000..b3dcfc4
--- /dev/null
+++ b/debian/import-autopkgtest.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+set -e
+
+tag=${1:-4.4}
+repo=${2:-../autopkgtest}
+
+( cd "$repo" && git checkout "$tag" )
+
+lib_imports="adt_testbed adtlog VirtSubproc"
+
+ourpatch() {
+	for i in $lib_imports; do
+		sed -i -e 's/^import '"$i"'/from reprotest.lib import '"$i"'/g' "$1"
+	done
+}
+
+last_import=$(git log --pretty="format:%H" --grep='Import autopkgtest')
+
+for i in $lib_imports; do
+	target=reprotest/lib/"$i.py"
+	cp "$repo/lib/$i.py" "$target"
+	ourpatch "$target"
+done
+
+for i in "$repo/virt/"*; do
+	if [ "$i" != "${i%.1}" ]; then continue; fi # man page
+	target=reprotest/virt/$(basename "$i")
+	cp "$i" "$target"
+	ourpatch "$target"
+done
+
+echo "*** Import complete; run the following to commit it:"
+echo "  git commit -m 'Import autopkgtest $tag' reprotest/lib/ reprotest/virt/"
+echo "*** Afterwards, you should re-import the following patches:"
+git log --oneline "${last_import}..HEAD" -- reprotest/lib/ reprotest/virt/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git



More information about the Reproducible-commits mailing list