[PackageKit-commit] packagekit: Branch 'master' - 9 commits

Richard Hughes hughsient at kemper.freedesktop.org
Wed Oct 15 00:08:12 PDT 2008


 backends/dummy/pk-backend-dummy.c |   46 ++
 libpackagekit/egg-obj-list.c      |   21 +
 libpackagekit/egg-obj-list.h      |    2 
 po/zh_CN.po                       |  690 +++++++++++++-------------------------
 src/Makefile.am                   |    4 
 src/pk-backend.c                  |    7 
 src/pk-post-trans.c               |  593 ++++++++++++++++++++++++++++++++
 src/pk-post-trans.h               |   59 +++
 src/pk-refresh.c                  |  630 ----------------------------------
 src/pk-refresh.h                  |   59 ---
 src/pk-transaction.c              |   32 -
 11 files changed, 971 insertions(+), 1172 deletions(-)

New commits:
commit b2811a97283e6f83e6c9fee7b4f1dbf38c3c4f9c
Author: 甘露(Lu Gan) <rhythm.gan at gmail.com>
Date:   Tue Oct 14 15:07:33 2008 +0000

    Update Chinese Simplified translation
    
    Transmitted-via: Transifex (translate.fedoraproject.org)

diff --git a/po/zh_CN.po b/po/zh_CN.po
index ef7e2a4..3019240 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -1,617 +1,411 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER
 # This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
-#
-#, fuzzy
+# 甘露(Gan Lu) <rhythm.gan at gmail.com>, 2008
+
+
 msgid ""
 msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
+"Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-10-13 17:25+0100\n"
-"PO-Revision-Date: 2008-04-19 21:40+0800\n"
-"Last-Translator: Chen Yu <jcomee at gmail.com>\n"
-"Language-Team: LANGUAGE <LL at li.org>\n"
+"POT-Creation-Date: 2008-10-11 04:21+0000\n"
+"PO-Revision-Date: 2008-10-11 18:36+0800\n"
+"Last-Translator: 甘露(Gan Lu) <rhythm.gan at gmail.com>\n"
+"Language-Team: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: ../client/pk-console.c:294
+#: ../policy/org.freedesktop.packagekit.policy.in.h:1
+msgid "Accept EULA"
+msgstr "接受最终用户协议"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:2
+msgid "Authentication is required to accept a EULA"
+msgstr "接受最终用户协议需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:3
+msgid "Authentication is required to change software source parameters"
+msgstr "改变软件源参数需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:4
+msgid "Authentication is required to install a local file"
+msgstr "安装本地文件需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:5
+msgid "Authentication is required to install a package"
+msgstr "安装包需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:6
+msgid "Authentication is required to install a security signature"
+msgstr "安装安全签名需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:7
+msgid "Authentication is required to refresh the package lists"
+msgstr "刷新包列表需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:8
+msgid "Authentication is required to remove packages"
+msgstr "删除包需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:9
+msgid "Authentication is required to rollback a transaction"
+msgstr "恢复到前一个事务需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:10
+msgid "Authentication is required to update all packages"
+msgstr "更新全部软件包需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:11
+msgid "Authentication is required to update packages"
+msgstr "更新包需要获得授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:12
+msgid "Change software source parameters"
+msgstr "更改软件源参数"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:13
+msgid "Further authentication is required to install an untrusted local file"
+msgstr "安装未获信任的本地文件要求通过进一步的授权"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:14
+msgid "Install local file"
+msgstr "安装本地文件"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:15
+msgid "Install package"
+msgstr "安装包"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:16
+msgid "Install security signature"
+msgstr "安装安全签名"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:17
+msgid "Install untrusted local file"
+msgstr "安装未获信任的本地文件"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:18
+msgid "Refresh package lists"
+msgstr "刷新包列表"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:19
+msgid "Remove package"
+msgstr "删除包"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:20
+msgid "Rollback to a previous transaction"
+msgstr "回溯到前一个事务"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:21
+msgid "Update all packages"
+msgstr "更新所有包"
+
+#: ../policy/org.freedesktop.packagekit.policy.in.h:22
+msgid "Update package"
+msgstr "更新包"
+
+#: ../client/pk-console.c:224
 msgid "Update detail"
 msgstr "更新细节"
 
-#: ../client/pk-console.c:511
+#: ../client/pk-console.c:425
 msgid "A system restart is required"
 msgstr "需要重启系统"
 
-#: ../client/pk-console.c:513
+#: ../client/pk-console.c:427
 msgid "A logout and login is required"
-msgstr "需要注销和登录"
+msgstr "需要注销并登录"
 
-#: ../client/pk-console.c:515
+#: ../client/pk-console.c:429
 msgid "An application restart is required"
 msgstr "需要重启应用程序"
 
-#: ../client/pk-console.c:608 ../client/pk-generate-pack.c:140
+#: ../client/pk-console.c:474
+#, c-format
+msgid "Please enter a number from 1 to %i: "
+msgstr "请输入从 1 到 %i 的数字:"
+
+#: ../client/pk-console.c:524
+msgid "Could not find a package match"
+msgstr "未能找到匹配的包"
+
+#: ../client/pk-console.c:538
 msgid "There are multiple package matches"
 msgstr "有多个匹配的包"
 
 #. find out what package the user wants to use
-#: ../client/pk-console.c:615 ../client/pk-generate-pack.c:147
+#: ../client/pk-console.c:545
 msgid "Please enter the package number: "
 msgstr "请输入包的号码"
 
-#: ../client/pk-console.c:649
-#, fuzzy
-msgid "Could not find package to install"
-msgstr "未能找到匹配的包"
+#: ../client/pk-console.c:561
+msgid "Could not find a package with that name to install, or package already installed"
+msgstr "未能找到该命名的包来安装,或包已经安装"
 
-#: ../client/pk-console.c:755
-#, fuzzy
-msgid "Could not find package to remove"
-msgstr "未能找到这个名字的包来删除"
+#: ../client/pk-console.c:643
+msgid "Could not find a package with that name to remove"
+msgstr "未能找到该命名的包来删除"
 
-#: ../client/pk-console.c:816
+#: ../client/pk-console.c:683
 msgid "The following packages have to be removed"
-msgstr "下面的包必须删除"
+msgstr "下列包必须删除"
 
 #. get user input
-#: ../client/pk-console.c:823
+#: ../client/pk-console.c:692
 msgid "Okay to remove additional packages?"
 msgstr "同意删除额外的包吗?"
 
-#: ../client/pk-console.c:827 ../client/pk-generate-pack.c:271
+#: ../client/pk-console.c:696
 msgid "Cancelled!"
-msgstr "已取消"
-
-#: ../client/pk-console.c:861
-#, fuzzy
-msgid "Could not find package to download"
-msgstr "未能找到匹配的包"
+msgstr "已取消!"
 
-#: ../client/pk-console.c:913
-#, fuzzy
-msgid "Could not find package to update"
-msgstr "未能找到匹配的包"
+#: ../client/pk-console.c:718
+msgid "Could not find a package with that name to update"
+msgstr "未能找到该命名的包来升级"
 
-#: ../client/pk-console.c:935
-#, fuzzy
-msgid "Could not find what packages require"
+#: ../client/pk-console.c:736
+msgid "Could not find what packages require this package"
 msgstr "未能找到是哪些包需要这个包"
 
-#: ../client/pk-console.c:956
-#, fuzzy
-msgid "Could not get dependencies for"
+#: ../client/pk-console.c:754
+msgid "Could not get dependencies for this package"
 msgstr "未能得到这个包的依赖"
 
-#: ../client/pk-console.c:977
-#, fuzzy
-msgid "Could not find details for"
-msgstr "未能找到这个包所包含的文件"
+#: ../client/pk-console.c:772
+msgid "Could not find details for this package"
+msgstr "未能找到该包的详细资料"
 
-#: ../client/pk-console.c:1000
+#: ../client/pk-console.c:790
+#, c-format
 msgid "Could not find the files for this package"
 msgstr "未能找到这个包所包含的文件"
 
-#: ../client/pk-console.c:1007
-#, fuzzy
-msgid "Could not get the file list"
-msgstr "未能找到这个包所包含的文件"
-
-#: ../client/pk-console.c:1026
-#, fuzzy
-msgid "Could not find the update details for"
-msgstr "未能找到这个包所包含的文件"
-
-#: ../client/pk-console.c:1087
+#: ../client/pk-console.c:870
 msgid "Package description"
 msgstr "包的描述"
 
-#: ../client/pk-console.c:1120
+#: ../client/pk-console.c:893
 msgid "Package files"
 msgstr "包中的文件"
 
-#: ../client/pk-console.c:1128
+#: ../client/pk-console.c:901
 msgid "No files"
 msgstr "无文件"
 
 #. get user input
-#: ../client/pk-console.c:1160
+#: ../client/pk-console.c:933
 msgid "Okay to import key?"
 msgstr "同意导入 key?"
 
-#: ../client/pk-console.c:1163
+#: ../client/pk-console.c:936
 msgid "Did not import key"
 msgstr "没有导入 key"
 
 #. get user input
-#: ../client/pk-console.c:1203
+#: ../client/pk-console.c:976
 msgid "Do you agree?"
 msgstr "您接受吗?"
 
-#: ../client/pk-console.c:1206
+#: ../client/pk-console.c:979
 msgid "Did not agree to licence, task will fail"
-msgstr "不接受许可,任务将终止"
+msgstr "不接受许可,任务将终止。"
 
-#: ../client/pk-console.c:1235
+#: ../client/pk-console.c:1008
 msgid "The daemon crashed mid-transaction!"
-msgstr ""
+msgstr "后台程序在事务处理中期崩溃了!"
 
 #. header
-#: ../client/pk-console.c:1288
+#: ../client/pk-console.c:1061
 msgid "PackageKit Console Interface"
 msgstr "PackageKit 控制台界面"
 
-#: ../client/pk-console.c:1288
+#: ../client/pk-console.c:1061
 msgid "Subcommands:"
-msgstr "子命令"
+msgstr "子命令:"
 
-#: ../client/pk-console.c:1401 ../client/pk-generate-pack.c:203
-#: ../client/pk-monitor.c:118 ../src/pk-main.c:195
+#: ../client/pk-console.c:1165
+#: ../client/pk-monitor.c:104
+#: ../src/pk-main.c:189
 msgid "Show extra debugging information"
 msgstr "显示额外的调试信息"
 
-#: ../client/pk-console.c:1403 ../client/pk-monitor.c:120
+#: ../client/pk-console.c:1167
+#: ../client/pk-monitor.c:106
 msgid "Show the program version and exit"
-msgstr "显示程序版本并退出"
+msgstr "显示本程序版本并退出"
 
-#: ../client/pk-console.c:1405
+#: ../client/pk-console.c:1169
 msgid "Set the filter, e.g. installed"
 msgstr "设置过滤器,比如,已安装的"
 
-#: ../client/pk-console.c:1407
+#: ../client/pk-console.c:1171
 msgid "Exit without waiting for actions to complete"
 msgstr "不等动作完成即退出"
 
-#: ../client/pk-console.c:1430
+#: ../client/pk-console.c:1194
 msgid "Could not connect to system DBUS."
-msgstr "未能链接系统 DBUS"
+msgstr "未能连接到系统 DBUS"
 
