// This file was generated by gir (https://github.com/gtk-rs/gir @ a6737c7) // from gir-files (https://github.com/gtk-rs/gir-files @ 826155b) // DO NOT EDIT extern crate package_kit_glib_sys; extern crate shell_words; extern crate tempfile; use std::env; use std::error::Error; use std::path::Path; use std::mem::{align_of, size_of}; use std::process::Command; use std::str; use tempfile::Builder; use package_kit_glib_sys::*; static PACKAGES: &[&str] = &["packagekit-glib2"]; #[derive(Clone, Debug)] struct Compiler { pub args: Vec, } impl Compiler { pub fn new() -> Result> { let mut args = get_var("CC", "cc")?; args.push("-Wno-deprecated-declarations".to_owned()); // For %z support in printf when using MinGW. args.push("-D__USE_MINGW_ANSI_STDIO".to_owned()); args.extend(get_var("CFLAGS", "")?); args.extend(get_var("CPPFLAGS", "")?); args.extend(pkg_config_cflags(PACKAGES)?); Ok(Compiler { args }) } pub fn define<'a, V: Into>>(&mut self, var: &str, val: V) { let arg = match val.into() { None => format!("-D{}", var), Some(val) => format!("-D{}={}", var, val), }; self.args.push(arg); } pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box> { let mut cmd = self.to_command(); cmd.arg(src); cmd.arg("-o"); cmd.arg(out); let status = cmd.spawn()?.wait()?; if !status.success() { return Err(format!("compilation command {:?} failed, {}", &cmd, status).into()); } Ok(()) } fn to_command(&self) -> Command { let mut cmd = Command::new(&self.args[0]); cmd.args(&self.args[1..]); cmd } } fn get_var(name: &str, default: &str) -> Result, Box> { match env::var(name) { Ok(value) => Ok(shell_words::split(&value)?), Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?), Err(err) => Err(format!("{} {}", name, err).into()), } } fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { if packages.is_empty() { return Ok(Vec::new()); } let mut cmd = Command::new("pkg-config"); cmd.arg("--cflags"); cmd.args(packages); let out = cmd.output()?; if !out.status.success() { return Err(format!("command {:?} returned {}", &cmd, out.status).into()); } let stdout = str::from_utf8(&out.stdout)?; Ok(shell_words::split(stdout.trim())?) } #[derive(Copy, Clone, Debug, Eq, PartialEq)] struct Layout { size: usize, alignment: usize, } #[derive(Copy, Clone, Debug, Default, Eq, PartialEq)] struct Results { /// Number of successfully completed tests. passed: usize, /// Total number of failed tests (including those that failed to compile). failed: usize, /// Number of tests that failed to compile. failed_to_compile: usize, } impl Results { fn record_passed(&mut self) { self.passed += 1; } fn record_failed(&mut self) { self.failed += 1; } fn record_failed_to_compile(&mut self) { self.failed += 1; self.failed_to_compile += 1; } fn summary(&self) -> String { format!( "{} passed; {} failed (compilation errors: {})", self.passed, self.failed, self.failed_to_compile) } fn expect_total_success(&self) { if self.failed == 0 { println!("OK: {}", self.summary()); } else { panic!("FAILED: {}", self.summary()); }; } } #[test] fn cross_validate_constants_with_c() { let tmpdir = Builder::new().prefix("abi").tempdir().expect("temporary directory"); let cc = Compiler::new().expect("configured compiler"); assert_eq!("1", get_c_value(tmpdir.path(), &cc, "1").expect("C constant"), "failed to obtain correct constant value for 1"); let mut results : Results = Default::default(); for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() { match get_c_value(tmpdir.path(), &cc, name) { Err(e) => { results.record_failed_to_compile(); eprintln!("{}", e); }, Ok(ref c_value) => { if rust_value == c_value { results.record_passed(); } else { results.record_failed(); eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}", name, rust_value, c_value); } } }; if (i + 1) % 25 == 0 { println!("constants ... {}", results.summary()); } } results.expect_total_success(); } #[test] fn cross_validate_layout_with_c() { let tmpdir = Builder::new().prefix("abi").tempdir().expect("temporary directory"); let cc = Compiler::new().expect("configured compiler"); assert_eq!(Layout {size: 1, alignment: 1}, get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"), "failed to obtain correct layout for char type"); let mut results : Results = Default::default(); for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() { match get_c_layout(tmpdir.path(), &cc, name) { Err(e) => { results.record_failed_to_compile(); eprintln!("{}", e); }, Ok(c_layout) => { if rust_layout == c_layout { results.record_passed(); } else { results.record_failed(); eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}", name, rust_layout, &c_layout); } } }; if (i + 1) % 25 == 0 { println!("layout ... {}", results.summary()); } } results.expect_total_success(); } fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result> { let exe = dir.join("layout"); let mut cc = cc.clone(); cc.define("ABI_TYPE_NAME", name); cc.compile(Path::new("tests/layout.c"), &exe)?; let mut abi_cmd = Command::new(exe); let output = abi_cmd.output()?; if !output.status.success() { return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into()); } let stdout = str::from_utf8(&output.stdout)?; let mut words = stdout.trim().split_whitespace(); let size = words.next().unwrap().parse().unwrap(); let alignment = words.next().unwrap().parse().unwrap(); Ok(Layout {size, alignment}) } fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result> { let exe = dir.join("constant"); let mut cc = cc.clone(); cc.define("ABI_CONSTANT_NAME", name); cc.compile(Path::new("tests/constant.c"), &exe)?; let mut abi_cmd = Command::new(exe); let output = abi_cmd.output()?; if !output.status.success() { return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into()); } let output = str::from_utf8(&output.stdout)?.trim(); if !output.starts_with("###gir test###") || !output.ends_with("###gir test###") { return Err(format!("command {:?} return invalid output, {:?}", &abi_cmd, &output).into()); } Ok(String::from(&output[14..(output.len() - 14)])) } const RUST_LAYOUTS: &[(&str, Layout)] = &[ ("PkAuthorizeEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkBitfield", Layout {size: size_of::(), alignment: align_of::()}), ("PkCategory", Layout {size: size_of::(), alignment: align_of::()}), ("PkCategoryClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkClient", Layout {size: size_of::(), alignment: align_of::()}), ("PkClientClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkClientError", Layout {size: size_of::(), alignment: align_of::()}), ("PkClientHelper", Layout {size: size_of::(), alignment: align_of::()}), ("PkClientHelperClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkControl", Layout {size: size_of::(), alignment: align_of::()}), ("PkControlClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkControlError", Layout {size: size_of::(), alignment: align_of::()}), ("PkDesktop", Layout {size: size_of::(), alignment: align_of::()}), ("PkDesktopClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkDetails", Layout {size: size_of::(), alignment: align_of::()}), ("PkDetailsClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkDistroUpgrade", Layout {size: size_of::(), alignment: align_of::()}), ("PkDistroUpgradeClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkDistroUpgradeEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkEnumMatch", Layout {size: size_of::(), alignment: align_of::()}), ("PkError", Layout {size: size_of::(), alignment: align_of::()}), ("PkErrorClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkErrorEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkEulaRequired", Layout {size: size_of::(), alignment: align_of::()}), ("PkEulaRequiredClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkExitEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkFiles", Layout {size: size_of::(), alignment: align_of::()}), ("PkFilesClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkFilterEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkGroupEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkInfoEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkItemProgress", Layout {size: size_of::(), alignment: align_of::()}), ("PkItemProgressClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkMediaChangeRequired", Layout {size: size_of::(), alignment: align_of::()}), ("PkMediaChangeRequiredClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkMediaTypeEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkNetworkEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkOfflineAction", Layout {size: size_of::(), alignment: align_of::()}), ("PkOfflineError", Layout {size: size_of::(), alignment: align_of::()}), ("PkPackage", Layout {size: size_of::(), alignment: align_of::()}), ("PkPackageClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkPackageSack", Layout {size: size_of::(), alignment: align_of::()}), ("PkPackageSackClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkPackageSackSortType", Layout {size: size_of::(), alignment: align_of::()}), ("PkProgress", Layout {size: size_of::(), alignment: align_of::()}), ("PkProgressClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkProgressType", Layout {size: size_of::(), alignment: align_of::()}), ("PkRepoDetail", Layout {size: size_of::(), alignment: align_of::()}), ("PkRepoDetailClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkRepoSignatureRequired", Layout {size: size_of::(), alignment: align_of::()}), ("PkRepoSignatureRequiredClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkRequireRestart", Layout {size: size_of::(), alignment: align_of::()}), ("PkRequireRestartClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkRestartEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkResults", Layout {size: size_of::(), alignment: align_of::()}), ("PkResultsClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkRoleEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkSigTypeEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkSource", Layout {size: size_of::(), alignment: align_of::()}), ("PkSourceClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkStatusEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkTask", Layout {size: size_of::(), alignment: align_of::()}), ("PkTaskClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkTransactionFlagEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkTransactionList", Layout {size: size_of::(), alignment: align_of::()}), ("PkTransactionListClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkTransactionPast", Layout {size: size_of::(), alignment: align_of::()}), ("PkTransactionPastClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkUpdateDetail", Layout {size: size_of::(), alignment: align_of::()}), ("PkUpdateDetailClass", Layout {size: size_of::(), alignment: align_of::()}), ("PkUpdateStateEnum", Layout {size: size_of::(), alignment: align_of::()}), ("PkUpgradeKindEnum", Layout {size: size_of::(), alignment: align_of::()}), ]; const RUST_CONSTANTS: &[(&str, &str)] = &[ ("(gint) PK_AUTHORIZE_ENUM_INTERACTIVE", "3"), ("(gint) PK_AUTHORIZE_ENUM_LAST", "4"), ("(gint) PK_AUTHORIZE_ENUM_NO", "2"), ("(gint) PK_AUTHORIZE_ENUM_UNKNOWN", "0"), ("(gint) PK_AUTHORIZE_ENUM_YES", "1"), ("(gint) PK_CLIENT_ERROR_ALREADY_TID", "3"), ("(gint) PK_CLIENT_ERROR_CANNOT_START_DAEMON", "5"), ("(gint) PK_CLIENT_ERROR_DECLINED_SIMULATION", "9"), ("(gint) PK_CLIENT_ERROR_FAILED", "0"), ("(gint) PK_CLIENT_ERROR_FAILED_AUTH", "1"), ("(gint) PK_CLIENT_ERROR_INVALID_FILE", "7"), ("(gint) PK_CLIENT_ERROR_INVALID_INPUT", "6"), ("(gint) PK_CLIENT_ERROR_LAST", "10"), ("(gint) PK_CLIENT_ERROR_NOT_SUPPORTED", "8"), ("(gint) PK_CLIENT_ERROR_NO_TID", "2"), ("(gint) PK_CLIENT_ERROR_ROLE_UNKNOWN", "4"), ("(gint) PK_CONTROL_ERROR_CANNOT_START_DAEMON", "1"), ("(gint) PK_CONTROL_ERROR_FAILED", "0"), ("PK_DBUS_INTERFACE", "org.freedesktop.PackageKit"), ("PK_DBUS_INTERFACE_OFFLINE", "org.freedesktop.PackageKit.Offline"), ("PK_DBUS_INTERFACE_TRANSACTION", "org.freedesktop.PackageKit.Transaction"), ("PK_DBUS_PATH", "/org/freedesktop/PackageKit"), ("PK_DBUS_SERVICE", "org.freedesktop.PackageKit"), ("PK_DESKTOP_DEFAULT_APPLICATION_DIR", "/usr/share/applications"), ("(gint) PK_DISTRO_UPGRADE_ENUM_LAST", "3"), ("(gint) PK_DISTRO_UPGRADE_ENUM_STABLE", "1"), ("(gint) PK_DISTRO_UPGRADE_ENUM_UNKNOWN", "0"), ("(gint) PK_DISTRO_UPGRADE_ENUM_UNSTABLE", "2"), ("(gint) PK_ERROR_ENUM_ALL_PACKAGES_ALREADY_INSTALLED", "41"), ("(gint) PK_ERROR_ENUM_BAD_GPG_SIGNATURE", "30"), ("(gint) PK_ERROR_ENUM_CANCELLED_PRIORITY", "65"), ("(gint) PK_ERROR_ENUM_CANNOT_CANCEL", "25"), ("(gint) PK_ERROR_ENUM_CANNOT_DISABLE_REPOSITORY", "54"), ("(gint) PK_ERROR_ENUM_CANNOT_FETCH_SOURCES", "64"), ("(gint) PK_ERROR_ENUM_CANNOT_GET_FILELIST", "52"), ("(gint) PK_ERROR_ENUM_CANNOT_GET_LOCK", "26"), ("(gint) PK_ERROR_ENUM_CANNOT_GET_REQUIRES", "53"), ("(gint) PK_ERROR_ENUM_CANNOT_INSTALL_REPO_UNSIGNED", "50"), ("(gint) PK_ERROR_ENUM_CANNOT_INSTALL_SOURCE_PACKAGE", "32"), ("(gint) PK_ERROR_ENUM_CANNOT_REMOVE_SYSTEM_PACKAGE", "20"), ("(gint) PK_ERROR_ENUM_CANNOT_UPDATE_REPO_UNSIGNED", "51"), ("(gint) PK_ERROR_ENUM_CANNOT_WRITE_REPO_CONFIG", "28"), ("(gint) PK_ERROR_ENUM_CREATE_THREAD_FAILED", "15"), ("(gint) PK_ERROR_ENUM_DEP_RESOLUTION_FAILED", "13"), ("(gint) PK_ERROR_ENUM_FAILED_CONFIG_PARSING", "24"), ("(gint) PK_ERROR_ENUM_FAILED_FINALISE", "23"), ("(gint) PK_ERROR_ENUM_FAILED_INITIALIZATION", "22"), ("(gint) PK_ERROR_ENUM_FILE_CONFLICTS", "35"), ("(gint) PK_ERROR_ENUM_FILE_NOT_FOUND", "42"), ("(gint) PK_ERROR_ENUM_FILTER_INVALID", "14"), ("(gint) PK_ERROR_ENUM_GPG_FAILURE", "5"), ("(gint) PK_ERROR_ENUM_GROUP_LIST_INVALID", "12"), ("(gint) PK_ERROR_ENUM_GROUP_NOT_FOUND", "11"), ("(gint) PK_ERROR_ENUM_INCOMPATIBLE_ARCHITECTURE", "45"), ("(gint) PK_ERROR_ENUM_INSTALL_ROOT_INVALID", "63"), ("(gint) PK_ERROR_ENUM_INTERNAL_ERROR", "4"), ("(gint) PK_ERROR_ENUM_INVALID_PACKAGE_FILE", "38"), ("(gint) PK_ERROR_ENUM_LAST", "69"), ("(gint) PK_ERROR_ENUM_LOCAL_INSTALL_FAILED", "29"), ("(gint) PK_ERROR_ENUM_LOCK_REQUIRED", "67"), ("(gint) PK_ERROR_ENUM_MEDIA_CHANGE_REQUIRED", "47"), ("(gint) PK_ERROR_ENUM_MISSING_GPG_SIGNATURE", "31"), ("(gint) PK_ERROR_ENUM_NOT_AUTHORIZED", "48"), ("(gint) PK_ERROR_ENUM_NOT_SUPPORTED", "3"), ("(gint) PK_ERROR_ENUM_NO_CACHE", "18"), ("(gint) PK_ERROR_ENUM_NO_DISTRO_UPGRADE_DATA", "44"), ("(gint) PK_ERROR_ENUM_NO_LICENSE_AGREEMENT", "34"), ("(gint) PK_ERROR_ENUM_NO_MORE_MIRRORS_TO_TRY", "43"), ("(gint) PK_ERROR_ENUM_NO_NETWORK", "2"), ("(gint) PK_ERROR_ENUM_NO_PACKAGES_TO_UPDATE", "27"), ("(gint) PK_ERROR_ENUM_NO_SPACE_ON_DEVICE", "46"), ("(gint) PK_ERROR_ENUM_OOM", "1"), ("(gint) PK_ERROR_ENUM_PACKAGE_ALREADY_INSTALLED", "9"), ("(gint) PK_ERROR_ENUM_PACKAGE_CONFLICTS", "36"), ("(gint) PK_ERROR_ENUM_PACKAGE_CORRUPT", "40"), ("(gint) PK_ERROR_ENUM_PACKAGE_DATABASE_CHANGED", "61"), ("(gint) PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED", "10"), ("(gint) PK_ERROR_ENUM_PACKAGE_FAILED_TO_BUILD", "57"), ("(gint) PK_ERROR_ENUM_PACKAGE_FAILED_TO_CONFIGURE", "56"), ("(gint) PK_ERROR_ENUM_PACKAGE_FAILED_TO_INSTALL", "58"), ("(gint) PK_ERROR_ENUM_PACKAGE_FAILED_TO_REMOVE", "59"), ("(gint) PK_ERROR_ENUM_PACKAGE_ID_INVALID", "6"), ("(gint) PK_ERROR_ENUM_PACKAGE_INSTALL_BLOCKED", "39"), ("(gint) PK_ERROR_ENUM_PACKAGE_NOT_FOUND", "8"), ("(gint) PK_ERROR_ENUM_PACKAGE_NOT_INSTALLED", "7"), ("(gint) PK_ERROR_ENUM_PROCESS_KILL", "21"), ("(gint) PK_ERROR_ENUM_PROVIDE_TYPE_NOT_SUPPORTED", "62"), ("(gint) PK_ERROR_ENUM_REPO_ALREADY_SET", "68"), ("(gint) PK_ERROR_ENUM_REPO_CONFIGURATION_ERROR", "33"), ("(gint) PK_ERROR_ENUM_REPO_NOT_AVAILABLE", "37"), ("(gint) PK_ERROR_ENUM_REPO_NOT_FOUND", "19"), ("(gint) PK_ERROR_ENUM_RESTRICTED_DOWNLOAD", "55"), ("(gint) PK_ERROR_ENUM_TRANSACTION_CANCELLED", "17"), ("(gint) PK_ERROR_ENUM_TRANSACTION_ERROR", "16"), ("(gint) PK_ERROR_ENUM_UNFINISHED_TRANSACTION", "66"), ("(gint) PK_ERROR_ENUM_UNKNOWN", "0"), ("(gint) PK_ERROR_ENUM_UPDATE_FAILED_DUE_TO_RUNNING_PROCESS", "60"), ("(gint) PK_ERROR_ENUM_UPDATE_NOT_FOUND", "49"), ("(gint) PK_EXIT_ENUM_CANCELLED", "3"), ("(gint) PK_EXIT_ENUM_CANCELLED_PRIORITY", "9"), ("(gint) PK_EXIT_ENUM_EULA_REQUIRED", "5"), ("(gint) PK_EXIT_ENUM_FAILED", "2"), ("(gint) PK_EXIT_ENUM_KEY_REQUIRED", "4"), ("(gint) PK_EXIT_ENUM_KILLED", "6"), ("(gint) PK_EXIT_ENUM_LAST", "12"), ("(gint) PK_EXIT_ENUM_MEDIA_CHANGE_REQUIRED", "7"), ("(gint) PK_EXIT_ENUM_NEED_UNTRUSTED", "8"), ("(gint) PK_EXIT_ENUM_REPAIR_REQUIRED", "11"), ("(gint) PK_EXIT_ENUM_SKIP_TRANSACTION", "10"), ("(gint) PK_EXIT_ENUM_SUCCESS", "1"), ("(gint) PK_EXIT_ENUM_UNKNOWN", "0"), ("(gint) PK_FILTER_ENUM_APPLICATION", "24"), ("(gint) PK_FILTER_ENUM_ARCH", "18"), ("(gint) PK_FILTER_ENUM_BASENAME", "14"), ("(gint) PK_FILTER_ENUM_COLLECTIONS", "22"), ("(gint) PK_FILTER_ENUM_DEVELOPMENT", "4"), ("(gint) PK_FILTER_ENUM_DOWNLOADED", "26"), ("(gint) PK_FILTER_ENUM_FREE", "8"), ("(gint) PK_FILTER_ENUM_GUI", "6"), ("(gint) PK_FILTER_ENUM_INSTALLED", "2"), ("(gint) PK_FILTER_ENUM_LAST", "28"), ("(gint) PK_FILTER_ENUM_NEWEST", "16"), ("(gint) PK_FILTER_ENUM_NONE", "1"), ("(gint) PK_FILTER_ENUM_NOT_APPLICATION", "25"), ("(gint) PK_FILTER_ENUM_NOT_ARCH", "19"), ("(gint) PK_FILTER_ENUM_NOT_BASENAME", "15"), ("(gint) PK_FILTER_ENUM_NOT_COLLECTIONS", "23"), ("(gint) PK_FILTER_ENUM_NOT_DEVELOPMENT", "5"), ("(gint) PK_FILTER_ENUM_NOT_DOWNLOADED", "27"), ("(gint) PK_FILTER_ENUM_NOT_FREE", "9"), ("(gint) PK_FILTER_ENUM_NOT_GUI", "7"), ("(gint) PK_FILTER_ENUM_NOT_INSTALLED", "3"), ("(gint) PK_FILTER_ENUM_NOT_NEWEST", "17"), ("(gint) PK_FILTER_ENUM_NOT_SOURCE", "21"), ("(gint) PK_FILTER_ENUM_NOT_SUPPORTED", "13"), ("(gint) PK_FILTER_ENUM_NOT_VISIBLE", "11"), ("(gint) PK_FILTER_ENUM_SOURCE", "20"), ("(gint) PK_FILTER_ENUM_SUPPORTED", "12"), ("(gint) PK_FILTER_ENUM_UNKNOWN", "0"), ("(gint) PK_FILTER_ENUM_VISIBLE", "10"), ("(gint) PK_GROUP_ENUM_ACCESSIBILITY", "1"), ("(gint) PK_GROUP_ENUM_ACCESSORIES", "2"), ("(gint) PK_GROUP_ENUM_ADMIN_TOOLS", "3"), ("(gint) PK_GROUP_ENUM_COLLECTIONS", "32"), ("(gint) PK_GROUP_ENUM_COMMUNICATION", "4"), ("(gint) PK_GROUP_ENUM_DESKTOP_GNOME", "5"), ("(gint) PK_GROUP_ENUM_DESKTOP_KDE", "6"), ("(gint) PK_GROUP_ENUM_DESKTOP_OTHER", "7"), ("(gint) PK_GROUP_ENUM_DESKTOP_XFCE", "8"), ("(gint) PK_GROUP_ENUM_DOCUMENTATION", "30"), ("(gint) PK_GROUP_ENUM_EDUCATION", "9"), ("(gint) PK_GROUP_ENUM_ELECTRONICS", "31"), ("(gint) PK_GROUP_ENUM_FONTS", "10"), ("(gint) PK_GROUP_ENUM_GAMES", "11"), ("(gint) PK_GROUP_ENUM_GRAPHICS", "12"), ("(gint) PK_GROUP_ENUM_INTERNET", "13"), ("(gint) PK_GROUP_ENUM_LAST", "35"), ("(gint) PK_GROUP_ENUM_LEGACY", "14"), ("(gint) PK_GROUP_ENUM_LOCALIZATION", "15"), ("(gint) PK_GROUP_ENUM_MAPS", "16"), ("(gint) PK_GROUP_ENUM_MULTIMEDIA", "17"), ("(gint) PK_GROUP_ENUM_NETWORK", "18"), ("(gint) PK_GROUP_ENUM_NEWEST", "34"), ("(gint) PK_GROUP_ENUM_OFFICE", "19"), ("(gint) PK_GROUP_ENUM_OTHER", "20"), ("(gint) PK_GROUP_ENUM_POWER_MANAGEMENT", "21"), ("(gint) PK_GROUP_ENUM_PROGRAMMING", "22"), ("(gint) PK_GROUP_ENUM_PUBLISHING", "23"), ("(gint) PK_GROUP_ENUM_REPOS", "24"), ("(gint) PK_GROUP_ENUM_SCIENCE", "29"), ("(gint) PK_GROUP_ENUM_SECURITY", "25"), ("(gint) PK_GROUP_ENUM_SERVERS", "26"), ("(gint) PK_GROUP_ENUM_SYSTEM", "27"), ("(gint) PK_GROUP_ENUM_UNKNOWN", "0"), ("(gint) PK_GROUP_ENUM_VENDOR", "33"), ("(gint) PK_GROUP_ENUM_VIRTUALIZATION", "28"), ("(gint) PK_INFO_ENUM_AVAILABLE", "2"), ("(gint) PK_INFO_ENUM_BLOCKED", "9"), ("(gint) PK_INFO_ENUM_BUGFIX", "6"), ("(gint) PK_INFO_ENUM_CLEANUP", "14"), ("(gint) PK_INFO_ENUM_COLLECTION_AVAILABLE", "17"), ("(gint) PK_INFO_ENUM_COLLECTION_INSTALLED", "16"), ("(gint) PK_INFO_ENUM_DECOMPRESSING", "22"), ("(gint) PK_INFO_ENUM_DOWNGRADING", "20"), ("(gint) PK_INFO_ENUM_DOWNLOADING", "10"), ("(gint) PK_INFO_ENUM_ENHANCEMENT", "4"), ("(gint) PK_INFO_ENUM_FINISHED", "18"), ("(gint) PK_INFO_ENUM_IMPORTANT", "7"), ("(gint) PK_INFO_ENUM_INSTALLED", "1"), ("(gint) PK_INFO_ENUM_INSTALLING", "12"), ("(gint) PK_INFO_ENUM_LAST", "26"), ("(gint) PK_INFO_ENUM_LOW", "3"), ("(gint) PK_INFO_ENUM_NORMAL", "5"), ("(gint) PK_INFO_ENUM_OBSOLETING", "15"), ("(gint) PK_INFO_ENUM_PREPARING", "21"), ("(gint) PK_INFO_ENUM_REINSTALLING", "19"), ("(gint) PK_INFO_ENUM_REMOVING", "13"), ("(gint) PK_INFO_ENUM_SECURITY", "8"), ("(gint) PK_INFO_ENUM_TRUSTED", "24"), ("(gint) PK_INFO_ENUM_UNAVAILABLE", "25"), ("(gint) PK_INFO_ENUM_UNKNOWN", "0"), ("(gint) PK_INFO_ENUM_UNTRUSTED", "23"), ("(gint) PK_INFO_ENUM_UPDATING", "11"), ("PK_MAJOR_VERSION", "1"), ("(gint) PK_MEDIA_TYPE_ENUM_CD", "1"), ("(gint) PK_MEDIA_TYPE_ENUM_DISC", "3"), ("(gint) PK_MEDIA_TYPE_ENUM_DVD", "2"), ("(gint) PK_MEDIA_TYPE_ENUM_LAST", "4"), ("(gint) PK_MEDIA_TYPE_ENUM_UNKNOWN", "0"), ("PK_MICRO_VERSION", "13"), ("PK_MINOR_VERSION", "1"), ("(gint) PK_NETWORK_ENUM_LAST", "6"), ("(gint) PK_NETWORK_ENUM_MOBILE", "5"), ("(gint) PK_NETWORK_ENUM_OFFLINE", "1"), ("(gint) PK_NETWORK_ENUM_ONLINE", "2"), ("(gint) PK_NETWORK_ENUM_UNKNOWN", "0"), ("(gint) PK_NETWORK_ENUM_WIFI", "4"), ("(gint) PK_NETWORK_ENUM_WIRED", "3"), ("(gint) PK_OFFLINE_ACTION_LAST", "4"), ("(gint) PK_OFFLINE_ACTION_POWER_OFF", "2"), ("(gint) PK_OFFLINE_ACTION_REBOOT", "1"), ("(gint) PK_OFFLINE_ACTION_UNKNOWN", "0"), ("(gint) PK_OFFLINE_ACTION_UNSET", "3"), ("PK_OFFLINE_DESTDIR", ""), ("(gint) PK_OFFLINE_ERROR_FAILED", "0"), ("(gint) PK_OFFLINE_ERROR_INVALID_VALUE", "1"), ("(gint) PK_OFFLINE_ERROR_LAST", "3"), ("(gint) PK_OFFLINE_ERROR_NO_DATA", "2"), ("PK_OFFLINE_RESULTS_GROUP", "PackageKit Offline Update Results"), ("PK_PACKAGE_IDS_DELIM", "&"), ("PK_PACKAGE_ID_ARCH", "2"), ("PK_PACKAGE_ID_DATA", "3"), ("PK_PACKAGE_ID_NAME", "0"), ("PK_PACKAGE_ID_VERSION", "1"), ("(gint) PK_PACKAGE_SACK_SORT_TYPE_INFO", "1"), ("(gint) PK_PACKAGE_SACK_SORT_TYPE_LAST", "4"), ("(gint) PK_PACKAGE_SACK_SORT_TYPE_NAME", "0"), ("(gint) PK_PACKAGE_SACK_SORT_TYPE_PACKAGE_ID", "2"), ("(gint) PK_PACKAGE_SACK_SORT_TYPE_SUMMARY", "3"), ("(gint) PK_PROGRESS_TYPE_ALLOW_CANCEL", "3"), ("(gint) PK_PROGRESS_TYPE_CALLER_ACTIVE", "6"), ("(gint) PK_PROGRESS_TYPE_DOWNLOAD_SIZE_REMAINING", "10"), ("(gint) PK_PROGRESS_TYPE_ELAPSED_TIME", "7"), ("(gint) PK_PROGRESS_TYPE_INVALID", "15"), ("(gint) PK_PROGRESS_TYPE_ITEM_PROGRESS", "13"), ("(gint) PK_PROGRESS_TYPE_PACKAGE", "12"), ("(gint) PK_PROGRESS_TYPE_PACKAGE_ID", "0"), ("(gint) PK_PROGRESS_TYPE_PERCENTAGE", "2"), ("(gint) PK_PROGRESS_TYPE_REMAINING_TIME", "8"), ("(gint) PK_PROGRESS_TYPE_ROLE", "5"), ("(gint) PK_PROGRESS_TYPE_SPEED", "9"), ("(gint) PK_PROGRESS_TYPE_STATUS", "4"), ("(gint) PK_PROGRESS_TYPE_TRANSACTION_FLAGS", "14"), ("(gint) PK_PROGRESS_TYPE_TRANSACTION_ID", "1"), ("(gint) PK_PROGRESS_TYPE_UID", "11"), ("(gint) PK_RESTART_ENUM_APPLICATION", "2"), ("(gint) PK_RESTART_ENUM_LAST", "7"), ("(gint) PK_RESTART_ENUM_NONE", "1"), ("(gint) PK_RESTART_ENUM_SECURITY_SESSION", "5"), ("(gint) PK_RESTART_ENUM_SECURITY_SYSTEM", "6"), ("(gint) PK_RESTART_ENUM_SESSION", "3"), ("(gint) PK_RESTART_ENUM_SYSTEM", "4"), ("(gint) PK_RESTART_ENUM_UNKNOWN", "0"), ("(gint) PK_ROLE_ENUM_ACCEPT_EULA", "24"), ("(gint) PK_ROLE_ENUM_CANCEL", "1"), ("(gint) PK_ROLE_ENUM_DEPENDS_ON", "2"), ("(gint) PK_ROLE_ENUM_DOWNLOAD_PACKAGES", "25"), ("(gint) PK_ROLE_ENUM_GET_CATEGORIES", "27"), ("(gint) PK_ROLE_ENUM_GET_DETAILS", "3"), ("(gint) PK_ROLE_ENUM_GET_DETAILS_LOCAL", "30"), ("(gint) PK_ROLE_ENUM_GET_DISTRO_UPGRADES", "26"), ("(gint) PK_ROLE_ENUM_GET_FILES", "4"), ("(gint) PK_ROLE_ENUM_GET_FILES_LOCAL", "31"), ("(gint) PK_ROLE_ENUM_GET_OLD_TRANSACTIONS", "28"), ("(gint) PK_ROLE_ENUM_GET_PACKAGES", "5"), ("(gint) PK_ROLE_ENUM_GET_REPO_LIST", "6"), ("(gint) PK_ROLE_ENUM_GET_UPDATES", "9"), ("(gint) PK_ROLE_ENUM_GET_UPDATE_DETAIL", "8"), ("(gint) PK_ROLE_ENUM_INSTALL_FILES", "10"), ("(gint) PK_ROLE_ENUM_INSTALL_PACKAGES", "11"), ("(gint) PK_ROLE_ENUM_INSTALL_SIGNATURE", "12"), ("(gint) PK_ROLE_ENUM_LAST", "34"), ("(gint) PK_ROLE_ENUM_REFRESH_CACHE", "13"), ("(gint) PK_ROLE_ENUM_REMOVE_PACKAGES", "14"), ("(gint) PK_ROLE_ENUM_REPAIR_SYSTEM", "29"), ("(gint) PK_ROLE_ENUM_REPO_ENABLE", "15"), ("(gint) PK_ROLE_ENUM_REPO_REMOVE", "32"), ("(gint) PK_ROLE_ENUM_REPO_SET_DATA", "16"), ("(gint) PK_ROLE_ENUM_REQUIRED_BY", "7"), ("(gint) PK_ROLE_ENUM_RESOLVE", "17"), ("(gint) PK_ROLE_ENUM_SEARCH_DETAILS", "18"), ("(gint) PK_ROLE_ENUM_SEARCH_FILE", "19"), ("(gint) PK_ROLE_ENUM_SEARCH_GROUP", "20"), ("(gint) PK_ROLE_ENUM_SEARCH_NAME", "21"), ("(gint) PK_ROLE_ENUM_UNKNOWN", "0"), ("(gint) PK_ROLE_ENUM_UPDATE_PACKAGES", "22"), ("(gint) PK_ROLE_ENUM_UPGRADE_SYSTEM", "33"), ("(gint) PK_ROLE_ENUM_WHAT_PROVIDES", "23"), ("(gint) PK_SIGTYPE_ENUM_GPG", "1"), ("(gint) PK_SIGTYPE_ENUM_LAST", "2"), ("(gint) PK_SIGTYPE_ENUM_UNKNOWN", "0"), ("(gint) PK_STATUS_ENUM_CANCEL", "19"), ("(gint) PK_STATUS_ENUM_CHECK_EXECUTABLE_FILES", "33"), ("(gint) PK_STATUS_ENUM_CHECK_LIBRARIES", "34"), ("(gint) PK_STATUS_ENUM_CLEANUP", "11"), ("(gint) PK_STATUS_ENUM_COMMIT", "16"), ("(gint) PK_STATUS_ENUM_COPY_FILES", "35"), ("(gint) PK_STATUS_ENUM_DEP_RESOLVE", "13"), ("(gint) PK_STATUS_ENUM_DOWNLOAD", "8"), ("(gint) PK_STATUS_ENUM_DOWNLOAD_CHANGELOG", "23"), ("(gint) PK_STATUS_ENUM_DOWNLOAD_FILELIST", "22"), ("(gint) PK_STATUS_ENUM_DOWNLOAD_GROUP", "24"), ("(gint) PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST", "21"), ("(gint) PK_STATUS_ENUM_DOWNLOAD_REPOSITORY", "20"), ("(gint) PK_STATUS_ENUM_DOWNLOAD_UPDATEINFO", "25"), ("(gint) PK_STATUS_ENUM_FINISHED", "18"), ("(gint) PK_STATUS_ENUM_GENERATE_PACKAGE_LIST", "29"), ("(gint) PK_STATUS_ENUM_INFO", "5"), ("(gint) PK_STATUS_ENUM_INSTALL", "9"), ("(gint) PK_STATUS_ENUM_LAST", "37"), ("(gint) PK_STATUS_ENUM_LOADING_CACHE", "27"), ("(gint) PK_STATUS_ENUM_OBSOLETE", "12"), ("(gint) PK_STATUS_ENUM_QUERY", "4"), ("(gint) PK_STATUS_ENUM_REFRESH_CACHE", "7"), ("(gint) PK_STATUS_ENUM_REMOVE", "6"), ("(gint) PK_STATUS_ENUM_REPACKAGING", "26"), ("(gint) PK_STATUS_ENUM_REQUEST", "17"), ("(gint) PK_STATUS_ENUM_RUNNING", "3"), ("(gint) PK_STATUS_ENUM_RUN_HOOK", "36"), ("(gint) PK_STATUS_ENUM_SCAN_APPLICATIONS", "28"), ("(gint) PK_STATUS_ENUM_SCAN_PROCESS_LIST", "32"), ("(gint) PK_STATUS_ENUM_SETUP", "2"), ("(gint) PK_STATUS_ENUM_SIG_CHECK", "14"), ("(gint) PK_STATUS_ENUM_TEST_COMMIT", "15"), ("(gint) PK_STATUS_ENUM_UNKNOWN", "0"), ("(gint) PK_STATUS_ENUM_UPDATE", "10"), ("(gint) PK_STATUS_ENUM_WAIT", "1"), ("(gint) PK_STATUS_ENUM_WAITING_FOR_AUTH", "31"), ("(gint) PK_STATUS_ENUM_WAITING_FOR_LOCK", "30"), ("PK_SYSTEM_PACKAGE_CACHE_FILENAME", "/var/lib/PackageKit/package-cache.db"), ("PK_SYSTEM_PACKAGE_LIST_FILENAME", "/var/lib/PackageKit/system.package-list"), ("(gint) PK_TRANSACTION_FLAG_ENUM_ALLOW_DOWNGRADE", "6"), ("(gint) PK_TRANSACTION_FLAG_ENUM_ALLOW_REINSTALL", "4"), ("(gint) PK_TRANSACTION_FLAG_ENUM_JUST_REINSTALL", "5"), ("(gint) PK_TRANSACTION_FLAG_ENUM_LAST", "7"), ("(gint) PK_TRANSACTION_FLAG_ENUM_NONE", "0"), ("(gint) PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD", "3"), ("(gint) PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED", "1"), ("(gint) PK_TRANSACTION_FLAG_ENUM_SIMULATE", "2"), ("(gint) PK_UPDATE_STATE_ENUM_LAST", "4"), ("(gint) PK_UPDATE_STATE_ENUM_STABLE", "1"), ("(gint) PK_UPDATE_STATE_ENUM_TESTING", "3"), ("(gint) PK_UPDATE_STATE_ENUM_UNKNOWN", "0"), ("(gint) PK_UPDATE_STATE_ENUM_UNSTABLE", "2"), ("(gint) PK_UPGRADE_KIND_ENUM_COMPLETE", "3"), ("(gint) PK_UPGRADE_KIND_ENUM_DEFAULT", "2"), ("(gint) PK_UPGRADE_KIND_ENUM_LAST", "4"), ("(gint) PK_UPGRADE_KIND_ENUM_MINIMAL", "1"), ("(gint) PK_UPGRADE_KIND_ENUM_UNKNOWN", "0"), ];