]> git.saurik.com Git - apt.git/commitdiff
test: framework: Ensure copied status files have trailing lines
authorJulian Andres Klode <jak@debian.org>
Wed, 7 Sep 2016 11:23:26 +0000 (13:23 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 7 Sep 2016 12:00:37 +0000 (14:00 +0200)
If we copied one of the existing status files, we might not have
a trailing newline, so let's add one.

Gbp-Dch: ignore

test/integration/framework

index 067cc6e8ad573eb9e8b59b7fca7cca3855818432..c5b752e1809fd7f917b1f8e8ab484291126e8a3f 100644 (file)
@@ -525,6 +525,10 @@ configdpkg() {
                local STATUSFILE="status-${BASENAME#*-}"
                if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then
                        cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status
+                       # Add an empty line to the end if there is none
+                       if tail -1 rootdir/var/lib/dpkg/status | grep -q .; then
+                               echo >> rootdir/var/lib/dpkg/status
+                       fi
                else
                        echo -n > rootdir/var/lib/dpkg/status
                fi