-#: ../client/pk-console.c:1525
-#, fuzzy
-msgid "You need to specify a search type, e.g. name"
-msgstr "您要求通过指定一个搜索类型"
-
-#: ../client/pk-console.c:1530 ../client/pk-console.c:1537
-#: ../client/pk-console.c:1544 ../client/pk-console.c:1551
-#: ../client/pk-console.c:1662 ../client/pk-console.c:1672
-#: ../client/pk-console.c:1679 ../client/pk-console.c:1686
+#: ../client/pk-console.c:1288
+#, c-format
+msgid "You need to specify a search type"
+msgstr "您需要指定一个搜索类型"
+
+#: ../client/pk-console.c:1293
+#: ../client/pk-console.c:1300
+#: ../client/pk-console.c:1307
+#: ../client/pk-console.c:1314
+#: ../client/pk-console.c:1421
+#: ../client/pk-console.c:1428
+#: ../client/pk-console.c:1435
+#: ../client/pk-console.c:1442
+#, c-format
 msgid "You need to specify a search term"
 msgstr "您需要指定一个搜索条件"
 
-#: ../client/pk-console.c:1556
+#: ../client/pk-console.c:1319
+#, c-format
 msgid "Invalid search type"
 msgstr "无效的搜索类型"
 
-#: ../client/pk-console.c:1561
+#: ../client/pk-console.c:1324
+#, c-format
 msgid "You need to specify a package or file to install"
 msgstr "您要指定一个包或文件来安装"
 
-#: ../client/pk-console.c:1568
+#: ../client/pk-console.c:1339
+#, c-format
 msgid "You need to specify a type, key_id and package_id"
 msgstr "您要通过指定一个类型,key_id 和 package_id"
 
-#: ../client/pk-console.c:1575
+#: ../client/pk-console.c:1346
+#, c-format
 msgid "You need to specify a package to remove"
-msgstr "您要通过指定一个包来删除"
+msgstr "您需要指定一个包来删除"
 
-#: ../client/pk-console.c:1581
-#, fuzzy
-msgid ""
-"You need to specify the destination directory and then the packages to "
-"download"
-msgstr "您要通过指定一个类型,key_id 和 package_id"
-
-#: ../client/pk-console.c:1586
-msgid "Directory not found"
-msgstr ""
-
-#: ../client/pk-console.c:1592
+#: ../client/pk-console.c:1353
+#, c-format
 msgid "You need to specify a eula-id"
 msgstr "你要指定一个 eula-id"
 
-#: ../client/pk-console.c:1608
+#: ../client/pk-console.c:1369
+#, c-format
 msgid "You need to specify a package name to resolve"
-msgstr "您要指定一个包的名字来解释"
+msgstr "您需要指定一个包的名字来解决"
 
-#: ../client/pk-console.c:1617 ../client/pk-console.c:1624
+#: ../client/pk-console.c:1376
+#: ../client/pk-console.c:1383
+#, c-format
 msgid "You need to specify a repo name"
-msgstr "您要指定一个库名"
+msgstr "您需要指定一个库名"
 
-#: ../client/pk-console.c:1631
+#: ../client/pk-console.c:1390
+#, c-format
 msgid "You need to specify a repo name/parameter and value"
-msgstr "您要指定一个库名/参数和值"
+msgstr "您需要指定一个库名/参数和值"
 
-#: ../client/pk-console.c:1644
+#: ../client/pk-console.c:1403
+#, c-format
 msgid "You need to specify a time term"
-msgstr "您要指定一个时间项目"
+msgstr "您需要指定一个时间项目"
 
-#: ../client/pk-console.c:1649
+#: ../client/pk-console.c:1408
+#, c-format
 msgid "You need to specify a correct role"
-msgstr "您要指定一个正确的角色"
+msgstr "您需要指定一个正确的角色"
 
-#: ../client/pk-console.c:1654
+#: ../client/pk-console.c:1413
+#, c-format
 msgid "Failed to get last time"
-msgstr "获取上一次失败"
+msgstr "无法获得上次运行时间"
 
-#: ../client/pk-console.c:1693
-#, fuzzy
+#: ../client/pk-console.c:1449
+#, c-format
 msgid "You need to specify a package to find the details for"
-msgstr "您要指定一个包来查找文件"
+msgstr "您需要指定一个包来查找相关细节"
 
-#: ../client/pk-console.c:1700
+#: ../client/pk-console.c:1456
+#, c-format
 msgid "You need to specify a package to find the files for"
 msgstr "您要指定一个包来查找文件"
 
-#: ../client/pk-console.c:1752
+#: ../client/pk-console.c:1503
 #, c-format
 msgid "Option '%s' not supported"
-msgstr "不支持 '%s'选项"
-
-#: ../client/pk-console.c:1765
-msgid "You don't have the necessary privileges for this operation"
-msgstr "您没有此操作所需的特权"
+msgstr "不支持 '%s' 选项"
 
-#: ../client/pk-console.c:1767
+#: ../client/pk-console.c:1514
 msgid "Command failed"
 msgstr "命令失败"
 
-#: ../client/pk-generate-pack.c:131
-msgid "Could not find a package match"
-msgstr "未能找到匹配的包"
-
-#: ../client/pk-generate-pack.c:161
-msgid "Downloading"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:205
-msgid "Set the filename of dependencies to be excluded"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:207
-msgid ""
-"The directory to put the pack file, or the current directory if ommitted"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:209
-msgid "The package to be put into the ServicePack"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:211
-msgid "Put all updates available in the ServicePack"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:230
-msgid "Neither option selected"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:237
-msgid "Both optiosn selected"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:269
-msgid "A pack with the same name already exists, do you want to overwrite it?"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:282
-#, fuzzy
-msgid "Failed to create directory"
-msgstr "获取上一次失败"
-
-#: ../client/pk-generate-pack.c:290
-#, fuzzy
-msgid "Failed to open package list"
-msgstr "获取上一次失败"
-
-#: ../client/pk-generate-pack.c:299
-#, fuzzy
-msgid "Resolving package name to remote object"
-msgstr "下面的包必须删除"
-
-#: ../client/pk-generate-pack.c:302
-#, c-format
-msgid "Failed to find package '%s': %s"
-msgstr ""
-
-#. generate the pack
-#: ../client/pk-generate-pack.c:317
-#, c-format
-msgid "Service pack to create: %s\n"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:323
-msgid "Done!"
-msgstr ""
-
-#: ../client/pk-generate-pack.c:325
-msgid "Failed"
-msgstr ""
+#: ../client/pk-console.c:1518
+msgid "You don't have the necessary privileges for this operation"
+msgstr "您没有此操作所需的特权"
 
-#: ../client/pk-import-specspo.c:185
-#, fuzzy
-msgid "Could not set database readonly"
-msgstr "未能打开数据库: %s"
+#: ../client/pk-monitor.c:117
+msgid "PackageKit Monitor"
+msgstr "PackageKit 监视器"
 
-#: ../client/pk-import-specspo.c:192
+#: ../client/pk-import-desktop.c:293
+#: ../client/pk-import-specspo.c:169
 #, c-format
 msgid "Could not open database: %s"
-msgstr "未能打开数据库: %s"
+msgstr "未能打开数据库: %s"
 
-#: ../client/pk-import-specspo.c:193
+#: ../client/pk-import-desktop.c:294
+#: ../client/pk-import-specspo.c:170
 msgid "You probably need to run this program as the root user"
 msgstr "您可能要以根用户身份来运行这个程序"
 
-#: ../client/pk-monitor.c:131
-msgid "PackageKit Monitor"
-msgstr "PackageKit 监视器"
-
-#: ../client/pk-tools-common.c:51
-#, c-format
-msgid "Please enter a number from 1 to %i: "
-msgstr "请输入的号码从 1 到 %i:"
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:300
-msgid "Getting package information..."
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:304
-#, c-format
-msgid "<span color='#%06x' underline='single' size='larger'>Run %s</span>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:308
-#: ../contrib/packagekit-plugin/src/contents.cpp:313
-#: ../contrib/packagekit-plugin/src/contents.cpp:336
-#: ../contrib/packagekit-plugin/src/contents.cpp:340
-#, c-format
-msgid "<big>%s</big>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:310
-#, c-format
-msgid ""
-"\n"
-"<small>Installed version: %s</small>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:316
-#, c-format
-msgid ""
-"\n"
-"<span color='#%06x' underline='single'>Run version %s now</span>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:321
-#, c-format
-msgid ""
-"\n"
-"<span color='#%06x' underline='single'>Run now</span>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:325
-#, c-format
-msgid ""
-"\n"
-"<span color='#%06x' underline='single'>Upgrade to version %s</span>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:330
-#, c-format
-msgid ""
-"<span color='#%06x' underline='single' size='larger'>Install %s Now</span>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:333
-#, c-format
-msgid ""
-"\n"
-"<small>Version: %s</small>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:337
-msgid ""
-"\n"
-"<small>No packages found for your system</small>"
-msgstr ""
-
-#: ../contrib/packagekit-plugin/src/contents.cpp:341
-msgid ""
-"\n"
-"<small>Installing...</small>"
-msgstr ""
-
-#: ../data/packagekit-catalog.xml.in.h:1
-#, fuzzy
-msgid "PackageKit Catalog"
-msgstr "PackageKit 监视器"
-
-#: ../data/packagekit-servicepack.xml.in.h:1
-#, fuzzy
-msgid "PackageKit Service Pack"
-msgstr "PackageKit 服务"
-
-#: ../data/packagekit-package-list.xml.in.h:1
-#, fuzzy
-msgid "PackageKit Package List"
-msgstr "PackageKit 监视器"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:1
-msgid "Accept EULA"
-msgstr "接受 EULA"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:2
-msgid "Authentication is required to accept a EULA"
-msgstr "接受 EULA 要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:3
-msgid "Authentication is required to change software source parameters"
-msgstr "改变软件源要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:4
-#, fuzzy
-msgid ""
-"Authentication is required to consider a key used for signing packages as "
-"trusted"
-msgstr "刷新包列表要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:5
-#, fuzzy
-msgid "Authentication is required to install a signed package"
-msgstr "安装软件要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:6
-#, fuzzy
-msgid "Authentication is required to install an untrusted package"
-msgstr "安装软件要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:7
-#, fuzzy
-msgid "Authentication is required to refresh the system sources"
-msgstr "刷新包列表要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:8
-msgid "Authentication is required to remove packages"
-msgstr "删除包要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:9
-msgid "Authentication is required to rollback a transaction"
-msgstr ""
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:10
-#, fuzzy
-msgid ""
-"Authentication is required to set the network proxy used for downloading "
-"packages"
-msgstr "删除包要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:11
-msgid "Authentication is required to update packages"
-msgstr "更新包要求通过验证"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:12
-msgid "Change software source parameters"
-msgstr "更改软件源参数"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:13
-msgid "Install local file"
-msgstr "安装本地文件"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:14
-#, fuzzy
-msgid "Install untrusted local file"
-msgstr "安装本地文件"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:15
-msgid "Refresh system sources"
-msgstr ""
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:16
-msgid "Remove package"
-msgstr "删除包"
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:17
-msgid "Rollback to a previous transaction"
-msgstr ""
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:18
-msgid "Set network proxy"
-msgstr ""
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:19
-msgid "Trust a key used for signing packages"
-msgstr ""
-
-#: ../policy/org.freedesktop.packagekit.policy.in.h:20
-#, fuzzy
-msgid "Update packages"
-msgstr "更新包"
-
-#: ../src/pk-main.c:85
+#: ../src/pk-main.c:83
 msgid "Startup failed due to security policies on this machine."
 msgstr "因为本机的安全策略导致启动失败"
 
-#: ../src/pk-main.c:86
+#: ../src/pk-main.c:84
 msgid "This can happen for two reasons:"
