开发团队的领导笨鸟提个建议你一定要来看

首先说明我这不是胡说,请不要认为我吐槽,这个字眼很难听的我不喜欢,,我认为我在帮助你,,你认为呢???这下面是优客助手的脚本,在250行—258行你是不是忘记敲击几下键盘了,,ubuntukylin的源你添加在主列表里面,那么密匙他会自己飞回来吗??ubuntukylin添加源是一个特出的情况,这我能理解,密匙好像这里没有给他指令啊???

#!/usr/bin/python
# -*- coding: utf-8 -*-
### BEGIN LICENSE

# Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, 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, see <http://www.gnu.org/licenses/>.
### END LICENSE

import apt
import aptsources.sourceslist
import apt.progress.base as apb
#import threading

class FetchProcess(apb.AcquireProgress):
   '''Fetch Process'''
   def __init__(self, sudoDaemon):
   apb.AcquireProgress.__init__(self)
   self.sudoDaemon = sudoDaemon

   def done(self, item):
   print 'all items download finished'
   self.sudoDaemon.software_fetch_signal("down_done", "")

   def fail(self, item):
   print 'download failed'
   self.sudoDaemon.software_fetch_signal("down_fail", "")

   def fetch(self, item):
   print 'one item download finished'
   self.sudoDaemon.software_fetch_signal("down_fetch", "")

   def ims_hit(self, item):
   print 'ims_hit'

   def media_change(self, media, drive):
   print 'media_change'

   def pulse(self, owner):
#                 print 'owner: ', owner
#                 print '############bytes : ', self.current_bytes
#                 print '@@@@@@@@@@@@total : ', self.total_bytes
#                 print '%%%%%%%%%%%%item : ', self.current_items
#                 print '$$$$$$items : ', self.total_items 
#                 print 'current_cps: ', self.current_cps
#                 print 'elapsed_time: ', self.elapsed_time
#                 print 'fetched_bytes: ', self.fetched_bytes
#                 print 'last_bytes: ', self.last_bytes
   self.sudoDaemon.software_fetch_signal("down_pulse","download_bytes:" + str(self.current_bytes) + ",total_bytes:" + str(self.total_bytes) + ",download_items:" + str(self.current_items) + ",total_items:" + str(self.total_items))

   def start(self):
   # Reset all our values.
   self.current_bytes = 0.0
   self.current_cps = 0.0
   self.current_items = 0
   self.elapsed_time = 0
   self.fetched_bytes = 0.0
   self.last_bytes = 0.0
   self.total_bytes = 0.0
   self.total_items = 0
   print 'fetch progress start ...'
   self.sudoDaemon.software_fetch_signal("down_start", "")

   def stop(self):
   print 'fetch progress stop ...'
   self.sudoDaemon.software_fetch_signal("down_stop", "")


class AptProcess(apb.InstallProgress):
   '''Apt progress'''
   def __init__(self, sudoDaemon):
   apb.InstallProgress.__init__(self)
   self.sudoDaemon = sudoDaemon

   def conffile(self, current, new):
   print 'there is a conffile question'

   def error(self, pkg, errormsg):
   self.sudoDaemon.software_apt_signal("apt_error", "")

   def start_update(self):
   print 'apt process start work'
   self.sudoDaemon.software_apt_signal("apt_start", "")

   def finish_update(self):
   print 'apt process finished'
   self.sudoDaemon.software_apt_signal("apt_stop", "")

   def status_change(self, pkg, percent, status):
   print str(int(percent)) + "%  status : " + status
   self.sudoDaemon.software_apt_signal("apt_pulse", "percent:" + str(int(percent)) + ",status:" + status)

#class AptDaemon(threading.Thread):
class AptDaemon():
   def __init__(self, sudoDaemon):
   #threading.Thread.__init__(self)
   self.sudoDaemon = sudoDaemon
   self.ca = apt.Cache()
   self.ca.open()
