based on PackageKit 0.7.6 source code