-msgstr "这可能有两个原因"
+msgstr "这可能有两个原因:"
 
-#: ../src/pk-main.c:87
+#: ../src/pk-main.c:85
 msgid "The correct user is not launching the executable (usually root)"
-msgstr ""
+msgstr "正确用户也无法启动该可执行程序(通常为根用户)"
 
-#: ../src/pk-main.c:88
-msgid ""
-"The org.freedesktop.PackageKit.conf file is not installed in the system /etc/"
-"dbus-1/system.d directory"
+#: ../src/pk-main.c:86
+msgid "The org.freedesktop.PackageKit.conf file is not installed in the system /etc/dbus-1/system.d directory"
 msgstr "文件 org.freedesktop.PackageKit.conf 没有被安装在系统的 /etc/ 中"
 
-#: ../src/pk-main.c:191
+#: ../src/pk-main.c:185
 msgid "Packaging backend to use, e.g. dummy"
-msgstr ""
+msgstr "可使用诸如虚拟打包后端"
 
-#: ../src/pk-main.c:193
+#: ../src/pk-main.c:187
 msgid "Daemonize and detach from the terminal"
-msgstr "后台进程和"
+msgstr "从终端中分离并后台化运行"
 
-#: ../src/pk-main.c:197
+#: ../src/pk-main.c:191
 msgid "Disable the idle timer"
 msgstr "关闭空闲计时器"
 
-#: ../src/pk-main.c:199
+#: ../src/pk-main.c:193
 msgid "Show version and exit"
 msgstr "显示版本后退出"
 
-#: ../src/pk-main.c:201
+#: ../src/pk-main.c:195
 msgid "Exit after a small delay"
 msgstr "稍微延迟再退出"
 
-#: ../src/pk-main.c:203
+#: ../src/pk-main.c:197
 msgid "Exit after the engine has loaded"
 msgstr "引擎加载后退出"
 
-#: ../src/pk-main.c:213
+#: ../src/pk-main.c:207
 msgid "PackageKit service"
 msgstr "PackageKit 服务"
 
-#: ../src/pk-main.c:249
+#: ../src/pk-main.c:233
 msgid "Cannot connect to the system bus"
-msgstr "未能链接系统总线"
+msgstr "未能连接到系统总线"
 
-#: ../src/pk-main.c:295
+#: ../src/pk-main.c:273
 #, c-format
 msgid "Error trying to start: %s\n"
-msgstr "尝试启动出错\n"
-
-#~ msgid "Authentication is required to install a local file"
-#~ msgstr "安装本地文件要求通过验证"
-
-#~ msgid "Authentication is required to install a security signature"
-#~ msgstr "安转安全签名要求通过验证"
-
-#~ msgid "Authentication is required to update all packages"
-#~ msgstr "更新全部包要求通过验证"
-
-#~ msgid "Install package"
-#~ msgstr "安装包"
-
-#~ msgid "Install security signature"
-#~ msgstr "安装安全签名"
-
-#~ msgid "Refresh package lists"
-#~ msgstr "刷新包列表"
-
-#~ msgid "Update all packages"
-#~ msgstr "更新所有包"
-
-#~ msgid ""
-#~ "Could not find a package with that name to install, or package already "
-#~ "installed"
-#~ msgstr "未能找到这个名字的包来安装,或包已经安装"
-
-#~ msgid "Could not find a package with that name to update"
-#~ msgstr "未能找到这个名字的包来升级"
-
-#~ msgid "Could not find a description for this package"
-#~ msgstr "未能找到这个包的描述"
+msgstr "出错当尝试启动:%s\n"
 
-#~ msgid "You need to specify a package to find the description for"
-#~ msgstr "您要指定一个包来查找描述"
commit 2a22350f6e6fa6484650914bed028ee027f7010b
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 14:30:31 2008 +0100

    trivial fix to the dummy backend

diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index d57bd6a..d750f7a 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -191,9 +191,9 @@ backend_get_files (PkBackend *backend, gchar **package_ids)
 
 	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
 
-	len = g_strv_length (_package_ids);
+	len = g_strv_length (package_ids);
 	for (i=0; i<len; i++) {
-		package_id = _package_ids[i];
+		package_id = package_ids[i];
 		if (egg_strequal (package_id, "powertop;1.8-1.fc8;i386;fedora"))
 			pk_backend_files (backend, package_id, "/usr/share/man/man1/boo;/usr/bin/xchat-gnome");
 		else if (egg_strequal (package_id, "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed"))
commit 97e102f1a39e9866ea1b7d3ae40346ae9e65bc64
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 13:41:30 2008 +0100

    trivial: don't warn when we finish twice, just return failure

diff --git a/src/pk-backend.c b/src/pk-backend.c
index a135cbf..2bb2660 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -1470,11 +1470,8 @@ pk_backend_finished (PkBackend *backend)
 	}
 
 	/* check we have not already finished */
-	if (backend->priv->finished) {
-		pk_backend_message (backend, PK_MESSAGE_ENUM_BACKEND_ERROR,
-				    "%s cannot request Finished more than once!", role_text);
+	if (backend->priv->finished)
 		return FALSE;
-	}
 
 	/* check we got a Package() else the UI will suck */
 	if (!backend->priv->set_error &&
commit 7579d416946feb5496fbe35a5ea8021135db463b
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 13:10:24 2008 +0100

    trivial: don't proxy status-changed and progress-changed in PkPostTransaction, use the backend directly

diff --git a/src/pk-post-trans.c b/src/pk-post-trans.c
index 4083132..d831734 100644
--- a/src/pk-post-trans.c
+++ b/src/pk-post-trans.c
@@ -54,13 +54,6 @@ struct PkPostTransPrivate
 	guint			 package_id;
 };
 
-enum {
-	PK_POST_TRANS_STATUS_CHANGED,
-	PK_POST_TRANS_PROGRESS_CHANGED,
-	PK_POST_TRANS_LAST_SIGNAL
-};
-
-static guint signals [PK_POST_TRANS_LAST_SIGNAL] = { 0 };
 G_DEFINE_TYPE (PkPostTrans, pk_post_trans, G_TYPE_OBJECT)
 
 /**
@@ -83,26 +76,6 @@ pk_post_trans_package_cb (PkBackend *backend, const PkPackageObj *obj, PkPostTra
 }
 
 /**
- * pk_post_trans_emit_status_changed:
- **/
-static void
-pk_post_trans_emit_status_changed (PkPostTrans *post, PkStatusEnum status)
-{
-	egg_debug ("emiting status-changed %s", pk_status_enum_to_text (status));
-	g_signal_emit (post, signals [PK_POST_TRANS_STATUS_CHANGED], 0, status);
-}
-
-/**
- * pk_post_trans_emit_progress_changed:
- **/
-static void
-pk_post_trans_emit_progress_changed (PkPostTrans *post, guint percentage)
-{
-	egg_debug ("emiting progress-changed %i", percentage);
-	g_signal_emit (post, signals [PK_POST_TRANS_PROGRESS_CHANGED], 0, percentage, 0, 0, 0);
-}
-
-/**
  * pk_import_get_locale:
  **/
 static gchar *
@@ -378,7 +351,7 @@ pk_post_trans_import_desktop_files (PkPostTrans *post)
 
 	/* use a local backend instance */
 	pk_backend_reset (post->priv->backend);
-	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_SCAN_APPLICATIONS);
+	pk_backend_set_status (post->priv->backend, PK_STATUS_ENUM_SCAN_APPLICATIONS);
 
 	egg_debug ("getting old desktop mtimes");
 	mtimes_old = egg_string_list_new ();
@@ -402,7 +375,7 @@ pk_post_trans_import_desktop_files (PkPostTrans *post)
 	}
 
 	/* update UI */
-	pk_post_trans_emit_progress_changed (post, 0);
+	pk_backend_set_percentage (post->priv->backend, 0);
 	step = 100.0f / EGG_OBJ_LIST(mtimes)->len;
 
 	/* for each new package, process the desktop file */
@@ -424,7 +397,7 @@ pk_post_trans_import_desktop_files (PkPostTrans *post)
 		g_free (filename);
 
 		/* update UI */
-		pk_post_trans_emit_progress_changed (post, i * step);
+		pk_backend_set_percentage (post->priv->backend, i * step);
 	}
 
 	/* save new mtimes data */
@@ -434,8 +407,8 @@ pk_post_trans_import_desktop_files (PkPostTrans *post)
 
 no_changes:
 	/* update UI */
-	pk_post_trans_emit_progress_changed (post, 100);
-	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_FINISHED);
+	pk_backend_set_percentage (post->priv->backend, 100);
+	pk_backend_set_status (post->priv->backend, PK_STATUS_ENUM_FINISHED);
 
 	g_object_unref (files);
 	g_object_unref (mtimes);
@@ -464,8 +437,8 @@ pk_post_trans_update_package_list (PkPostTrans *post)
 	pk_package_list_clear (post->priv->list);
 
 	/* update UI */
-	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_GENERATE_PACKAGE_LIST);
-	pk_post_trans_emit_progress_changed (post, 101);
+	pk_backend_set_status (post->priv->backend, PK_STATUS_ENUM_GENERATE_PACKAGE_LIST);
+	pk_backend_set_percentage (post->priv->backend, 101);
 
 	/* get the new package list */
 	pk_backend_reset (post->priv->backend);
@@ -476,7 +449,7 @@ pk_post_trans_update_package_list (PkPostTrans *post)
 	g_main_loop_run (post->priv->loop);
 
 	/* update UI */
-	pk_post_trans_emit_progress_changed (post, 90);
+	pk_backend_set_percentage (post->priv->backend, 90);
 
 	/* convert to a file */
 	ret = pk_package_list_to_file (post->priv->list, PK_SYSTEM_PACKAGE_LIST_FILENAME);
@@ -484,8 +457,8 @@ pk_post_trans_update_package_list (PkPostTrans *post)
 		egg_warning ("failed to save to file");
 
 	/* update UI */
-	pk_post_trans_emit_progress_changed (post, 100);
-	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_FINISHED);
+	pk_backend_set_percentage (post->priv->backend, 100);
+	pk_backend_set_status (post->priv->backend, PK_STATUS_ENUM_FINISHED);
 
 	return ret;
 }
@@ -545,16 +518,6 @@ pk_post_trans_class_init (PkPostTransClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 	object_class->finalize = pk_post_trans_finalize;
-	signals [PK_POST_TRANS_STATUS_CHANGED] =
-		g_signal_new ("status-changed",
-			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL, g_cclosure_marshal_VOID__UINT,
-			      G_TYPE_NONE, 1, G_TYPE_UINT);
-	signals [PK_POST_TRANS_PROGRESS_CHANGED] =
-		g_signal_new ("progress-changed",
-			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL, pk_marshal_VOID__UINT_UINT_UINT_UINT,
-			      G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
 	g_type_class_add_private (klass, sizeof (PkPostTransPrivate));
 }
 
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index f95e71c..0b249c7 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -566,20 +566,15 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 	}
 
 	/* disconnect these straight away, as the PkTransaction object takes time to timeout */
-	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_allow_cancel);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_details);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_error_code);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_files);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_distro_upgrade);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_finished);
-	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_message);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_package);
-	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_progress_changed);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_repo_detail);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_repo_signature_required);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_eula_required);
-	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_require_restart);
-	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_status_changed);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_update_detail);
 	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_category);
 
@@ -601,6 +596,13 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 		pk_post_trans_clear_firmware_requests (transaction->priv->post_trans);
 	}
 