#                 self.pkgNameList = []
#                 for pkg in self.ca:
#                         self.pkgNameList.append(pkg.name)

   # apt-get update
   def apt_get_update(self):
   self.ca.update(fetch_progress=FetchProcess(self.sudoDaemon))

   # apt-get update
   #def apt_get_update(self):
   #    threading.Thread(target=self.apt_get_update_thread, name='AptUpdate').start()

   # get package by pkgName
   def get_pkg_by_name(self, pkgName):
   try:
   return self.ca[pkgName]
   except Exception, e:
   print e
   return "ERROR"

   # install package
   def install_pkg(self, pkgName):
   self.ca.open()
   pkg = self.get_pkg_by_name(pkgName)
   pkg.mark_install()

   try:
   self.ca.commit(FetchProcess(self.sudoDaemon), AptProcess(self.sudoDaemon))
   except Exception, e:
   print e
   print "install err"

   # install package
   #def install_pkg(self, pkgName):
   #    threading.Thread(target=self.install_pkg_thread, args=(pkgName,), name='PkgInstall').start()

   # uninstall package
   def uninstall_pkg(self, pkgName):
   self.ca.open()
   pkg = self.get_pkg_by_name(pkgName)
   pkg.mark_delete()

   try:
   self.ca.commit(None, AptProcess(self.sudoDaemon))
   except Exception, e:
   print e
   print "uninstall err"

   # uninstall package
   #def uninstall_pkg(self, pkgName):
   #    threading.Thread(target=self.uninstall_pkg_thread, args=(pkgName,), name='PkgUninstall').start()

   # update package
   def update_pkg(self, pkgName):
   self.ca.open()
   pkg = self.get_pkg_by_name(pkgName)
   pkg.mark_upgrade()

   try:
   self.ca.commit(FetchProcess(self.sudoDaemon), AptProcess(self.sudoDaemon))
   except Exception, e:
   print e
   print "update err"

   # update package
   #def update_pkg(self, pkgName):
   #    threading.Thread(target=self.update_pkg_thread, args=(pkgName,), name='PkgUpgrade').start()

   # check package status by pkgName, i = installed u = can update n = notinstall
   def check_pkg_status(self, pkgName):
   self.ca.open()
   pkg = self.get_pkg_by_name(pkgName)
   if(pkg == "ERROR"):
   return "ERROR"
   if(pkg.is_installed):
   if(pkg.is_upgradable):
   return "u"
   else:
   return "i"
   else:
   return "n"

   # check packages status by pkgNameList, i = installed u = can update n = notinstall
   def check_pkgs_status(self, pkgNameList):
   self.ca.open()
   pkgStatusDict = {}
   for pkgName in pkgNameList:
   pkg = self.get_pkg_by_name(pkgName)
   if(pkg == "ERROR"):
   continue
   if(pkg.is_installed):
   if(pkg.is_upgradable):
   pkgStatusDict[pkgName] = "u"
   else:
   pkgStatusDict[pkgName] = "i"
   else:
   pkgStatusDict[pkgName] = "n"

   return pkgStatusDict

   # check packages status by pkgNameList, i = installed u = can update n = notinstall
   def check_pkgs_status_rtn_list(self, pkgNameList):
   self.ca.open()
   pkgStatusList = []
   for pkgName in pkgNameList:
   pkg = self.get_pkg_by_name(pkgName)
   if(pkg == "ERROR"):
   continue
   if(pkg.is_installed):
   if(pkg.is_upgradable):
   pkgStatusList.append(pkgName + ":u")
   else:
   pkgStatusList.append(pkgName + ":i")
   else:
   pkgStatusList.append(pkgName + ":n")

   self.sudoDaemon.software_check_status_signal(pkgStatusList)
   #return pkgStatusList

   # check packages status by pkgNameList, i = installed u = can update n = notinstall
   #def check_pkgs_status_rtn_list(self, pkgNameList):
   #    threading.Thread(target=self.check_pkgs_status_rtn_list_thread, args=(pkgNameList,), name='PkgStatusList').start()

#         def get_pkgs_name_list(self):
#                 return self.pkgNameList
# 
#         def search_pkgs_name(self, pkgName):
#                 if pkgName in self.pkgNameList:
#                         return pkgName
#                 else:
#                         rtns = []
#                         for name in self.pkgNameList:
#                                 if name.find(pkgName) >= 0:
#                                         rtns.append(name)
#                         return rtns

   # get all source item in /etc/apt/sources.list
   def get_sources(self):
   source = aptsources.sourceslist.SourcesList()
   return source.list

   # add ubuntukylin source in /etc/apt/sources.list
   def add_source_ubuntukylin(self):
   source = aptsources.sourceslist.SourcesList()
   for item in source.list:
   if(item.str().find("deb http://archive.ubuntukylin.com/ubuntukylin") != -1):
   return

   source.add("deb", "http://archive.ubuntukylin.com/ubuntukylin/", "raring main", "")
   source.save()

   # remove ubuntukylin source in /etc/apt/sources.list
   def remove_source_ubuntukylin(self):
   source = aptsources.sourceslist.SourcesList()
   sources = source.list
   for item in sources:
   if(item.str().find("deb http://archive.ubuntukylin.com/ubuntukylin") != -1):
   source.remove(item)
   source.save()

