Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/recipes-devtools/apt/apt-native.inc b/meta/recipes-devtools/apt/apt-native.inc
new file mode 100644
index 0000000..27cc9ff
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-native.inc
@@ -0,0 +1,70 @@
+require apt.inc
+inherit native
+
+DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
+PACKAGES = ""
+USE_NLS = "yes"
+
+SRC_URI += "file://db_linking_hack.patch \
+            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
+            file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+            file://0001-fix-the-gcc-version-check.patch \
+"
+
+python do_install () {
+    bb.build.exec_func('do_install_base', d)
+    bb.build.exec_func('do_install_config', d)
+}
+
+python do_install_config () {
+    indir = os.path.dirname(d.getVar('FILE',1))
+    infile = file(oe.path.join(indir, 'files', 'apt.conf'), 'r')
+    data = infile.read()
+    infile.close()
+
+    data = d.expand(data)
+
+    outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
+    if not os.path.exists(outdir):
+        os.makedirs(outdir)
+
+    outpath = oe.path.join(outdir, 'apt.conf.sample')
+    if not os.path.exists(outpath):
+        outfile = file(outpath, 'w')
+        outfile.write(data)
+        outfile.close()
+}
+
+do_install_base () {
+	install -d ${D}${bindir}
+	install -m 0755 bin/apt-cdrom ${D}${bindir}/
+	install -m 0755 bin/apt-get ${D}${bindir}/
+	install -m 0755 bin/apt-config ${D}${bindir}/
+	install -m 0755 bin/apt-cache ${D}${bindir}/
+	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+	install -m 0755 bin/apt-ftparchive ${D}${bindir}/
+
+	oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+
+	oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+	oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+
+	install -d ${D}${libdir}/apt/methods
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+	install -d ${D}${libdir}/dpkg/methods/apt
+	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
+
+	install -d ${D}${sysconfdir}/apt
+	install -d ${D}${sysconfdir}/apt/apt.conf.d
+	install -d ${D}${sysconfdir}/apt/preferences.d
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+
+	install -d ${D}${localstatedir}/log/apt/
+}
diff --git a/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb b/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
new file mode 100644
index 0000000..1e660da
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
@@ -0,0 +1,4 @@
+require apt-native.inc
+
+SRC_URI += "file://noconfigure.patch \
+            file://no-curl.patch"
diff --git a/meta/recipes-devtools/apt/apt-package.inc b/meta/recipes-devtools/apt/apt-package.inc
new file mode 100644
index 0000000..a553aa2
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-package.inc
@@ -0,0 +1,78 @@
+apt-manpages="doc/apt-cache.8 \
+	      doc/apt-cdrom.8 \
+	      doc/apt-config.8 \
+	      doc/apt-get.8 \
+	      doc/apt.8 \
+	      doc/apt.conf.5 \
+	      doc/apt_preferences.5 \
+	      doc/sources.list.5"
+apt-utils-manpages="doc/apt-extracttemplates.1 \
+		    doc/apt-sortpkgs.1"
+
+def get_files_apt_doc(d, bb, manpages):
+    import re
+    manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
+    manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
+    return manpages
+
+def get_commands_apt_doc(d, bb, manpages):
+    s = list()
+    __dir_cache__ = list()
+    for m in manpages.split():
+        dest = get_files_apt_doc(d, bb, m)
+        dir = os.path.dirname(dest)
+        if not dir in __dir_cache__:
+            s.append("install -d ${D}/%s" % dir)
+            __dir_cache__.append(dir)
+        s.append("install -m 0644 %s ${D}/%s" % (m, dest))
+    return "\n".join(s)
+
+PACKAGES += "${PN}-utils ${PN}-utils-doc"
+FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
+	       ${bindir}/apt-config ${bindir}/apt-cache \
+	       ${libdir}/apt ${libdir}/libapt*.so.* \
+	       ${localstatedir} ${sysconfdir} \
+	       ${libdir}/dpkg"
+FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
+		   ${docdir}/apt"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
+FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
+
+do_install () {
+	set -x
+	install -d ${D}${bindir}
+	install -m 0755 bin/apt-key ${D}${bindir}/
+	install -m 0755 bin/apt-cdrom ${D}${bindir}/
+	install -m 0755 bin/apt-get ${D}${bindir}/
+	install -m 0755 bin/apt-config ${D}${bindir}/
+	install -m 0755 bin/apt-cache ${D}${bindir}/
+
+	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+
+	oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
+	oe_libinstall -so -C bin libapt-inst ${D}${libdir}
+
+	install -d ${D}${libdir}/apt/methods
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+	install -d ${D}${libdir}/dpkg/methods/apt
+	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
+
+	install -d ${D}${sysconfdir}/apt
+	install -d ${D}${sysconfdir}/apt/apt.conf.d
+	install -d ${D}${sysconfdir}/apt/sources.list.d
+	install -d ${D}${sysconfdir}/apt/preferences.d
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+	install -d ${D}${docdir}/apt/examples
+	install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
+
+	install -d ${D}${includedir}/apt-pkg/
+	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+}
diff --git a/meta/recipes-devtools/apt/apt.inc b/meta/recipes-devtools/apt/apt.inc
new file mode 100644
index 0000000..3248b9a
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt.inc
@@ -0,0 +1,28 @@
+SUMMARY = "Advanced front-end for dpkg"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20150805T094928Z/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
+           file://use-host.patch \
+           file://makerace.patch \
+           file://no-nls-dpkg.patch \
+           file://fix-gcc-4.6-null-not-defined.patch \
+           file://truncate-filename.patch \
+           file://nodoc.patch \
+           file://disable-configure-in-makefile.patch \
+           file://disable-test.patch \
+           "
+SRC_URI[md5sum] = "6505c4297b338adb2087ce87bbc4a276"
+SRC_URI[sha256sum] = "3fb1de9598363c416591d49e3c285458e095b035e6c06d5b944a54e15fc9b543"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+inherit autotools gettext
+
+EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+
+do_configure_prepend() {
+    rm -rf ${S}/buildlib/config.sub
+    rm -rf ${S}/buildlib/config.guess
+}
+
+FILES_${PN}-dbg += "${libdir}/apt/methods/.debug/"
diff --git a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
new file mode 100644
index 0000000..d33069b
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -0,0 +1,378 @@
+From 106797f1c66fa578dad21fd9380bf9d576573dfd Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 22 May 2015 08:05:15 +0800
+Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
+ dpkg callings"
+
+Upstream-Status: Inappropriate [embedded specific]
+
+This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
+always run 'dpkg --configure -a' at the end of our dpkg callings,
+but it does not work for cross-compile, since the rootfs dir can not
+be passed into dpkg, and lead to the below similar error:
+   -------
+   |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
+   -------
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/deb/dpkgpm.cc                              |  9 +--
+ test/integration/framework                         | 25 ++++----
+ test/integration/test-apt-progress-fd              | 67 +++++++++----------
+ test/integration/test-apt-progress-fd-deb822       | 18 ++----
+ test/integration/test-apt-progress-fd-error        |  2 +-
+ ...est-bug-769609-triggers-still-pending-after-run | 75 ----------------------
+ .../test-no-fds-leaked-to-maintainer-scripts       |  6 +-
+ 7 files changed, 56 insertions(+), 146 deletions(-)
+ delete mode 100755 test/integration/test-bug-769609-triggers-still-pending-after-run
+
+diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
+index b187efb..f269764 100644
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -1049,12 +1049,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
+ 	 PackagesTotal++;
+       }
+    }
+-   /* one extra: We don't want the progress bar to reach 100%, especially not
+-      if we call dpkg --configure --pending and process a bunch of triggers
+-      while showing 100%. Also, spindown takes a while, so never reaching 100%
+-      is way more correct than reaching 100% while still doing stuff even if
+-      doing it this way is slightly bending the rules */
+-   ++PackagesTotal;
+ }
+                                                                         /*}}}*/
+ #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
+@@ -1294,8 +1288,9 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
+ 
+    // support subpressing of triggers processing for special
+    // cases like d-i that runs the triggers handling manually
++   bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
+    bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
+-   if (_config->FindB("DPkg::ConfigurePending", true) == true)
++   if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
+       List.push_back(Item(Item::ConfigurePending, PkgIterator()));
+ 
+    // for the progress
+diff --git a/test/integration/framework b/test/integration/framework
+index 70ad381..00672ad 100644
+--- a/test/integration/framework
++++ b/test/integration/framework
+@@ -1178,13 +1178,10 @@ testnopackage() {
+ 	fi
+ }
+ 
+-testdpkgstatus() {
+-	local STATE="$1"
+-	local NR="$2"
+-	shift 2
+-	msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
+-	local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
+-	if [ "$PKGS" != $NR ]; then
++testdpkginstalled() {
++	msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
++	local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
++	if [ "$PKGS" != $# ]; then
+ 		echo >&2 $PKGS
+ 		dpkg -l "$@" | grep '^[a-z]' >&2
+ 		msgfail
+@@ -1193,12 +1190,16 @@ testdpkgstatus() {
+ 	fi
+ }
+ 
+-testdpkginstalled() {
+-	testdpkgstatus 'ii' "$#" "$@"
+-}
+-
+ testdpkgnotinstalled() {
+-	testdpkgstatus 'ii' '0' "$@"
++	msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
++	local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
++	if [ "$PKGS" != 0 ]; then
++		echo
++		dpkg -l "$@" | grep '^[a-z]' >&2
++		msgfail
++	else
++		msgpass
++	fi
+ }
+ 
+ testmarkedauto() {
+diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
+index 68cc043..d72e7e7 100755
+--- a/test/integration/test-apt-progress-fd
++++ b/test/integration/test-apt-progress-fd
+@@ -19,14 +19,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+ 
+ # upgrade
+ exec 3> apt-progress.log
+@@ -35,14 +34,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+ 
+ # reinstall
+ exec 3> apt-progress.log
+@@ -51,24 +49,22 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+ 
+ # and remove
+ exec 3> apt-progress.log
+ testsuccess aptget remove testing -y -o APT::Status-Fd=3
+ testequal "pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Removing testing (amd64)
+-pmstatus:testing:25:Preparing for removal of testing (amd64)
+-pmstatus:testing:50:Removing testing (amd64)
+-pmstatus:testing:75:Removed testing (amd64)
+-pmstatus:dpkg-exec:75:Running dpkg" cat apt-progress.log
++pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
++pmstatus:testing:66.6667:Removing testing (amd64)
++pmstatus:testing:100:Removed testing (amd64)" cat apt-progress.log
+ 
+ # install non-native and ensure we get proper progress info
+ exec 3> apt-progress.log
+@@ -79,13 +75,12 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing2:0:Installing testing2 (i386)
+-pmstatus:testing2:16.6667:Preparing testing2 (i386)
+-pmstatus:testing2:33.3333:Unpacking testing2 (i386)
+-pmstatus:testing2:50:Preparing to configure testing2 (i386)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing2:50:Configuring testing2 (i386)
+-pmstatus:testing2:66.6667:Configuring testing2 (i386)
+-pmstatus:testing2:83.3333:Installed testing2 (i386)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing2:20:Preparing testing2 (i386)
++pmstatus:testing2:40:Unpacking testing2 (i386)
++pmstatus:testing2:60:Preparing to configure testing2 (i386)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing2:60:Configuring testing2 (i386)
++pmstatus:testing2:80:Configuring testing2 (i386)
++pmstatus:testing2:100:Installed testing2 (i386)" cat apt-progress.log
+ 
+ rm -f apt-progress*.log
+diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
+index badc985..9d22794 100755
+--- a/test/integration/test-apt-progress-fd-deb822
++++ b/test/integration/test-apt-progress-fd-deb822
+@@ -27,41 +27,37 @@ Message: Installing testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 16.6667
++Percent: 20
+ Message: Preparing testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 33.3333
++Percent: 40
+ Message: Unpacking testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ Message: Preparing to configure testing (amd64)
+ 
+ Status: progress
+-Percent: 50
++Percent: 60
+ Message: Running dpkg
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ Message: Configuring testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 66.6667
++Percent: 80
+ Message: Configuring testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 83.3333
++Percent: 100
+ Message: Installed testing (amd64)
+-
+-Status: progress
+-Percent: 83.3333
+-Message: Running dpkg
+ " cat apt-progress.log
+ 
+ 
+diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error
+index 6323007..a47095b 100755
+--- a/test/integration/test-apt-progress-fd-error
++++ b/test/integration/test-apt-progress-fd-error
+@@ -18,7 +18,7 @@ setupaptarchive
+ exec 3> apt-progress.log
+ testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
+ msgtest "Ensure correct error message"
+-if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
++if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
+ 	msgpass
+ else
+ 	cat apt-progress.log
+diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run
+deleted file mode 100755
+index 146fa76..0000000
+--- a/test/integration/test-bug-769609-triggers-still-pending-after-run
++++ /dev/null
+@@ -1,75 +0,0 @@
+-#!/bin/sh
+-set -e
+-
+-TESTDIR=$(readlink -f $(dirname $0))
+-. $TESTDIR/framework
+-
+-setupenvironment
+-configarchitecture 'amd64'
+-
+-msgtest 'Check if installed dpkg supports' 'noawait trigger'
+-if dpkg-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev/null; then
+-	msgpass
+-else
+-	msgskip 'dpkg version too old'
+-	exit 0
+-fi
+-configdpkgnoopchroot
+-
+-buildtriggerpackages() {
+-	local TYPE="$1"
+-	setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
+-	BUILDDIR="incoming/triggerable-${TYPE}-1.0"
+-	cat >${BUILDDIR}/debian/postinst <<EOF
+-#!/bin/sh
+-if [ "\$1" = 'triggered' ]; then
+-	ls -l /proc/self/fd/
+-fi
+-EOF
+-	echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian/triggers
+-	buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+-	rm -rf "$BUILDDIR"
+-	buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
+-}
+-
+-#buildtriggerpackages 'interest'
+-buildtriggerpackages 'interest-noawait'
+-buildsimplenativepackage "trigstuff" 'all' '1.0' 'unstable'
+-
+-setupaptarchive
+-
+-runtests() {
+-	local TYPE="$1"
+-	msgmsg 'Working with trigger type' "$TYPE"
+-	testsuccess aptget install triggerable-$TYPE -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+-	testsuccess aptget install trigdepends-$TYPE -y --reinstall
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testsuccess grep ' root root ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+-	testsuccess aptget install trigstuff -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testsuccess grep ' root root ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
+-
+-	testsuccess aptget purge trigstuff -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testsuccess grep ' root root ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-	testdpkgnotinstalled trigstuff
+-
+-	testsuccess aptget purge trigdepends-$TYPE -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testfailure grep '^REWRITE ' terminal.output
+-	testfailure grep ' root root ' terminal.output
+-	testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
+-}
+-#runtests 'interest'
+-runtests 'interest-noawait'
+diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+index 41c0570..d3960d7 100755
+--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
++++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+@@ -59,8 +59,7 @@ startup packages configure
+ configure $PKGNAME 1.0 <none>
+ status unpacked $PKGNAME 1.0
+ status half-configured $PKGNAME 1.0
+-status installed $PKGNAME 1.0
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkinstall
+ 
+@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+-status not-installed $PKGNAME <none>
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkpurge
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch b/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
new file mode 100644
index 0000000..beea56d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
@@ -0,0 +1,160 @@
+From 15c6ef6a827d3681ad06e862d27ab3dfb84cb687 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 14:30:28 +0800
+Subject: [PATCH] fix the gcc version check
+
+Upstream-Status: pending
+
+"GCC diagnostic push" is gcc 4.6 feature, gcc 4.4.7 on centos did not know it
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/cacheset.h           |  4 ++--
+ apt-pkg/deb/debsrcrecords.cc | 12 ++++++------
+ apt-pkg/srcrecords.cc        |  4 ++--
+ apt-pkg/srcrecords.h         |  4 ++--
+ apt-pkg/vendorlist.cc        |  4 ++--
+ 5 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
+index b7229bc..8cc2917 100644
+--- a/apt-pkg/cacheset.h
++++ b/apt-pkg/cacheset.h
+@@ -119,12 +119,12 @@ public:
+ 		inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); }
+ 		inline std::string FullName() const { return getPkg().FullName(); }
+ 		APT_DEPRECATED inline const char *Section() const {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ 	   return getPkg().Section();
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 		}
+diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
+index 49a348d..4bc9dcf 100644
+--- a/apt-pkg/deb/debsrcrecords.cc
++++ b/apt-pkg/deb/debsrcrecords.cc
+@@ -126,13 +126,13 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &F)
+    for (std::vector<pkgSrcRecords::File2>::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2)
+    {
+       pkgSrcRecords::File2 f;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+       f.MD5Hash = f2->MD5Hash;
+       f.Size = f2->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+       f.Path = f2->Path;
+@@ -190,14 +190,14 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ 	 // we have it already, store the new hash and be done
+ 	 if (file != List.end())
+ 	 {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	// set for compatibility only, so warn users not us
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ 	    if (checksumField == "Files")
+ 	       file->MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 	    // an error here indicates that we have two different hashes for the same file
+@@ -212,7 +212,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ 	 F.FileSize = strtoull(size.c_str(), NULL, 10);
+ 	 F.Hashes.push_back(hashString);
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	// set for compatibility only, so warn users not us
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -220,7 +220,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ 	 F.Size = F.FileSize;
+ 	 if (checksumField == "Files")
+ 	    F.MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 
+diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
+index 3175ee7..340e796 100644
+--- a/apt-pkg/srcrecords.cc
++++ b/apt-pkg/srcrecords.cc
+@@ -160,7 +160,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+    for (std::vector<pkgSrcRecords::File>::const_iterator f = F.begin(); f != F.end(); ++f)
+    {
+       pkgSrcRecords::File2 f2;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -168,7 +168,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+       f2.Size = f->Size;
+       f2.Hashes.push_back(HashString("MD5Sum", f->MD5Hash));
+       f2.FileSize = f->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+       f2.Path = f->Path;
+diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h
+index dde22bd..91f8061 100644
+--- a/apt-pkg/srcrecords.h
++++ b/apt-pkg/srcrecords.h
+@@ -30,7 +30,7 @@ class pkgSrcRecords
+ {
+    public:
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	// ensure that con- & de-structor don't trigger this warning
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -48,7 +48,7 @@ class pkgSrcRecords
+       unsigned long long FileSize;
+       HashStringList Hashes;
+    };
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 
+diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
+index fb33ff1..ba1d3c3 100644
+--- a/apt-pkg/vendorlist.cc
++++ b/apt-pkg/vendorlist.cc
+@@ -11,7 +11,7 @@
+ 
+ #include <apti18n.h>
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -163,6 +163,6 @@ const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput)	/*
+ }
+ 									/*}}}*/
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch b/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
new file mode 100644
index 0000000..7c42ff0
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
@@ -0,0 +1,43 @@
+From 2bff7ee06a4f96e7d326991d61fb86f8aa651d48 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 09:48:45 +0800
+Subject: [PATCH] remove Wsuggest-attribute from CXXFLAGS
+
+Upstream-Status: Inappropriate
+
+Wsuggest-attribute is GCC 4.6 feature, centos6 is using GCC
+4.4.7 which unknown this flag, so remove it from CXXFLAGS
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ buildlib/environment.mak.in | 1 -
+ test/libapt/makefile        | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index b0a8d9d..91ed011 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -11,7 +11,6 @@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2
+ CXX = @CXX@
+ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra
+ CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations
+-CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn
+ # a bit too pedantic to be run by default
+ #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros
+ NUM_PROCS = @NUM_PROCS@
+diff --git a/test/libapt/makefile b/test/libapt/makefile
+index 7f23ace..e805f13 100644
+--- a/test/libapt/makefile
++++ b/test/libapt/makefile
+@@ -39,7 +39,6 @@ CXXFLAGS += -pthread
+ # disable some flags for gtest again
+ CXXFLAGS+= -Wno-missing-declarations
+ CXXFLAGS+= -Wno-missing-field-initializers
+-CXXFLAGS+= -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wno-suggest-attribute=noreturn
+ 
+ # All Google Test headers.  Usually you shouldn't change this definition.
+ GTEST_HEADERS = /usr/include/gtest/*.h \
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch b/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
new file mode 100644
index 0000000..7c2f64e
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
@@ -0,0 +1,18 @@
+Disable configure at compilation stage
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -33,7 +33,7 @@ veryclean: clean
+ # The startup target builds the necessary configure scripts. It should
+ # be used after a CVS checkout.
+ CONVERTED=environment.mak include/config.h include/apti18n.h build/doc/Doxyfile makefile
+-include buildlib/configure.mak
++#include buildlib/configure.mak
+ $(BUILDDIR)/include/config.h: buildlib/config.h.in
+ $(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in
+ $(BUILDDIR)/environment.mak: buildlib/environment.mak.in
diff --git a/meta/recipes-devtools/apt/apt/disable-test.patch b/meta/recipes-devtools/apt/apt/disable-test.patch
new file mode 100644
index 0000000..676795d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/disable-test.patch
@@ -0,0 +1,58 @@
+[PATCH] disable test
+
+Upstream-Status: Inappropriate [configuration]
+
+test needs gtest package, so not build the test dir
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile     | 7 +++----
+ configure.ac | 6 ------
+ 2 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5f5fb27..5070e96 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,8 +9,8 @@ endif
+ .PHONY: default
+ default: startup all
+ 
+-.PHONY: headers library clean veryclean all binary program doc test update-po
+-all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs:
++.PHONY: headers library clean veryclean all binary program doc update-po
++all headers library clean veryclean binary program doc manpages docbook update-po startup dirs:
+ 	$(MAKE) -C vendor $@
+ 	$(MAKE) -C apt-pkg $@
+ 	$(MAKE) -C apt-inst $@
+@@ -21,9 +21,8 @@ all headers library clean veryclean binary program doc manpages docbook test upd
+ 	$(MAKE) -C dselect $@
+ #	$(MAKE) -C doc $@
+ 	$(MAKE) -C po $@
+-	$(MAKE) -C test $@
+ 
+-all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs
++all headers library clean veryclean binary program doc manpages docbook update-po: startup dirs
+ 
+ dirs: startup
+ 
+diff --git a/configure.ac b/configure.ac
+index 5663aaf..b0f9564 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -89,12 +89,6 @@ AC_CHECK_LIB(curl, curl_easy_init,
+      AC_MSG_ERROR([failed: I need CURL due https support]),
+ )
+ 
+-AC_LANG_PUSH([C++])
+-AC_CHECK_HEADER(gtest/gtest.h,,
+-     AC_MSG_ERROR([failed: I need gtest to build tests]),
+-)
+-AC_LANG_POP([C++])
+-
+ 
+ AC_SUBST(BDBLIB)
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch b/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
new file mode 100644
index 0000000..801ae6d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/contrib/weakptr.h
++++ b/apt-pkg/contrib/weakptr.h
+@@ -21,6 +21,7 @@
+ #ifndef WEAK_POINTER_H
+ #define WEAK_POINTER_H
+ 
++#include <cstdlib>
+ #include <set>
+ /**
+  * Class for objects providing support for weak pointers.
diff --git a/meta/recipes-devtools/apt/apt/makerace.patch b/meta/recipes-devtools/apt/apt/makerace.patch
new file mode 100644
index 0000000..46e3161
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/makerace.patch
@@ -0,0 +1,23 @@
+I was seeing various issues with parallel make, mainly due to to what was likely 
+partially installed headers. If you change into the source directory and
+"NOISY=1 make  ../obj/apt-pkg/sourcelist.opic" in apt-pkg, you'll see it 
+doesn't have any dependencies on the headers being installed. This patch
+fixes that so things build correctly.
+
+RP 2012/3/19
+
+Upstream-Status: Pending
+
+Index: apt-0.9.9.4/buildlib/library.mak
+===================================================================
+--- apt-0.9.9.4.orig/buildlib/library.mak	2013-07-31 15:45:07.320440575 +0300
++++ apt-0.9.9.4/buildlib/library.mak	2013-07-31 15:46:49.440440561 +0300
+@@ -61,7 +61,7 @@
+ 
+ # Compilation rules
+ vpath %.cc $(SUBDIRS)
+-$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS)
++$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) $($(LOCAL)-HEADERS)
+ 	echo Compiling $< to $@
+ 	$(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $<
+ 	$(DoDep)
diff --git a/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch b/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
new file mode 100644
index 0000000..a0996d4
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -42,6 +42,12 @@
+ #include <apti18n.h>
+ 									/*}}}*/
+ 
++#ifdef USE_NLS
++#define _dpkg(x) dgettext("dpkg", x)
++#else
++#define _dpkg(x) x
++#endif
++
+ using namespace std;
+ 
+ namespace
+@@ -1279,7 +1285,7 @@ void pkgDPkgPM::WriteApportReport(const
+    }
+ 
+    // check if its not a follow up error 
+-   const char *needle = dgettext("dpkg", "dependency problems - leaving unconfigured");
++   const char *needle = _dpkg("dependency problems - leaving unconfigured");
+    if(strstr(errormsg, needle) != NULL) {
+       std::clog << _("No apport report written because the error message indicates its a followup error from a previous failure.") << std::endl;
+       return;
diff --git a/meta/recipes-devtools/apt/apt/noconfigure.patch b/meta/recipes-devtools/apt/apt/noconfigure.patch
new file mode 100644
index 0000000..ebc6720
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/noconfigure.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+
+diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
+index 249542c..0a1911f 100644
+--- a/apt-pkg/packagemanager.cc
++++ b/apt-pkg/packagemanager.cc
+@@ -952,10 +952,12 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
+       return false;
+ 
+    if (Immediate == true) {
++#if 0
+       // Perform immedate configuration of the package. 
+          if (SmartConfigure(Pkg, Depth + 1) == false)
+             _error->Error(_("Could not perform immediate configuration on '%s'. "
+                "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2);
++#endif
+    }
+    
+    return true;
+@@ -1038,6 +1040,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+       }
+    }
+ 
++#if 0
+    // Final run through the configure phase
+    if (ConfigureAll() == false)
+       return Failed;
+@@ -1052,6 +1055,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+ 	 return Failed;
+       }
+    }
++#endif
+ 	 
+    return Completed;
+ }
diff --git a/meta/recipes-devtools/apt/apt/nodoc.patch b/meta/recipes-devtools/apt/apt/nodoc.patch
new file mode 100644
index 0000000..449e42d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/nodoc.patch
@@ -0,0 +1,18 @@
+Disable documentation
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -17,7 +17,7 @@ all headers library clean veryclean bina
+ 	$(MAKE) -C cmdline $@
+ 	$(MAKE) -C ftparchive $@
+ 	$(MAKE) -C dselect $@
+-	$(MAKE) -C doc $@
++#	$(MAKE) -C doc $@
+ 	$(MAKE) -C po $@
+ 	$(MAKE) -C test $@
+ 
diff --git a/meta/recipes-devtools/apt/apt/truncate-filename.patch b/meta/recipes-devtools/apt/apt/truncate-filename.patch
new file mode 100644
index 0000000..db1c42b
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/truncate-filename.patch
@@ -0,0 +1,35 @@
+strutl.cc: the filename can't be longer than 255
+
+The URItoFileName translates the path into the filename, but the
+filename can't be longer than 255 according to
+/usr/include/linux/limits.h.
+
+Truncate it when it is longer than 240 (leave some spaces for
+".Packages" and "._Release" suffix)
+
+Upstream-Status: Pending
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ apt-pkg/contrib/strutl.cc |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
+--- a/apt-pkg/contrib/strutl.cc
++++ b/apt-pkg/contrib/strutl.cc
+@@ -399,7 +399,12 @@ string URItoFileName(const string &URI)
+    // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF";
+    string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*");
+    replace(NewURI.begin(),NewURI.end(),'/','_');
+-   return NewURI;
++
++   // Truncate from the head when it is longer than 240
++   if(NewURI.length() > 240)
++       return NewURI.substr(NewURI.length() - 240, NewURI.length() - 1);
++   else
++       return NewURI;
+ }
+ 									/*}}}*/
+ // Base64Encode - Base64 Encoding routine for short strings		/*{{{*/
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/apt/apt/use-host.patch b/meta/recipes-devtools/apt/apt/use-host.patch
new file mode 100644
index 0000000..b30fcff
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/use-host.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: apt-0.9.7.7/configure.ac
+===================================================================
+--- apt-0.9.7.7.orig/configure.ac
++++ apt-0.9.7.7/configure.ac
+@@ -112,7 +112,7 @@ dnl This is often the dpkg architecture
+ dnl First check against the full canonical canoncial-system-type in $target
+ dnl and if that fails, just look for the cpu
+ AC_MSG_CHECKING(debian architecture)
+-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
++archset="`echo $host_alias|cut -d'-' -f1`"
+ if test "x$archset" = "x"; then
+    AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
+ fi
diff --git a/meta/recipes-devtools/apt/apt_1.0.10.1.bb b/meta/recipes-devtools/apt/apt_1.0.10.1.bb
new file mode 100644
index 0000000..bf77e2a
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt_1.0.10.1.bb
@@ -0,0 +1,18 @@
+DEPENDS = "curl db"
+RDEPENDS_${PN} = "dpkg bash debianutils"
+require apt.inc
+
+require apt-package.inc
+
+PACKAGECONFIG ??= "lzma"
+PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
+
+FILES_${PN} += "${bindir}/apt-key"
+apt-manpages += "doc/apt-key.8"
+
+do_install_append() {
+    #Write the correct apt-architecture to apt.conf
+    APT_CONF=${D}/etc/apt/apt.conf
+    echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
+    oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+}
diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf
new file mode 100644
index 0000000..0335135
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/apt.conf
@@ -0,0 +1,42 @@
+Dir "${STAGING_DIR_NATIVE}/"
+{
+   State "var/lib/apt/"
+   {
+      Lists "#APTCONF#/lists/";
+      status "#ROOTFS#/var/lib/dpkg/status";
+   };
+   Cache "var/cache/apt/"
+   {
+      Archives "archives/";
+      pkgcache "";
+      srcpkgcache "";
+   };
+   Bin "${STAGING_BINDIR_NATIVE}/"
+   {
+      methods "${STAGING_LIBDIR}/apt/methods/";
+      gzip "/bin/gzip";
+      dpkg "dpkg";
+      dpkg-source "dpkg-source";
+      dpkg-buildpackage "dpkg-buildpackage";
+      apt-get "apt-get";
+      apt-cache "apt-cache";
+   };
+   Etc "#APTCONF#"
+   {
+      Preferences "preferences";
+   };
+};
+
+APT
+{
+  Install-Recommends "true";
+  Immediate-Configure "false";
+  Architecture "i586";
+  Get
+  {
+     Assume-Yes "true";
+     Force-Yes "true"
+  };
+};
+
+DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
diff --git a/meta/recipes-devtools/apt/files/db_linking_hack.patch b/meta/recipes-devtools/apt/files/db_linking_hack.patch
new file mode 100644
index 0000000..a61d4b0
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/db_linking_hack.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Backport
+
+Index: apt-0.7.3/configure.ac
+===================================================================
+--- apt-0.7.3.orig/configure.ac	2007-07-01 10:38:45.000000000 +0000
++++ apt-0.7.3/configure.ac	2007-08-21 13:39:26.000000000 +0000
+@@ -67,8 +67,20 @@
+       [AC_DEFINE(HAVE_BDB)
+        BDBLIB="-ldb"
+        AC_MSG_RESULT(yes)],
+-      [BDBLIB=""
+-       AC_MSG_RESULT(no)]
++
++       LIBS="$LIBS -lpthread"
++       [AC_MSG_CHECKING(if we can link against BerkeleyDB with pthread)
++        AC_LINK_IFELSE(
++        [AC_LANG_PROGRAM(
++         [#include <db.h>],
++         [int r, s, t; db_version(&r, &s, &t);]
++        )],
++        [AC_DEFINE(HAVE_BDB)
++         BDBLIB="-ldb -lpthread"
++         AC_MSG_RESULT(yes)],
++        [BDBLIB=""
++         AC_MSG_RESULT(no)]
++      )]       
+     )]
+ )
+ 
diff --git a/meta/recipes-devtools/apt/files/environment.patch b/meta/recipes-devtools/apt/files/environment.patch
new file mode 100644
index 0000000..9a03038
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/environment.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport
+
+Index: apt-0.6.46.2/buildlib/environment.mak.in
+===================================================================
+--- apt-0.6.46.2.orig/buildlib/environment.mak.in	2007-03-29 11:38:58.000000000 +0100
++++ apt-0.6.46.2/buildlib/environment.mak.in	2007-03-29 11:39:12.000000000 +0100
+@@ -62,7 +62,7 @@
+ 
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter linux-gnu linux-gnueabi gnu% %gnu,$(HOST_OS))),0)
+    SONAME_MAGIC=-Wl,-soname -Wl,
+    LFLAGS_SO=
+ else
diff --git a/meta/recipes-devtools/apt/files/no-curl.patch b/meta/recipes-devtools/apt/files/no-curl.patch
new file mode 100644
index 0000000..30238fa
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/no-curl.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.in     |    6 ------
+ methods/makefile |    7 -------
+ 2 files changed, 13 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,12 +86,6 @@ AC_CHECK_HEADER(db.h,
+ 
+ LIBS="$saveLIBS"
+ 
+-AC_CHECK_LIB(curl, curl_easy_init,
+-     [AC_CHECK_HEADER(curl/curl.h,
+-        curl_ok=yes,
+-        curl_ok=no)],
+-     AC_MSG_ERROR([failed: I need CURL due https support]),
+-)
+ 
+ AC_SUBST(BDBLIB)
+ 
+--- a/methods/makefile
++++ b/methods/makefile
+@@ -51,13 +51,6 @@ LIB_MAKES = apt-pkg/makefile
+ SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc
+ include $(PROGRAM_H)
+ 
+-# The https method
+-PROGRAM=https
+-SLIBS = -lapt-pkg -lcurl $(INTLLIBS)
+-LIB_MAKES = apt-pkg/makefile
+-SOURCE = https.cc server.cc
+-include $(PROGRAM_H)
+-
+ # The ftp method
+ PROGRAM=ftp
+ SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)