Explorar o código

add a method to insert packages into dpkg's status file

David Kalnischkies %!s(int64=15) %!d(string=hai) anos
pai
achega
dfc2b1be9e
Modificáronse 1 ficheiros con 23 adicións e 0 borrados
  1. 23 0
      test/integration/framework

+ 23 - 0
test/integration/framework

@@ -422,6 +422,29 @@ Filename: pool/main/${NAME}/${NAME}_${VERSION}_${ARCH}.deb" >> $FILE
 	done
 	done
 }
 }
 
 
+insertinstalledpackage() {
+	local NAME="$1"
+	local ARCH="$2"
+	local VERSION="$3"
+	local DEPENDENCIES="$4"
+	local FILE="rootdir/var/lib/dpkg/status"
+	echo "Package: $NAME
+Status: install ok installed
+Priority: optional
+Section: other
+Installed-Size: 42
+Maintainer: Joe Sixpack <joe@example.org>
+Architecture: $ARCH
+Version: $VERSION" >> $FILE
+	test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE
+	echo "Description: an autogenerated dummy ${NAME}=${VERSION}/${RELEASE}
+ If you find such a package installed on your system,
+ YOU did something horribly wrong! They are autogenerated
+ und used only by testcases for APT and surf no other propose…
+" >> $FILE
+}
+
+
 buildaptarchivefromincoming() {
 buildaptarchivefromincoming() {
 	msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on incoming packages…"
 	msginfo "Build APT archive for ${CCMD}$(basename $0)${CINFO} based on incoming packages…"
 	cd aptarchive
 	cd aptarchive