if __name__ == "__main__":
   ad = AptDaemon(None)

#         print ad.check_pkgs_status(["gedit", "cairo-dock", "unity"])
#        print ad.check_pkgs_status_rtn_list(["gedit", "cairo-dock", "unity", "haha", "hehe"])
#         ad.apt_get_update()
   ad.add_source_ubuntukylin()
#         ad.remove_source_ubuntukylin()

   while True:
   print "\ninput your command: "
   cmd = raw_input()
   if cmd == "l":
   for name in ad.pkgNameList:
   print name + "\n"
   elif cmd == "i":
   print "input pkgName to install: "
   pkgName = raw_input()
   ad.install_pkg(pkgName)
   elif cmd == "n":
   print "input pkgName to uninstall: "
   pkgName = raw_input()
   ad.uninstall_pkg(pkgName)
   elif cmd == "u":
   print "input pkgName to update: "
   pkgName = raw_input()
   ad.update_pkg(pkgName)
   elif cmd == "c":
   print "input pkgName to check status: "
   pkgName = raw_input()
   print ad.check_pkg_status(pkgName)
   else:
   print "nothing..."

#         print ad.get_pkg_by_name('gedit')
   # pnl = ad.getpkglist()
   # print len(pnl)
#         name1 = ad.search_pkgs_name('wesnoth-1.10-core')
#         print name1
   # print 'aaa' + str(1)
#         ad.install_pkg(name1)
#         ad.uninstall_pkg(name1)
   # p = ad.get_pkg_by_name(name1)
   # print p.id
   # c = AptCache()
   # c.hahaha()
   # print c.hahaha()
   # pkgs = []
   # ca = apt.Cache()
   # i = 0
   # for a in ca:
   #         i += 1
   #         pkgs.append(a.name)
   # print a.name
   # print i
   # nanop = ca['nano']
   # print nanop
   # nanop.mark_install()
   # ca.commit()

我要挑毛病挑对了,给我点积分我认钱,微软挖漏洞的无论大小都有奖励的,我不要人民我要麒麟币,还有铮亮的纽扣挂我的头像下面,,

沙发还是我自己来占吧,,笨鸟你真是笨鸟,,天下最大的傻瓜,,

这个问题已经反馈了,之前youker-assistant添加源用完之后就删除了,不会存在key的问题,但用完删,用的时候又添加影响性能,所以现在的版本就只在启动软件推荐的时候添加一次源,这就导致了key的问题,其实我们有一个专门的key包:http://archive.ubuntukylin.com/ubuntukylin/pool/main/u/ubuntukylin-keyring/ubuntukylin-keyring_2013.05.14_all.deb, 因为ubuntu的版本制作规定无法默认集成到版本,对于你提的这个问题,如果方便的话你可以到launchpad提交一个关于youker-assistant的bug并将它assigned给kobe,他应该很乐意修复这个bug的

http://archive.ubuntukylin.com/ubuntukylin/pool/main/u/ubuntukylin-keyring/ubuntukylin-keyring_2013.05.14_all.deb 这个包的问题也是由于我们的告知不足,使很多UK爱好者不知道,导致他们更新源时出现问题,这个问题在下个版本的youker-assistant中应该会得到修复

这个问题是之前我回答你的那个关于源的问题有相关性,确实待解决,谢谢。

deb文件我当然知道,,其实这是一个简单的小事,作者只要敲击几下键盘,,再也不会有人大呼小叫无法下载,因为没有密匙,,没有恶意,,只是希望他完美,,:slight_smile:

这脚本源文件在此,,并不是2楼板凳说的,,添加过密匙,,自己看看有没有添加,,没有,添加的是源,,他应该添加源同时想到密匙问题,地下顺利成长的敲击解决办法,,另外在胡说一句,,密匙制作成deb其实本身就是一个错误,,当没有密匙人们都会用死规定命令去服务器下载,,可是他是一个deb文件格式不对应,,怎么能下载会密匙呢对吗?笨鸟不会不加思考张嘴就说话的,,你们这些人能容忍我胡说吗,,挑毛病要有铁证,而且会跳,,这才是我说的提意见,,另外,你们开发团队,有的个别人很不好,,前几天因为没有密匙问题某人专门出帖子,,用的是gpg --keyserver subkeys.pgp.net --recv
办法,请问这能下载deb吗?既然自己都不知道密匙在何方为什么要出帖子,骗人呢,,我只是气不过才在这里发落,,至于你老哥还是特别谦虚的好学谦谦君子,这点笨鸟认可,,