+	/* signals we are allowed to send from a post transaction */
+	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_allow_cancel);
+	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_message);
+	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_status_changed);
+	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_progress_changed);
+	g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_require_restart);
+
 	/* if we did not send this, ensure the GUI has the right state */
 	if (transaction->priv->allow_cancel)
 		pk_transaction_allow_cancel_emit (transaction, FALSE);
@@ -3659,12 +3661,7 @@ pk_transaction_init (PkTransaction *transaction)
 	transaction->priv->inhibit = pk_inhibit_new ();
 	transaction->priv->package_list = pk_package_list_new ();
 	transaction->priv->transaction_list = pk_transaction_list_new ();
-
 	transaction->priv->post_trans = pk_post_trans_new ();
-	g_signal_connect (transaction->priv->post_trans, "status-changed",
-			  G_CALLBACK (pk_transaction_status_changed_cb), transaction);
-	g_signal_connect (transaction->priv->post_trans, "progress-changed",
-			  G_CALLBACK (pk_transaction_progress_changed_cb), transaction);
 
 	transaction->priv->transaction_db = pk_transaction_db_new ();
 	g_signal_connect (transaction->priv->transaction_db, "transaction",
commit 10e7014d31a84a6cc828a006b13528a41a45fd24
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 12:59:16 2008 +0100

    trivial: make PkPostTrans an object in PkTransaction

diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 784e398..f95e71c 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -102,6 +102,7 @@ struct PkTransactionPrivate
 	PkUpdateDetailList	*update_detail_list;
 	PkNotify		*notify;
 	PkSecurity		*security;
+	PkPostTrans		*post_trans;
 
 	/* needed for gui coldplugging */
 	gchar			*last_package_id;
@@ -585,27 +586,19 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 	/* do some optional extra actions when we've finished refreshing the cache */
 	if (exit == PK_EXIT_ENUM_SUCCESS &&
 	    transaction->priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
-		PkPostTrans *post_trans;
-		post_trans = pk_post_trans_new ();
-
-		g_signal_connect (post_trans, "status-changed",
-				  G_CALLBACK (pk_transaction_status_changed_cb), transaction);
-		g_signal_connect (post_trans, "progress-changed",
-				  G_CALLBACK (pk_transaction_progress_changed_cb), transaction);
 
 		/* generate the package list */
 		ret = pk_conf_get_bool (transaction->priv->conf, "RefreshCacheUpdatePackageList");
 		if (ret)
-			pk_post_trans_update_package_list (post_trans);
+			pk_post_trans_update_package_list (transaction->priv->post_trans);
 
 		/* refresh the desktop icon cache */
 		ret = pk_conf_get_bool (transaction->priv->conf, "RefreshCacheScanDesktopFiles");
 		if (ret)
-			pk_post_trans_import_desktop_files (post_trans);
+			pk_post_trans_import_desktop_files (transaction->priv->post_trans);
 
 		/* clear the firmware requests directory */
-		pk_post_trans_clear_firmware_requests (post_trans);
-		g_object_unref (post_trans);
+		pk_post_trans_clear_firmware_requests (transaction->priv->post_trans);
 	}
 
 	/* if we did not send this, ensure the GUI has the right state */
@@ -3666,6 +3659,13 @@ pk_transaction_init (PkTransaction *transaction)
 	transaction->priv->inhibit = pk_inhibit_new ();
 	transaction->priv->package_list = pk_package_list_new ();
 	transaction->priv->transaction_list = pk_transaction_list_new ();
+
+	transaction->priv->post_trans = pk_post_trans_new ();
+	g_signal_connect (transaction->priv->post_trans, "status-changed",
+			  G_CALLBACK (pk_transaction_status_changed_cb), transaction);
+	g_signal_connect (transaction->priv->post_trans, "progress-changed",
+			  G_CALLBACK (pk_transaction_progress_changed_cb), transaction);
+
 	transaction->priv->transaction_db = pk_transaction_db_new ();
 	g_signal_connect (transaction->priv->transaction_db, "transaction",
 			  G_CALLBACK (pk_transaction_transaction_cb), transaction);
@@ -3720,6 +3720,7 @@ pk_transaction_finalize (GObject *object)
 	g_object_unref (transaction->priv->transaction_db);
 	g_object_unref (transaction->priv->security);
 	g_object_unref (transaction->priv->notify);
+	g_object_unref (transaction->priv->post_trans);
 
 	G_OBJECT_CLASS (pk_transaction_parent_class)->finalize (object);
 }
commit d595aba9949177493a896dc306f0a070776af423
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 12:54:52 2008 +0100

    trivial: rename PkRefresh to PkPostTrans as we're doing other actions too

diff --git a/src/Makefile.am b/src/Makefile.am
index bebee18..0e0d958 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -63,8 +63,8 @@ shared_SOURCES =					\
 	pk-network.h					\
 	pk-shared.c					\
 	pk-shared.h					\
-	pk-refresh.c					\
-	pk-refresh.h					\
+	pk-post-trans.c					\
+	pk-post-trans.h					\
 	pk-network-nm.h					\
 	pk-network-unix.c				\
 	pk-network-unix.h				\
diff --git a/src/pk-post-trans.c b/src/pk-post-trans.c
new file mode 100644
index 0000000..4083132
--- /dev/null
+++ b/src/pk-post-trans.c
@@ -0,0 +1,630 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <string.h>
+#include <glib.h>
+#include <glib/gi18n.h>
+
+#ifdef PK_BUILD_GIO
+  #include <gio/gio.h>
+#endif
+
+#include <pk-common.h>
+
+#include "egg-debug.h"
+#include "egg-string-list.h"
+
+#include "pk-post-trans.h"
+#include "pk-shared.h"
+#include "pk-extra.h"
+#include "pk-marshal.h"
+#include "pk-backend-internal.h"
+
+#define PK_POST_TRANS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_POST_TRANS, PkPostTransPrivate))
+
+struct PkPostTransPrivate
+{
+	PkBackend		*backend;
+	PkExtra			*extra;
+	GMainLoop		*loop;
+	PkPackageList		*list;
+	guint			 finished_id;
+	guint			 package_id;
+};
+
+enum {
+	PK_POST_TRANS_STATUS_CHANGED,
+	PK_POST_TRANS_PROGRESS_CHANGED,
+	PK_POST_TRANS_LAST_SIGNAL
+};
+
+static guint signals [PK_POST_TRANS_LAST_SIGNAL] = { 0 };
+G_DEFINE_TYPE (PkPostTrans, pk_post_trans, G_TYPE_OBJECT)
+
+/**
+ * pk_post_trans_finished_cb:
+ **/
+static void
+pk_post_trans_finished_cb (PkBackend *backend, PkExitEnum exit, PkPostTrans *post)
+{
+	if (g_main_loop_is_running (post->priv->loop))
+		g_main_loop_quit (post->priv->loop);
+}
+
+/**
+ * pk_post_trans_package_cb:
+ **/
+static void
+pk_post_trans_package_cb (PkBackend *backend, const PkPackageObj *obj, PkPostTrans *post)
+{
+	pk_package_list_add_obj (post->priv->list, obj);
+}
+
+/**
+ * pk_post_trans_emit_status_changed:
+ **/
+static void
+pk_post_trans_emit_status_changed (PkPostTrans *post, PkStatusEnum status)
+{
+	egg_debug ("emiting status-changed %s", pk_status_enum_to_text (status));
+	g_signal_emit (post, signals [PK_POST_TRANS_STATUS_CHANGED], 0, status);
+}
+
+/**
+ * pk_post_trans_emit_progress_changed:
+ **/
+static void
+pk_post_trans_emit_progress_changed (PkPostTrans *post, guint percentage)
+{
+	egg_debug ("emiting progress-changed %i", percentage);
+	g_signal_emit (post, signals [PK_POST_TRANS_PROGRESS_CHANGED], 0, percentage, 0, 0, 0);
+}
+
+/**
+ * pk_import_get_locale:
+ **/
+static gchar *
+pk_import_get_locale (const gchar *buffer)
+{
+	guint len;
+	gchar *locale;
+	gchar *result;
+	result = g_strrstr (buffer, "[");
+	if (result == NULL)
+		return NULL;
+	locale = g_strdup (result+1);
+	len = egg_strlen (locale, 20);
+	locale[len-1] = '\0';
+	return locale;
+}
+
+/**
+ * pk_post_trans_import_desktop_files_process_desktop:
+ **/
+static void
+pk_post_trans_import_desktop_files_process_desktop (PkPostTrans *post, const gchar *package_name, const gchar *filename)
+{
+	GKeyFile *key;
+	gboolean ret;
+	guint i;
+	gchar *name = NULL;
+	gchar *name_unlocalised = NULL;
+	gchar *exec = NULL;
+	gchar *icon = NULL;
+	gchar *comment = NULL;
+	gchar *genericname = NULL;
+	const gchar *locale = NULL;
+	gchar **key_array;
+	gsize len;
+	gchar *locale_temp;
+	static GPtrArray *locale_array = NULL;
+
+	key = g_key_file_new ();
+	ret = g_key_file_load_from_file (key, filename, G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
+	if (!ret) {
+		egg_warning ("cannot open desktop file %s", filename);
+		return;
+	}
+
+	/* get this specific locale list */
+	key_array = g_key_file_get_keys (key, G_KEY_FILE_DESKTOP_GROUP, &len, NULL);
+	locale_array = g_ptr_array_new ();
+	for (i=0; i<len; i++) {
+		if (g_str_has_prefix (key_array[i], "Name")) {
+			/* set the locale */
+			locale_temp = pk_import_get_locale (key_array[i]);
+			if (locale_temp != NULL)
+				g_ptr_array_add (locale_array, g_strdup (locale_temp));
+		}
+	}
+	g_strfreev (key_array);
+
+	/* make sure this is still set, as we are sharing PkExtra */
+	pk_extra_set_access (post->priv->extra, PK_EXTRA_ACCESS_WRITE_ONLY);
+
+	/* get the default entry */
+	name_unlocalised = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Name", NULL);
+	if (!egg_strzero (name_unlocalised)) {
+		pk_extra_set_locale (post->priv->extra, "C");
+		pk_extra_set_data_locale (post->priv->extra, package_name, name_unlocalised);
+	}
+
+	/* for each locale */
+	for (i=0; i<locale_array->len; i++) {
+		locale = g_ptr_array_index (locale_array, i);
+		/* compare the translated against the default */
+		name = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP, "Name", locale, NULL);
+
+		/* if different, then save */
+		if (egg_strequal (name_unlocalised, name) == FALSE) {
+			comment = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP,
+								"Comment", locale, NULL);
+			genericname = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP,
+								    "GenericName", locale, NULL);
+			pk_extra_set_locale (post->priv->extra, locale);
+
+			/* save in order of priority */
+			if (comment != NULL)
+				pk_extra_set_data_locale (post->priv->extra, package_name, comment);
+			else if (genericname != NULL)
+				pk_extra_set_data_locale (post->priv->extra, package_name, genericname);
+			else
+				pk_extra_set_data_locale (post->priv->extra, package_name, name);
+			g_free (comment);
+			g_free (genericname);
+		}
+		g_free (name);
+	}
+	g_ptr_array_foreach (locale_array, (GFunc) g_free, NULL);
+	g_ptr_array_free (locale_array, TRUE);
+	g_free (name_unlocalised);
+
+	exec = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Exec", NULL);
+	icon = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Icon", NULL);
+	pk_extra_set_data_package (post->priv->extra, package_name, icon, exec);
+	g_free (icon);
+	g_free (exec);
+
+	g_key_file_free (key);
+}
+
+/**
+ * pk_post_trans_import_desktop_files_get_package:
+ **/
+static gchar *
+pk_post_trans_import_desktop_files_get_package (PkPostTrans *post, const gchar *filename)
+{
+	guint size;
+	gchar *name = NULL;
+	const PkPackageObj *obj;
+	PkStore *store;
+
+	/* use PK to find the correct package */
+	pk_package_list_clear (post->priv->list);
+	pk_backend_reset (post->priv->backend);
+	store = pk_backend_get_store (post->priv->backend);
+	pk_store_set_uint (store, "filters", pk_bitfield_value (PK_FILTER_ENUM_INSTALLED));
+	pk_store_set_string (store, "search", filename);
+	post->priv->backend->desc->search_file (post->priv->backend, pk_bitfield_value (PK_FILTER_ENUM_INSTALLED), filename);
+
+	/* wait for finished */
+	g_main_loop_run (post->priv->loop);
+
+	/* check that we only matched one package */
+	size = pk_package_list_get_size (post->priv->list);
+	if (size != 1) {
+		egg_warning ("not correct size, %i", size);
+		goto out;
+	}
+
+	/* get the obj */
+	obj = pk_package_list_get_obj (post->priv->list, 0);
+	if (obj == NULL) {
+		egg_warning ("cannot get obj");
+		goto out;
+	}
+
+	/* strip the name */
+	name = g_strdup (obj->id->name);
+
+out:
+	return name;
+}
+
+/**
+ * pk_post_trans_import_desktop_files_get_files:
+ *
+ * Returns a list of all the files in the applicaitons directory
+ **/
+#ifdef PK_BUILD_GIO
+static guint
+pk_post_trans_get_filename_mtime (const gchar *filename)
+{
+	GFileInfo *info;
+	GFile *file;
+	GError *error = NULL;
+	GTimeVal time;
+
+	file = g_file_new_for_path (filename);
+	info = g_file_query_info (file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, &error);
+	if (info == NULL) {
+		egg_warning ("%s", error->message);
+		g_error_free (error);
+		return 0;
+	}
+
+	/* get the mtime */
+	g_file_info_get_modification_time (info, &time);
+	g_object_unref (file);
+	g_object_unref (info);
+
+	return time.tv_sec;
+}
+#else
+static guint
+pk_post_trans_get_filename_mtime (const gchar *filename)
+{
+	return 0;
+}
+#endif
+
+/**
+ * pk_post_trans_import_desktop_files_get_files:
+ *
+ * Returns a list of all the files in the applicaitons directory
+ **/
+static EggStringList *
+pk_post_trans_import_desktop_files_get_files (PkPostTrans *post)
+{
+	GDir *dir;
+	EggStringList *list;
+	GPatternSpec *pattern;
+	gchar *filename;
+	gboolean match;
+	const gchar *name;
+	const gchar *directory = "/usr/share/applications";
+
+	/* open directory */
+	dir = g_dir_open (directory, 0, NULL);
+	if (dir == NULL) {
+		egg_warning ("not a valid desktop dir!");
+		return NULL;
+	}
+
+	/* find files */
+	pattern = g_pattern_spec_new ("*.desktop");
+	name = g_dir_read_name (dir);
+	list = egg_string_list_new ();
+	while (name != NULL) {
+		/* ITS4: ignore, not used for allocation and has to be NULL terminated */
+		match = g_pattern_match (pattern, strlen (name), name, NULL);
+		if (match) {
+			filename = g_build_filename (directory, name, NULL);
+			egg_obj_list_add (EGG_OBJ_LIST (list), filename);
+		}
+		name = g_dir_read_name (dir);
+	}
+	g_dir_close (dir);
+
+	return list;
+}
+
+/**
+ * pk_post_trans_import_desktop_files_get_mtimes:
+ **/
+static EggStringList *
+pk_post_trans_import_desktop_files_get_mtimes (const EggStringList *files)
+{
+	guint i;
+	guint mtime;
+	gchar *encode;
+	const gchar *filename;
+	EggStringList *list;
+
+	list = egg_string_list_new ();
+	for (i=0; i<EGG_OBJ_LIST(files)->len; i++) {
+		filename = egg_string_list_index (files, i);
+		mtime = pk_post_trans_get_filename_mtime (filename);
+		encode = g_strdup_printf ("%s|%i|v1", filename, mtime);
+		egg_obj_list_add (EGG_OBJ_LIST (list), encode);
+		g_free (encode);
+	}
+	return list;
+}
+
+/**
+ * pk_post_trans_import_desktop_files:
+ **/
+gboolean
+pk_post_trans_import_desktop_files (PkPostTrans *post)
+{
+	guint i;
+	gboolean ret;
+	gchar *package_name;
+	gfloat step;
+	EggStringList *files;
+	EggStringList *mtimes;
+	EggStringList *mtimes_old;
+	gchar *filename;
+
+	g_return_val_if_fail (PK_IS_POST_TRANS (post), FALSE);
+
+	if (post->priv->backend->desc->search_file == NULL) {
+		egg_debug ("cannot search files");
+		return FALSE;
+	}
+
+	/* use a local backend instance */
+	pk_backend_reset (post->priv->backend);
+	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_SCAN_APPLICATIONS);
+
+	egg_debug ("getting old desktop mtimes");
+	mtimes_old = egg_string_list_new ();
+	ret = egg_obj_list_from_file (EGG_OBJ_LIST (mtimes_old), "/var/lib/PackageKit/desktop-mtimes.txt");
+	if (!ret)
+		egg_warning ("failed to get old mtimes of desktop files");
+
+	/* get the file list */
+	files = pk_post_trans_import_desktop_files_get_files (post);
+
+	/* get the mtimes */
+	mtimes = pk_post_trans_import_desktop_files_get_mtimes (files);
+
+	/* remove old desktop files we've already processed */
+	egg_obj_list_remove_list (EGG_OBJ_LIST(mtimes), EGG_OBJ_LIST (mtimes_old));
+
+	/* shortcut, there are no files to scan */
+	if (EGG_OBJ_LIST(mtimes)->len == 0) {
+		egg_debug ("no desktop files needed to scan");
+		goto no_changes;
+	}
+
+	/* update UI */
+	pk_post_trans_emit_progress_changed (post, 0);
+	step = 100.0f / EGG_OBJ_LIST(mtimes)->len;
+
+	/* for each new package, process the desktop file */
+	for (i=0; i<EGG_OBJ_LIST(mtimes)->len; i++) {
+
+		/* get the filename from the mtime encoded string */
+		filename = g_strdup (egg_string_list_index (mtimes, i));
+		g_strdelimit (filename, "|", '\0');
+
+		/* get the name */
+		package_name = pk_post_trans_import_desktop_files_get_package (post, filename);
+
+		/* process the file */
+		if (package_name != NULL)
+			pk_post_trans_import_desktop_files_process_desktop (post, package_name, filename);
+		else
+			egg_warning ("%s ignored, failed to get package name\n", filename);
+		g_free (package_name);
+		g_free (filename);
+
+		/* update UI */
+		pk_post_trans_emit_progress_changed (post, i * step);
+	}
+
+	/* save new mtimes data */
+	ret = egg_obj_list_to_file (EGG_OBJ_LIST (mtimes), "/var/lib/PackageKit/desktop-mtimes.txt");
+	if (!ret)
+		egg_warning ("failed to set old mtimes of desktop files");
+
+no_changes:
+	/* update UI */
+	pk_post_trans_emit_progress_changed (post, 100);
+	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_FINISHED);
+
+	g_object_unref (files);
+	g_object_unref (mtimes);
+	g_object_unref (mtimes_old);
+	return TRUE;
+}
+
+/**
+ * pk_post_trans_update_package_list:
+ **/
+gboolean
+pk_post_trans_update_package_list (PkPostTrans *post)
+{
+	gboolean ret;
+
+	g_return_val_if_fail (PK_IS_POST_TRANS (post), FALSE);
+
+	if (post->priv->backend->desc->get_packages == NULL) {
+		egg_debug ("cannot get packages");
+		return FALSE;
+	}
+
+	egg_debug ("updating package lists");
+
+	/* clear old list */
+	pk_package_list_clear (post->priv->list);
+
+	/* update UI */
+	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_GENERATE_PACKAGE_LIST);
+	pk_post_trans_emit_progress_changed (post, 101);
+
+	/* get the new package list */
+	pk_backend_reset (post->priv->backend);
+	pk_store_set_uint (pk_backend_get_store (post->priv->backend), "filters", pk_bitfield_value (PK_FILTER_ENUM_NONE));
+	post->priv->backend->desc->get_packages (post->priv->backend, PK_FILTER_ENUM_NONE);
+
+	/* wait for finished */
+	g_main_loop_run (post->priv->loop);
+
+	/* update UI */
+	pk_post_trans_emit_progress_changed (post, 90);
+
+	/* convert to a file */
+	ret = pk_package_list_to_file (post->priv->list, PK_SYSTEM_PACKAGE_LIST_FILENAME);
+	if (!ret)
+		egg_warning ("failed to save to file");
+
+	/* update UI */
+	pk_post_trans_emit_progress_changed (post, 100);
+	pk_post_trans_emit_status_changed (post, PK_STATUS_ENUM_FINISHED);
+
+	return ret;
+}
+
+/**
+ * pk_post_trans_clear_firmware_requests:
+ **/
+gboolean
+pk_post_trans_clear_firmware_requests (PkPostTrans *post)
+{
+	gboolean ret;
+	gchar *filename;
+
+	g_return_val_if_fail (PK_IS_POST_TRANS (post), FALSE);
+
+	/* clear the firmware requests directory */
+	filename = g_build_filename (LOCALSTATEDIR, "run", "PackageKit", "udev", NULL);
+	egg_debug ("clearing udev firmware requests at %s", filename);
+	ret = pk_directory_remove_contents (filename);
+	if (!ret)
+		egg_warning ("failed to clear %s", filename);
+	g_free (filename);
+	return ret;
+}
+
+/**
+ * pk_post_trans_finalize:
+ **/
+static void
+pk_post_trans_finalize (GObject *object)
+{
+	PkPostTrans *post;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (PK_IS_POST_TRANS (object));
+	post = PK_POST_TRANS (object);
+
+	g_signal_handler_disconnect (post->priv->backend, post->priv->finished_id);
+	g_signal_handler_disconnect (post->priv->backend, post->priv->package_id);
+
+	if (g_main_loop_is_running (post->priv->loop))
+		g_main_loop_quit (post->priv->loop);
+	g_main_loop_unref (post->priv->loop);
+
+	g_object_unref (post->priv->backend);
+	g_object_unref (post->priv->extra);
+	g_object_unref (post->priv->list);
+
+	G_OBJECT_CLASS (pk_post_trans_parent_class)->finalize (object);
+}
+
+/**
+ * pk_post_trans_class_init:
+ **/
+static void
+pk_post_trans_class_init (PkPostTransClass *klass)
+{
+	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	object_class->finalize = pk_post_trans_finalize;
+	signals [PK_POST_TRANS_STATUS_CHANGED] =
+		g_signal_new ("status-changed",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      0, NULL, NULL, g_cclosure_marshal_VOID__UINT,
+			      G_TYPE_NONE, 1, G_TYPE_UINT);
+	signals [PK_POST_TRANS_PROGRESS_CHANGED] =
+		g_signal_new ("progress-changed",
+			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+			      0, NULL, NULL, pk_marshal_VOID__UINT_UINT_UINT_UINT,
+			      G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
+	g_type_class_add_private (klass, sizeof (PkPostTransPrivate));
+}
+
+/**
+ * pk_post_trans_init:
+ *
+ * initializes the post_trans class. NOTE: We expect post_trans objects
+ * to *NOT* be removed or added during the session.
+ * We only control the first post_trans object if there are more than one.
+ **/
+static void
+pk_post_trans_init (PkPostTrans *post)
+{
+	gboolean ret;
+
+	post->priv = PK_POST_TRANS_GET_PRIVATE (post);
+	post->priv->loop = g_main_loop_new (NULL, FALSE);
+	post->priv->list = pk_package_list_new ();
+	post->priv->backend = pk_backend_new ();
+
+	post->priv->finished_id =
+		g_signal_connect (post->priv->backend, "finished",
+				  G_CALLBACK (pk_post_trans_finished_cb), post);
+	post->priv->package_id =
+		g_signal_connect (post->priv->backend, "package",
+				  G_CALLBACK (pk_post_trans_package_cb), post);
+
+	post->priv->extra = pk_extra_new ();
+	pk_extra_set_access (post->priv->extra, PK_EXTRA_ACCESS_WRITE_ONLY);
+
+	/* use the default location */
+	ret = pk_extra_set_database (post->priv->extra, NULL);
+	if (!ret)
+		egg_warning ("Could not open extra database");
+}
+
+/**
+ * pk_post_trans_new:
+ * Return value: A new post_trans class instance.
+ **/
+PkPostTrans *
+pk_post_trans_new (void)
+{
+	PkPostTrans *post;
+	post = g_object_new (PK_TYPE_POST_TRANS, NULL);
+	return PK_POST_TRANS (post);
+}
+
+/***************************************************************************
+ ***                          MAKE CHECK TESTS                           ***
+ ***************************************************************************/
+#ifdef EGG_TEST
+#include "egg-test.h"
+
+void
+egg_test_post_trans (EggTest *test)
+{
+	PkPostTrans *post;
+
+	if (!egg_test_start (test, "PkPostTrans"))
+		return;
+
+	/************************************************************/
+	egg_test_title (test, "get an instance");
+	post = pk_post_trans_new ();
+	egg_test_assert (test, post != NULL);
+
+	g_object_unref (post);
+
+	egg_test_end (test);
+}
+#endif
+
diff --git a/src/pk-post-trans.h b/src/pk-post-trans.h
new file mode 100644
index 0000000..de716e5
--- /dev/null
+++ b/src/pk-post-trans.h
@@ -0,0 +1,59 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __PK_POST_TRANS_H
+#define __PK_POST_TRANS_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define PK_TYPE_POST_TRANS		(pk_post_trans_get_type ())
+#define PK_POST_TRANS(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_POST_TRANS, PkPostTrans))
+#define PK_POST_TRANS_CLASS(k)		(G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_POST_TRANS, PkPostTransClass))
+#define PK_IS_POST_TRANS(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_POST_TRANS))
+#define PK_IS_POST_TRANS_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_POST_TRANS))
+#define PK_POST_TRANS_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_POST_TRANS, PkPostTransClass))
+
+typedef struct PkPostTransPrivate PkPostTransPrivate;
+
+typedef struct
+{
+	GObject		      parent;
+	PkPostTransPrivate     *priv;
+} PkPostTrans;
+
+typedef struct
+{
+	GObjectClass	parent_class;
+} PkPostTransClass;
+
+GType		 pk_post_trans_get_type			(void) G_GNUC_CONST;
+PkPostTrans	*pk_post_trans_new			(void);
+
+gboolean	 pk_post_trans_clear_firmware_requests	(PkPostTrans	*post);
+gboolean	 pk_post_trans_update_package_list	(PkPostTrans	*post);
+gboolean	 pk_post_trans_import_desktop_files	(PkPostTrans	*post);
+
+G_END_DECLS
+
+#endif /* __PK_POST_TRANS_H */
+
diff --git a/src/pk-refresh.c b/src/pk-refresh.c
deleted file mode 100644
index 0c14b67..0000000
--- a/src/pk-refresh.c
+++ /dev/null
@@ -1,630 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include <string.h>
-#include <glib.h>
-#include <glib/gi18n.h>
-
-#ifdef PK_BUILD_GIO
-  #include <gio/gio.h>
-#endif
-
-#include <pk-common.h>
-
-#include "egg-debug.h"
-#include "egg-string-list.h"
-
-#include "pk-refresh.h"
-#include "pk-shared.h"
-#include "pk-extra.h"
-#include "pk-marshal.h"
-#include "pk-backend-internal.h"
-
-#define PK_REFRESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_REFRESH, PkRefreshPrivate))
-
-struct PkRefreshPrivate
-{
-	PkBackend		*backend;
-	PkExtra			*extra;
-	GMainLoop		*loop;
-	PkPackageList		*list;
-	guint			 finished_id;
-	guint			 package_id;
-};
-
-enum {
-	PK_REFRESH_STATUS_CHANGED,
-	PK_REFRESH_PROGRESS_CHANGED,
-	PK_REFRESH_LAST_SIGNAL
-};
-
-static guint signals [PK_REFRESH_LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (PkRefresh, pk_refresh, G_TYPE_OBJECT)
-
-/**
- * pk_refresh_finished_cb:
- **/
-static void
-pk_refresh_finished_cb (PkBackend *backend, PkExitEnum exit, PkRefresh *refresh)
-{
-	if (g_main_loop_is_running (refresh->priv->loop))
-		g_main_loop_quit (refresh->priv->loop);
-}
-
-/**
- * pk_refresh_package_cb:
- **/
-static void
-pk_refresh_package_cb (PkBackend *backend, const PkPackageObj *obj, PkRefresh *refresh)
-{
-	pk_package_list_add_obj (refresh->priv->list, obj);
-}
-
-/**
- * pk_refresh_emit_status_changed:
- **/
-static void
-pk_refresh_emit_status_changed (PkRefresh *refresh, PkStatusEnum status)
-{
-	egg_debug ("emiting status-changed %s", pk_status_enum_to_text (status));
-	g_signal_emit (refresh, signals [PK_REFRESH_STATUS_CHANGED], 0, status);
-}
-
-/**
- * pk_refresh_emit_progress_changed:
- **/
-static void
-pk_refresh_emit_progress_changed (PkRefresh *refresh, guint percentage)
-{
-	egg_debug ("emiting progress-changed %i", percentage);
-	g_signal_emit (refresh, signals [PK_REFRESH_PROGRESS_CHANGED], 0, percentage, 0, 0, 0);
-}
-
-/**
- * pk_import_get_locale:
- **/
-static gchar *
-pk_import_get_locale (const gchar *buffer)
-{
-	guint len;
-	gchar *locale;
-	gchar *result;
-	result = g_strrstr (buffer, "[");
-	if (result == NULL)
-		return NULL;
-	locale = g_strdup (result+1);
-	len = egg_strlen (locale, 20);
-	locale[len-1] = '\0';
-	return locale;
-}
-
-/**
- * pk_refresh_import_desktop_files_process_desktop:
- **/
-static void
-pk_refresh_import_desktop_files_process_desktop (PkRefresh *refresh, const gchar *package_name, const gchar *filename)
-{
-	GKeyFile *key;
-	gboolean ret;
-	guint i;
-	gchar *name = NULL;
-	gchar *name_unlocalised = NULL;
-	gchar *exec = NULL;
-	gchar *icon = NULL;
-	gchar *comment = NULL;
-	gchar *genericname = NULL;
-	const gchar *locale = NULL;
-	gchar **key_array;
-	gsize len;
-	gchar *locale_temp;
-	static GPtrArray *locale_array = NULL;
-
-	key = g_key_file_new ();
-	ret = g_key_file_load_from_file (key, filename, G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
-	if (!ret) {
-		egg_warning ("cannot open desktop file %s", filename);
-		return;
-	}
-
-	/* get this specific locale list */
-	key_array = g_key_file_get_keys (key, G_KEY_FILE_DESKTOP_GROUP, &len, NULL);
-	locale_array = g_ptr_array_new ();
-	for (i=0; i<len; i++) {
-		if (g_str_has_prefix (key_array[i], "Name")) {
-			/* set the locale */
-			locale_temp = pk_import_get_locale (key_array[i]);
-			if (locale_temp != NULL)
-				g_ptr_array_add (locale_array, g_strdup (locale_temp));
-		}
-	}
-	g_strfreev (key_array);
-
-	/* make sure this is still set, as we are sharing PkExtra */
-	pk_extra_set_access (refresh->priv->extra, PK_EXTRA_ACCESS_WRITE_ONLY);
-
-	/* get the default entry */
-	name_unlocalised = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Name", NULL);
-	if (!egg_strzero (name_unlocalised)) {
-		pk_extra_set_locale (refresh->priv->extra, "C");
-		pk_extra_set_data_locale (refresh->priv->extra, package_name, name_unlocalised);
-	}
-
-	/* for each locale */
-	for (i=0; i<locale_array->len; i++) {
-		locale = g_ptr_array_index (locale_array, i);
-		/* compare the translated against the default */
-		name = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP, "Name", locale, NULL);
-
-		/* if different, then save */
-		if (egg_strequal (name_unlocalised, name) == FALSE) {
-			comment = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP,
-								"Comment", locale, NULL);
-			genericname = g_key_file_get_locale_string (key, G_KEY_FILE_DESKTOP_GROUP,
-								    "GenericName", locale, NULL);
-			pk_extra_set_locale (refresh->priv->extra, locale);
-
-			/* save in order of priority */
-			if (comment != NULL)
-				pk_extra_set_data_locale (refresh->priv->extra, package_name, comment);
-			else if (genericname != NULL)
-				pk_extra_set_data_locale (refresh->priv->extra, package_name, genericname);
-			else
-				pk_extra_set_data_locale (refresh->priv->extra, package_name, name);
-			g_free (comment);
-			g_free (genericname);
-		}
-		g_free (name);
-	}
-	g_ptr_array_foreach (locale_array, (GFunc) g_free, NULL);
-	g_ptr_array_free (locale_array, TRUE);
-	g_free (name_unlocalised);
-
-	exec = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Exec", NULL);
-	icon = g_key_file_get_string (key, G_KEY_FILE_DESKTOP_GROUP, "Icon", NULL);
-	pk_extra_set_data_package (refresh->priv->extra, package_name, icon, exec);
-	g_free (icon);
-	g_free (exec);
-
-	g_key_file_free (key);
-}
-
-/**
- * pk_refresh_import_desktop_files_get_package:
- **/
-static gchar *
-pk_refresh_import_desktop_files_get_package (PkRefresh *refresh, const gchar *filename)
-{
-	guint size;
-	gchar *name = NULL;
-	const PkPackageObj *obj;
-	PkStore *store;
-
-	/* use PK to find the correct package */
-	pk_package_list_clear (refresh->priv->list);
-	pk_backend_reset (refresh->priv->backend);
-	store = pk_backend_get_store (refresh->priv->backend);
-	pk_store_set_uint (store, "filters", pk_bitfield_value (PK_FILTER_ENUM_INSTALLED));
-	pk_store_set_string (store, "search", filename);
-	refresh->priv->backend->desc->search_file (refresh->priv->backend, pk_bitfield_value (PK_FILTER_ENUM_INSTALLED), filename);
-
-	/* wait for finished */
-	g_main_loop_run (refresh->priv->loop);
-
-	/* check that we only matched one package */
-	size = pk_package_list_get_size (refresh->priv->list);
-	if (size != 1) {
-		egg_warning ("not correct size, %i", size);
-		goto out;
-	}
-
-	/* get the obj */
-	obj = pk_package_list_get_obj (refresh->priv->list, 0);
-	if (obj == NULL) {
-		egg_warning ("cannot get obj");
-		goto out;
-	}
-
-	/* strip the name */
-	name = g_strdup (obj->id->name);
-
-out:
-	return name;
-}
-
-/**
- * pk_refresh_import_desktop_files_get_files:
- *
- * Returns a list of all the files in the applicaitons directory
- **/
-#ifdef PK_BUILD_GIO
-static guint
-pk_refresh_get_filename_mtime (const gchar *filename)
-{
-	GFileInfo *info;
-	GFile *file;
-	GError *error = NULL;
-	GTimeVal time;
-
-	file = g_file_new_for_path (filename);
-	info = g_file_query_info (file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, &error);
-	if (info == NULL) {
-		egg_warning ("%s", error->message);
-		g_error_free (error);
-		return 0;
-	}
-
-	/* get the mtime */
-	g_file_info_get_modification_time (info, &time);
-	g_object_unref (file);
-	g_object_unref (info);
-
-	return time.tv_sec;
-}
-#else
-static guint
-pk_refresh_get_filename_mtime (const gchar *filename)
-{
-	return 0;
-}
-#endif
-
-/**
- * pk_refresh_import_desktop_files_get_files:
- *
- * Returns a list of all the files in the applicaitons directory
- **/
-static EggStringList *
-pk_refresh_import_desktop_files_get_files (PkRefresh *refresh)
-{
-	GDir *dir;
-	EggStringList *list;
-	GPatternSpec *pattern;
-	gchar *filename;
-	gboolean match;
-	const gchar *name;
-	const gchar *directory = "/usr/share/applications";
-
-	/* open directory */
-	dir = g_dir_open (directory, 0, NULL);
-	if (dir == NULL) {
-		egg_warning ("not a valid desktop dir!");
-		return NULL;
-	}
-
-	/* find files */
-	pattern = g_pattern_spec_new ("*.desktop");
-	name = g_dir_read_name (dir);
-	list = egg_string_list_new ();
-	while (name != NULL) {
-		/* ITS4: ignore, not used for allocation and has to be NULL terminated */
-		match = g_pattern_match (pattern, strlen (name), name, NULL);
-		if (match) {
-			filename = g_build_filename (directory, name, NULL);
-			egg_obj_list_add (EGG_OBJ_LIST (list), filename);
-		}
-		name = g_dir_read_name (dir);
-	}
-	g_dir_close (dir);
-
-	return list;
-}
-
-/**
- * pk_refresh_import_desktop_files_get_mtimes:
- **/
-static EggStringList *
-pk_refresh_import_desktop_files_get_mtimes (const EggStringList *files)
-{
-	guint i;
-	guint mtime;
-	gchar *encode;
-	const gchar *filename;
-	EggStringList *list;
-
-	list = egg_string_list_new ();
-	for (i=0; i<EGG_OBJ_LIST(files)->len; i++) {
-		filename = egg_string_list_index (files, i);
-		mtime = pk_refresh_get_filename_mtime (filename);
-		encode = g_strdup_printf ("%s|%i|v1", filename, mtime);
-		egg_obj_list_add (EGG_OBJ_LIST (list), encode);
-		g_free (encode);
-	}
-	return list;
-}
-
-/**
- * pk_refresh_import_desktop_files:
- **/
-gboolean
-pk_refresh_import_desktop_files (PkRefresh *refresh)
-{
-	guint i;
-	gboolean ret;
-	gchar *package_name;
-	gfloat step;
-	EggStringList *files;
-	EggStringList *mtimes;
-	EggStringList *mtimes_old;
-	gchar *filename;
-
-	g_return_val_if_fail (PK_IS_REFRESH (refresh), FALSE);
-
-	if (refresh->priv->backend->desc->search_file == NULL) {
-		egg_debug ("cannot search files");
-		return FALSE;
-	}
-
-	/* use a local backend instance */
-	pk_backend_reset (refresh->priv->backend);
-	pk_refresh_emit_status_changed (refresh, PK_STATUS_ENUM_SCAN_APPLICATIONS);
-
-	egg_debug ("getting old desktop mtimes");
-	mtimes_old = egg_string_list_new ();
-	ret = egg_obj_list_from_file (EGG_OBJ_LIST (mtimes_old), "/var/lib/PackageKit/desktop-mtimes.txt");
-	if (!ret)
-		egg_warning ("failed to get old mtimes of desktop files");
-
-	/* get the file list */
-	files = pk_refresh_import_desktop_files_get_files (refresh);
-
-	/* get the mtimes */
-	mtimes = pk_refresh_import_desktop_files_get_mtimes (files);
-
-	/* remove old desktop files we've already processed */
-	egg_obj_list_remove_list (EGG_OBJ_LIST(mtimes), EGG_OBJ_LIST (mtimes_old));
-
-	/* shortcut, there are no files to scan */
-	if (EGG_OBJ_LIST(mtimes)->len == 0) {
-		egg_debug ("no desktop files needed to scan");
-		goto no_changes;
-	}
-
-	/* update UI */
-	pk_refresh_emit_progress_changed (refresh, 0);
-	step = 100.0f / EGG_OBJ_LIST(mtimes)->len;
-
-	/* for each new package, process the desktop file */
-	for (i=0; i<EGG_OBJ_LIST(mtimes)->len; i++) {
-
-		/* get the filename from the mtime encoded string */
-		filename = g_strdup (egg_string_list_index (mtimes, i));
-		g_strdelimit (filename, "|", '\0');
-
-		/* get the name */
-		package_name = pk_refresh_import_desktop_files_get_package (refresh, filename);
-
-		/* process the file */
-		if (package_name != NULL)
-			pk_refresh_import_desktop_files_process_desktop (refresh, package_name, filename);
-		else
-			egg_warning ("%s ignored, failed to get package name\n", filename);
-		g_free (package_name);
-		g_free (filename);
-
-		/* update UI */
-		pk_refresh_emit_progress_changed (refresh, i * step);
-	}
-
-	/* save new mtimes data */
-	ret = egg_obj_list_to_file (EGG_OBJ_LIST (mtimes), "/var/lib/PackageKit/desktop-mtimes.txt");
-	if (!ret)
-		egg_warning ("failed to set old mtimes of desktop files");
-
-no_changes:
-	/* update UI */
-	pk_refresh_emit_progress_changed (refresh, 100);
-	pk_refresh_emit_status_changed (refresh, PK_STATUS_ENUM_FINISHED);
-
-	g_object_unref (files);
-	g_object_unref (mtimes);
-	g_object_unref (mtimes_old);
-	return TRUE;
-}
-
-/**
- * pk_refresh_update_package_list:
- **/
-gboolean
-pk_refresh_update_package_list (PkRefresh *refresh)
-{
-	gboolean ret;
-
-	g_return_val_if_fail (PK_IS_REFRESH (refresh), FALSE);
-
-	if (refresh->priv->backend->desc->get_packages == NULL) {
-		egg_debug ("cannot get packages");
-		return FALSE;
-	}
-
-	egg_debug ("updating package lists");
-
-	/* clear old list */
-	pk_package_list_clear (refresh->priv->list);
-
-	/* update UI */
-	pk_refresh_emit_status_changed (refresh, PK_STATUS_ENUM_GENERATE_PACKAGE_LIST);
-	pk_refresh_emit_progress_changed (refresh, 101);
-
-	/* get the new package list */
-	pk_backend_reset (refresh->priv->backend);
-	pk_store_set_uint (pk_backend_get_store (refresh->priv->backend), "filters", pk_bitfield_value (PK_FILTER_ENUM_NONE));
-	refresh->priv->backend->desc->get_packages (refresh->priv->backend, PK_FILTER_ENUM_NONE);
-
-	/* wait for finished */
-	g_main_loop_run (refresh->priv->loop);
-
-	/* update UI */
-	pk_refresh_emit_progress_changed (refresh, 90);
-
-	/* convert to a file */
-	ret = pk_package_list_to_file (refresh->priv->list, PK_SYSTEM_PACKAGE_LIST_FILENAME);
-	if (!ret)
-		egg_warning ("failed to save to file");
-
-	/* update UI */
-	pk_refresh_emit_progress_changed (refresh, 100);
-	pk_refresh_emit_status_changed (refresh, PK_STATUS_ENUM_FINISHED);
-
-	return ret;
-}
-
-/**
- * pk_refresh_clear_firmware_requests:
- **/
-gboolean
-pk_refresh_clear_firmware_requests (PkRefresh *refresh)
-{
-	gboolean ret;
-	gchar *filename;
-
-	g_return_val_if_fail (PK_IS_REFRESH (refresh), FALSE);
-
-	/* clear the firmware requests directory */
-	filename = g_build_filename (LOCALSTATEDIR, "run", "PackageKit", "udev", NULL);
-	egg_debug ("clearing udev firmware requests at %s", filename);
-	ret = pk_directory_remove_contents (filename);
-	if (!ret)
-		egg_warning ("failed to clear %s", filename);
-	g_free (filename);
-	return ret;
-}
-
-/**
- * pk_refresh_finalize:
- **/
-static void
-pk_refresh_finalize (GObject *object)
-{
-	PkRefresh *refresh;
-
-	g_return_if_fail (object != NULL);
-	g_return_if_fail (PK_IS_REFRESH (object));
-	refresh = PK_REFRESH (object);
-
-	g_signal_handler_disconnect (refresh->priv->backend, refresh->priv->finished_id);
-	g_signal_handler_disconnect (refresh->priv->backend, refresh->priv->package_id);
-
-	if (g_main_loop_is_running (refresh->priv->loop))
-		g_main_loop_quit (refresh->priv->loop);
-	g_main_loop_unref (refresh->priv->loop);
-
-	g_object_unref (refresh->priv->backend);
-	g_object_unref (refresh->priv->extra);
-	g_object_unref (refresh->priv->list);
-
-	G_OBJECT_CLASS (pk_refresh_parent_class)->finalize (object);
-}
-
-/**
- * pk_refresh_class_init:
- **/
-static void
-pk_refresh_class_init (PkRefreshClass *klass)
-{
-	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	object_class->finalize = pk_refresh_finalize;
-	signals [PK_REFRESH_STATUS_CHANGED] =
-		g_signal_new ("status-changed",
-			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL, g_cclosure_marshal_VOID__UINT,
-			      G_TYPE_NONE, 1, G_TYPE_UINT);
-	signals [PK_REFRESH_PROGRESS_CHANGED] =
-		g_signal_new ("progress-changed",
-			      G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
-			      0, NULL, NULL, pk_marshal_VOID__UINT_UINT_UINT_UINT,
-			      G_TYPE_NONE, 4, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
-	g_type_class_add_private (klass, sizeof (PkRefreshPrivate));
-}
-
-/**
- * pk_refresh_init:
- *
- * initializes the refresh class. NOTE: We expect refresh objects
- * to *NOT* be removed or added during the session.
- * We only control the first refresh object if there are more than one.
- **/
-static void
-pk_refresh_init (PkRefresh *refresh)
-{
-	gboolean ret;
-
-	refresh->priv = PK_REFRESH_GET_PRIVATE (refresh);
-	refresh->priv->loop = g_main_loop_new (NULL, FALSE);
-	refresh->priv->list = pk_package_list_new ();
-	refresh->priv->backend = pk_backend_new ();
-
-	refresh->priv->finished_id =
-		g_signal_connect (refresh->priv->backend, "finished",
-				  G_CALLBACK (pk_refresh_finished_cb), refresh);
-	refresh->priv->package_id =
-		g_signal_connect (refresh->priv->backend, "package",
-				  G_CALLBACK (pk_refresh_package_cb), refresh);
-
-	refresh->priv->extra = pk_extra_new ();
-	pk_extra_set_access (refresh->priv->extra, PK_EXTRA_ACCESS_WRITE_ONLY);
-
-	/* use the default location */
-	ret = pk_extra_set_database (refresh->priv->extra, NULL);
-	if (!ret)
-		egg_warning ("Could not open extra database");
-}
-
-/**
- * pk_refresh_new:
- * Return value: A new refresh class instance.
- **/
-PkRefresh *
-pk_refresh_new (void)
-{
-	PkRefresh *refresh;
-	refresh = g_object_new (PK_TYPE_REFRESH, NULL);
-	return PK_REFRESH (refresh);
-}
-
-/***************************************************************************
- ***                          MAKE CHECK TESTS                           ***
- ***************************************************************************/
-#ifdef EGG_TEST
-#include "egg-test.h"
-
-void
-egg_test_refresh (EggTest *test)
-{
-	PkRefresh *refresh;
-
-	if (!egg_test_start (test, "PkRefresh"))
-		return;
-
-	/************************************************************/
-	egg_test_title (test, "get an instance");
-	refresh = pk_refresh_new ();
-	egg_test_assert (test, refresh != NULL);
-
-	g_object_unref (refresh);
-
-	egg_test_end (test);
-}
-#endif
-
diff --git a/src/pk-refresh.h b/src/pk-refresh.h
deleted file mode 100644
index 1bcc70c..0000000
--- a/src/pk-refresh.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __PK_REFRESH_H
-#define __PK_REFRESH_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define PK_TYPE_REFRESH		(pk_refresh_get_type ())
-#define PK_REFRESH(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_REFRESH, PkRefresh))
-#define PK_REFRESH_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_REFRESH, PkRefreshClass))
-#define PK_IS_REFRESH(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_REFRESH))
-#define PK_IS_REFRESH_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_REFRESH))
-#define PK_REFRESH_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_REFRESH, PkRefreshClass))
-
-typedef struct PkRefreshPrivate PkRefreshPrivate;
-
-typedef struct
-{
-	GObject		      parent;
-	PkRefreshPrivate     *priv;
-} PkRefresh;
-
-typedef struct
-{
-	GObjectClass	parent_class;
-} PkRefreshClass;
-
-GType		 pk_refresh_get_type			(void) G_GNUC_CONST;
-PkRefresh	*pk_refresh_new				(void);
-
-gboolean	 pk_refresh_clear_firmware_requests	(PkRefresh	*refresh);
-gboolean	 pk_refresh_update_package_list		(PkRefresh	*refresh);
-gboolean	 pk_refresh_import_desktop_files	(PkRefresh	*refresh);
-
-G_END_DECLS
-
-#endif /* __PK_REFRESH_H */
-
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index cbf8e78..784e398 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -66,7 +66,7 @@
 #include "pk-cache.h"
 #include "pk-notify.h"
 #include "pk-security.h"
-#include "pk-refresh.h"
+#include "pk-post-trans.h"
 #include "pk-service-pack.h"
 
 static void     pk_transaction_class_init	(PkTransactionClass *klass);
@@ -585,27 +585,27 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
 	/* do some optional extra actions when we've finished refreshing the cache */
 	if (exit == PK_EXIT_ENUM_SUCCESS &&
 	    transaction->priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
-		PkRefresh *refresh;
-		refresh = pk_refresh_new ();
+		PkPostTrans *post_trans;
+		post_trans = pk_post_trans_new ();
 
-		g_signal_connect (refresh, "status-changed",
+		g_signal_connect (post_trans, "status-changed",
 				  G_CALLBACK (pk_transaction_status_changed_cb), transaction);
-		g_signal_connect (refresh, "progress-changed",
+		g_signal_connect (post_trans, "progress-changed",
 				  G_CALLBACK (pk_transaction_progress_changed_cb), transaction);
 
 		/* generate the package list */
 		ret = pk_conf_get_bool (transaction->priv->conf, "RefreshCacheUpdatePackageList");
 		if (ret)
-			pk_refresh_update_package_list (refresh);
+			pk_post_trans_update_package_list (post_trans);
 
 		/* refresh the desktop icon cache */
 		ret = pk_conf_get_bool (transaction->priv->conf, "RefreshCacheScanDesktopFiles");
 		if (ret)
-			pk_refresh_import_desktop_files (refresh);
+			pk_post_trans_import_desktop_files (post_trans);
 
 		/* clear the firmware requests directory */
-		pk_refresh_clear_firmware_requests (refresh);
-		g_object_unref (refresh);
+		pk_post_trans_clear_firmware_requests (post_trans);
+		g_object_unref (post_trans);
 	}
 
 	/* if we did not send this, ensure the GUI has the right state */
commit 1a892c914c17e9f810540a90642d0a6385f82295
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 12:17:19 2008 +0100

    trivial: fix up some debugging to use words, not numbers

diff --git a/src/pk-backend.c b/src/pk-backend.c
index 8cc58e6..a135cbf 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -938,7 +938,7 @@ pk_backend_require_restart (PkBackend *backend, PkRestartEnum restart, const gch
 		return FALSE;
 	}
 
-	egg_debug ("emit require-restart %i, %s", restart, details);
+	egg_debug ("emit require-restart %s, %s", pk_restart_enum_to_text (restart), details);
 	g_signal_emit (backend, signals [PK_BACKEND_REQUIRE_RESTART], 0, restart, details);
 
 	return TRUE;
commit a67c51c5ae5db29ff5e6bc7d231e1e2992e0593d
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 12:16:55 2008 +0100

    trivial: add an internal function, egg_obj_list_exists()

diff --git a/libpackagekit/egg-obj-list.c b/libpackagekit/egg-obj-list.c
index 9c1ae32..e37e29c 100644
--- a/libpackagekit/egg-obj-list.c
+++ b/libpackagekit/egg-obj-list.c
@@ -369,11 +369,11 @@ egg_obj_list_remove_duplicate (EggObjList *list)
 /**
  * egg_obj_list_find_obj:
  * @list: a valid #EggObjList instance
- * @obj: a valid #gpointer object
+ * @obj: a valid #gconstpointer object
  *
  * Return value: the object
  *
- * Removes an item from a list
+ * Finds an item in a list
  **/
 static gpointer
 egg_obj_list_find_obj (EggObjList *list, gconstpointer obj)
@@ -399,6 +399,23 @@ egg_obj_list_find_obj (EggObjList *list, gconstpointer obj)
 }
 
 /**
+ * egg_obj_list_exists:
+ * @list: a valid #EggObjList instance
+ * @obj: a valid #gconstpointer object
+ *
+ * Return value: the object
+ *
+ * Finds an item in a list
+ **/
+gboolean
+egg_obj_list_exists (EggObjList *list, gconstpointer obj)
+{
+	gconstpointer obj_tmp;
+	obj_tmp = egg_obj_list_find_obj (list, obj);
+	return (obj_tmp != NULL);
+}
+
+/**
  * egg_obj_list_remove:
  * @list: a valid #EggObjList instance
  * @obj: a valid #gpointer object
diff --git a/libpackagekit/egg-obj-list.h b/libpackagekit/egg-obj-list.h
index 3ccf01b..6eb9a7e 100644
--- a/libpackagekit/egg-obj-list.h
+++ b/libpackagekit/egg-obj-list.h
@@ -87,6 +87,8 @@ void		 egg_obj_list_add_array		(EggObjList		*list,
 void		 egg_obj_list_remove_list	(EggObjList		*list,
 						 const EggObjList	*data);
 void		 egg_obj_list_remove_duplicate	(EggObjList		*list);
+gboolean	 egg_obj_list_exists		(EggObjList		*list,
+						 gconstpointer		 data);
 gboolean	 egg_obj_list_remove		(EggObjList		*list,
 						 gconstpointer		 data);
 gboolean	 egg_obj_list_remove_index	(EggObjList		*list,
commit 0fc191954171161b043aa008a7ecda48a85b8355
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Oct 14 12:16:09 2008 +0100

    dummy: make the backend a little cleverer for testing

diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index 49cd0a2..d57bd6a 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -185,9 +185,22 @@ backend_get_distro_upgrades (PkBackend *backend)
 static void
 backend_get_files (PkBackend *backend, gchar **package_ids)
 {
+	guint i;
+	guint len;
+	const gchar *package_id;
+
 	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
-	pk_backend_files (backend, "gnome-power-manager;2.6.19;i386;fedora",
-			  "/usr/share/man/man1;/usr/share/man/man1/gnome-power-manager.1.gz");
+
+	len = g_strv_length (_package_ids);
+	for (i=0; i<len; i++) {
+		package_id = _package_ids[i];
+		if (egg_strequal (package_id, "powertop;1.8-1.fc8;i386;fedora"))
+			pk_backend_files (backend, package_id, "/usr/share/man/man1/boo;/usr/bin/xchat-gnome");
+		else if (egg_strequal (package_id, "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed"))
+			pk_backend_files (backend, package_id, "/usr/share/man/man1;/usr/share/man/man1/gnome-power-manager.1.gz");
+		else if (egg_strequal (package_id, "gtkhtml2;2.19.1-4.fc8;i386;fedora"))
+			pk_backend_files (backend, package_id, "/usr/share/man/man1;/usr/bin/ck-xinit-session");
+	}
 	pk_backend_finished (backend);
 }
 
@@ -493,14 +506,29 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
 static void
 backend_resolve (PkBackend *backend, PkBitfield filters, gchar **packages)
 {
+	guint i;
+	guint len;
+
 	pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
-	if (egg_strequal (packages[0], "vips-doc")) {
-		pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
-				    "vips-doc;7.12.4-2.fc8;noarch;linva",
-				    "The vips documentation package.");
-	} else if (egg_strequal (packages[0], "glib2")) {
-		pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
-				    "glib2;2.14.0;i386;fedora", "The GLib library");
+
+	/* each one has a different detail for testing */
+	len = g_strv_length (packages);
+	for (i=0; i<len; i++) {
+		if (egg_strequal (packages[i], "vips-doc"))
+			pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
+					    "vips-doc;7.12.4-2.fc8;noarch;linva", "The vips documentation package.");
+		else if (egg_strequal (packages[i], "glib2"))
+			pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
+					    "glib2;2.14.0;i386;fedora", "The GLib library");
+		else if (egg_strequal (packages[i], "powertop"))
+			pk_backend_package (backend, PK_INFO_ENUM_UPDATING,
+					    "powertop;1.8-1.fc8;i386;fedora", "Power consumption monitor");
+		else if (egg_strequal (packages[i], "kernel"))
+			pk_backend_package (backend, PK_INFO_ENUM_UPDATING,
+					    "kernel;2.6.23-0.115.rc3.git1.fc8;i386;installed", "The Linux kernel (the core of the Linux operating system)");
+		else if (egg_strequal (packages[i], "gtkhtml2"))
+			pk_backend_package (backend, PK_INFO_ENUM_UPDATING,
+					    "gtkhtml2;2.19.1-4.fc8;i386;fedora", "An HTML widget for GTK+ 2.0");
 	}
 	pk_backend_finished (backend);
 }


More information about the PackageKit-commit mailing list