正确的做法是要做成debian包,并将该包默认集成到版本中,不信你可以通过下面命令看看ubuntu的key包
dpkg -l | grep ubuntu-keyring 这个是ubuntu的密钥包

我们之所以没做到那样,因为我们没办法让ubuntukylin-keyring包入ubuntu的仓库,他们不同意,我们就只能把这个包放在ubuntukylin的源里面,只是我们疏忽了一点,需要把这个包的地址同时告知用户,让用户通过浏览器下载安装,这个是我们工作的失误

另外对于你说的某人发帖说通过命令方式添加密钥,这种做法也是对的,debian包的方式就是对命令的封装,只是我们团队不同的人分工不同,不可能有人对所有的东西都知道,没有人会去骗人的,出现问题我们一般都会有人去寻找解决方法,只是不同的人实现方法不一样,其实都能达到效果。

而且我们有时候也会遇到同样的解决方法对不同的机器得到的结果会不一样,主要是因为不同环境导致的

你也是我们论坛的活跃用户,我有一个建议,就是以后你发现什么问题除了在论坛发帖反馈外,能不能花点时间到launchpad上提交一个bug,因为论坛里面我们不能保证都能看到,毕竟我们那么多开发人员不能都呆在论坛上,而且每个人的分工不同,如果你愿意花点时间到launchpad上提交你发现的bug的话,我想对于我们修复这个bug会更方便,因为你提的bug会有人将这个bug分配给指定的开发人员

我们所有的开发人员是非常欢迎大家提交问题和反馈的,像你今天这个帖子提到的问题,就可以直接到youker-assistant的项目下提交bug,相关的开发人员就会考虑修复方法的

能把地址连接给我,,我详细的说清楚,,

不需要通告用户,,只是默认添加源相对就自动下载密匙导入,,这样永远不会有人就此提出异议,在这里解决优客助手才是一个好的软件,,要是客户手动再去下载密匙,,你想人家还会认可优客助手吗?

所以你今天提出了kobe说会去修改了,我也是建议你可以帮忙到launchpad上提交一下bug,因为这样的帖子他不一定会看的到,你如果提到launchpad上他就一定会看到而且一定会给你一个说法

今天是我看到了,我就帮你跟kobe说了,下次要是你再提一个他没看到就有可能问题得不到修复,今天我看到了,我对这个有一点了解,知道这个是kobe负责,就可以找他来修复,万一哪天是别人看到了,他又不了解这一块,岂不是没人帮你给开发者提了,你说是不是,我说这么多,想表达的是,我们是非常欢迎用户给我们提问题的,只是希望在论坛提完后多花2分钟到launchpad上也提交一个bug,把他关联给ubuntukylin,到时候就会有人负责去分配由谁来修复

我们团队非常希望用户给我们找问题,骂我们都可以,只是希望提问题的时候多走一步,除了在论坛提外,也到launchpad上报个bug

我们希望有一天所有用户都能把发现的问题往launchpad上报,引导用户参与到launchpad里面项目的开发,因为我们所有的代码也是托管在那里的,你觉得你有更好的实现方法,也可以往我们的项目分支上提交代码,我们都是非常欢迎的,我们之前也有爱好者参与农历插件的代码开发,他们提交的代码我们也很愿意接收,只要是符合标准没有bug的

同时我也要谢谢你,,我们每个人都希望ubuntukylin能做的更好,,中国人不支持自己国产,,还是中国人吗?当然用户要正确的提出好的方案,这个软件会更早的成熟,,但是提问题也要文明,正如我吊儿郎当,但是骂人就是畜生,,你们开发者也很辛苦的,默默地位我们的国家民族奉献,燃烧着自己的,,我很理解,,开发团队有你们这些优秀的人才,我看到了ubuntukylin的光明,,加油,麒麟,,加油,,麒麟,团队,,

这太不人性化了,应该学学opensuse,蜥蜴导入源时会自动导入密匙,所以很方便。

技术交流的非常精彩,要是我懂该多好:6_125: