Xware-desktop 迅雷固件桌面版 for openSUSE 开发手札(征集测试!x86_64 only)

注意: ** 这只是测试版本 ** ,目前把 xware-desktop 进行 openSUSE 化的进度完成情况如下:

  1. 编写从 github 下载不开源的固件文件的 shell 脚本。
  2. 在 Makefile 里 decouple(解挂)固件文件的安装。
  3. 不要装到 /opt/xware-desktop 而是装到 /usr 下面。主要涉及到了改 src 文件中的一些硬编码路径,c 和 python 文件里都有,还有改 Makefile 来安装到正确的位置。(已完成)
  4. 不要只能使用 xware:xware 用户和用户组执行,使用 root 执行。(感觉像是完成了)
  5. 改 Makefile 去生成程序使用的临时文件夹,touch 一些 lock/socket 和配置文件。(跟 2 有极大连带,感觉像是完成了)
  6. 基本的测试运行,看看配置文件、临时文件和临时文件夹的权限是否正确(没办法,权限是硬编码的)(感觉像是完成了)
  7. 调整 systemd 服务和 desktop 文件。(已完成)
  8. 绘制 svg 图标。(未完成)

所以 ** 只提供了 x86_64 版本(因为我的开发环境就是 x86_64)供有能力的用户协助我进行真实下载测试。小白请耐心等待,不要敲碗。**

安装:

pan.baidu.com/s/1kTumKb9

  1. 安装 chrpath。你也可以从 devel:tools 源里安装。

xware-desktop 的开发官网的 wiki 指责我们 openSUSE 的 chrpath 太旧,0.14,2004 年。

这是因为它就应该旧:chrpath 是一个 GNU 项目:http://directory.fsf.org/wiki/Chrpath。项目上游在 0.14 版后并没有发布新版本,现在 Debian/Ubuntu/Arch 里使用的所谓 0.16 版其实是 Debian 在自己的项目网站上为 chrpath 发布的新版,这让我又想起了 avifile 0.47 版的故事,作为一个下游不去上游开发老在自己那儿 bump 版本号,这点 Debian 值得批评,Fedora 主力开发 GNOME 人家也没在 Fedora bump 版本号啊。(xware-desktop 的 wiki 已编辑澄清,同时 openSUSE 也开始 track Debian 的项目地址了,维护者是我)

0.16 版和 0.14 版的区别就是 0.16 版可以跨架构去移除 ELF 文件中的 rpath。比如我们在用 x86_64,而迅雷固件是 32bit only 的,0.14 版就去不了它的 rpath(其实也能啦,不过要用 chrpath-32bit 这样的包来去,这样的包在 openSUSE 下也没有)。

  1. 安装 python3-sip 和 python3-qt5。 ** 一定要用我给出的版本。**

原因是:

2.1 openSUSE 13.1 oss 和 KDE:Qt5 源中的 python3-qt5 并没有编译 PyQt5.QtMultimedia 这个模块,而该模块被 xware-desktop 需要。没有原因也很简单,之前 KDE 用 Qt 没有用这个模块,但我觉得在 openSUSE 下做 Qt5 开发必须要有这个模块,于是我启用了。
2.2 KDE:Qt5 源中的 libqt5-qtbase 有个 bug 导致 python-qt5 和 python3-qt5 无法编译。这个 bug 很好修,我修了,提交,我们 KDE team 的人说这个是上游的某个 commit 故意搞成这样的,downstream hack 是不是不太好,好吧,我也认同不太好。于是直到 Qt 上游修复那个编译 bug 前,KDE:Qt5 源里是不会有我修好的全模块版本的 python3-qt5 的。
2.3 安装 KDE:Qt5 源中的 python3-qt5 会安装该源中的 libqt5,该源中的版本是 5.2.1。而 openSUSE 13.1 默认带的是 5.1.1,这就会导致你从 home:opensuse_zh 源中装的比如 doubanfm-qt5、WeCase 等被卸载(因为没有东西能提供 5.1.1 的 Qt5 了)。

所以我针对 openSUSE 13.1 中的 Qt5 5.1.1 编译了 python3-qt5,而 python3-sip 是因为太新版里有 bug 同样会导致 python3-qt5 无法编译。

  1. 安装 xware-desktop。

一定要使用

sudo zypper in xware-desktop*.rpm

而不是 Linux 通用的

sudo rpm -ivh *.rpm

来安装。

因为迅雷固件不是开源的,随随便便拿来用不太好,所以跟搜狗拼音一样整合了 openSUSE 专有 hack 去在安装时下载, ** 你不用 zypper 安装 rpm 就触发不了专有 hack 也就没有固件 ** 。

之后

sudo systemctl start xwared.service

启动服务

然后

xware-desktop

去启动前端。

注意: ** 关闭前端并不会同时关闭后端 xwared,后端依然在下载 ** 。这跟 mldonky 很像。需要你去关闭 systemd 服务

sudo systemctl stop xwared.service

才可以。

目前需要进行协助测试的有:

  1. ** 终端运行 xwared(就是不运行 systemd 服务,直接开个窗口跑)**
  2. ** 终端运行 xware-desktop**

进行登录、资源查找、下载、暂停、续传等基本使用测试。

** 出现问题请把 xwared 和 xware-desktop 的终端输出贴到这里来 ** 。

再次提醒, ** 本帖不接受抱怨,只接受勇敢的测试报告,同时也不接受 bug 汇报,因为 openSUSE 方面我说了这是测试版,而上游方面,程序被我改动很大,很可能不是上游的责任。**

百度网盘真是个好东西 :1:

环境:13.1+mate
安装过程严格遵照上面的论述。
直接不启动服务终端启动,前端可以正常启动,但是显示离线。



终端显示




启动服务后,前端无法正常启动


终端信息

Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 23, in new_run
    self._unpatched_run()
  File "/usr/lib64/python3.3/threading.py", line 858, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 56, in _watcherThread
    xwaredLockFile = open(constants.XWARED_LOCK)
PermissionError: [Errno 13] 权限不够: '/var/lib/xware-desktop/xware_xwared.lock'
Exception in thread xwared/etm watch thread:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 23, in new_run
    self._unpatched_run()
  File "/usr/lib64/python3.3/threading.py", line 858, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 56, in _watcherThread
    xwaredLockFile = open(constants.XWARED_LOCK)
PermissionError: [Errno 13] 权限不够: '/var/lib/xware-desktop/xware_xwared.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.3/threading.py", line 901, in _bootstrap_inner
    self.run()
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 27, in new_run
    sys.excepthook(*sys.exc_info())
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

set local torrent None.
Traceback (most recent call last):
  File "/usr/bin/xware-desktop", line 138, in <module>
    app = XwareDesktop(sys.argv)
  File "/usr/bin/xware-desktop", line 65, in __init__
    self.mainWin = main.MainWindow(None)
  File "/usr/share/xware-desktop/frontend/main.py", line 23, in __init__
    self.setupUi(self)
  File "/usr/share/xware-desktop/frontend/ui_main.py", line 46, in setupUi
    self.statusBar_main = CustomStatusBar(MainWindow)
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 27, in __init__
    self.setupStatusBar()
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 34, in setupStatusBar
    self.quickSpeedLimitBtn = QuickSpeedLimitBtn(self)
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 25, in __init__
    self.slotToggleEnableFlag()
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 28, in slotToggleEnableFlag
    self.setEnabled(app.xwaredpy.etmStatus)
TypeError: QWidget.setEnabled(bool): argument 1 has unexpected type 'NoneType'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/xware-desktop", line 138, in <module>
    app = XwareDesktop(sys.argv)
  File "/usr/bin/xware-desktop", line 65, in __init__
    self.mainWin = main.MainWindow(None)
  File "/usr/share/xware-desktop/frontend/main.py", line 23, in __init__
    self.setupUi(self)
  File "/usr/share/xware-desktop/frontend/ui_main.py", line 46, in setupUi
    self.statusBar_main = CustomStatusBar(MainWindow)
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 27, in __init__
    self.setupStatusBar()
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 34, in setupStatusBar
    self.quickSpeedLimitBtn = QuickSpeedLimitBtn(self)
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 25, in __init__
    self.slotToggleEnableFlag()
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 28, in slotToggleEnableFlag
    self.setEnabled(app.xwaredpy.etmStatus)
TypeError: QWidget.setEnabled(bool): argument 1 has unexpected type 'NoneType'

太棒了,我要的就是这个,我来修下

Sent from my iPhone 5s using Tapatalk

寨主威武,只可惜我在复习考试 ing,改天有空再测试啦

@styx 关键问题在这句:

PermissionError: [Errno 13] 权限不够: ‘/var/lib/xware-desktop/xware_xwared.lock’

你试试

sudo chmod 666 /var/lib/xware-desktop/xware_xwared.lock

然后再跑一次看看。等把错误都找出来我再统一打一个新包。

我是 GNOME 桌面,直接无法运行

1、在没有执行 systemctl start 命令前执行 xwared 返回:

cleanPreviousRun LOCK_PATH: Permission denied
cleanPreviousRun ETM_LOCK_PATH: Permission denied
pthread listening ok
xwared: unlocked.
pthread listening
xwared: Key file does not have group 'xwared', use default value
parent: pid(10772) cpid(10775)
child: pid(10775) ppid(10772)
settings_config_load, cfg_file_name = ../cfg/download.cfg
DO ETM INIT ERR:13
waitpid: 65280
parent: pid(10772) cpid(10781)
child: pid(10781) ppid(10772)
settings_config_load, cfg_file_name = ../cfg/download.cfg
DO ETM INIT ERR:13
waitpid: 65280
parent: pid(10772) cpid(10787)
child: pid(10787) ppid(10772)
settings_config_load, cfg_file_name = ../cfg/download.cfg
waitpid: 11

后边是循环输出,被我 ctrl+c 给强行关闭了。

2、我启动 xwared.serve 后执行 xwared 的输出:

cleanPreviousRun LOCK_PATH: Permission denied
cleanPreviousRun ETM_LOCK_PATH: Permission denied
pthread listening ok
Open lock file: Permission denied

只有上边那么多,就自动结束了。

3、启动 swared.service 服务后 xware-desktop 的输出:

"Qt Warning - invalid keysym: dead_actute" 
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 23, in new_run
    self._unpatched_run()
  File "/usr/lib64/python3.3/threading.py", line 858, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 56, in _watcherThread
    xwaredLockFile = open(constants.XWARED_LOCK)
PermissionError: [Errno 13] 权限不够: '/var/lib/xware-desktop/xware_xwared.lock'
Exception in thread xwared/etm watch thread:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 23, in new_run
    self._unpatched_run()
  File "/usr/lib64/python3.3/threading.py", line 858, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 56, in _watcherThread
    xwaredLockFile = open(constants.XWARED_LOCK)
PermissionError: [Errno 13] 权限不够: '/var/lib/xware-desktop/xware_xwared.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.3/threading.py", line 901, in _bootstrap_inner
    self.run()
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 27, in new_run
    sys.excepthook(*sys.exc_info())
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

set local torrent None.
Traceback (most recent call last):
  File "/usr/bin/xware-desktop", line 138, in <module>
    app = XwareDesktop(sys.argv)
  File "/usr/bin/xware-desktop", line 65, in __init__
    self.mainWin = main.MainWindow(None)
  File "/usr/share/xware-desktop/frontend/main.py", line 23, in __init__
    self.setupUi(self)
  File "/usr/share/xware-desktop/frontend/ui_main.py", line 46, in setupUi
    self.statusBar_main = CustomStatusBar(MainWindow)
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 27, in __init__
    self.setupStatusBar()
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 34, in setupStatusBar
    self.quickSpeedLimitBtn = QuickSpeedLimitBtn(self)
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 25, in __init__
    self.slotToggleEnableFlag()
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 28, in slotToggleEnableFlag
    self.setEnabled(app.xwaredpy.etmStatus)
TypeError: QWidget.setEnabled(bool): argument 1 has unexpected type 'NoneType'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/xware-desktop", line 138, in <module>
    app = XwareDesktop(sys.argv)
  File "/usr/bin/xware-desktop", line 65, in __init__
    self.mainWin = main.MainWindow(None)
  File "/usr/share/xware-desktop/frontend/main.py", line 23, in __init__
    self.setupUi(self)
  File "/usr/share/xware-desktop/frontend/ui_main.py", line 46, in setupUi
    self.statusBar_main = CustomStatusBar(MainWindow)
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 27, in __init__
    self.setupStatusBar()
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 34, in setupStatusBar
    self.quickSpeedLimitBtn = QuickSpeedLimitBtn(self)
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 25, in __init__
    self.slotToggleEnableFlag()
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 28, in slotToggleEnableFlag
    self.setEnabled(app.xwaredpy.etmStatus)
TypeError: QWidget.setEnabled(bool): argument 1 has unexpected type 'NoneType'
"Qt Warning - invalid keysym: dead_actute" 
段错误 

另外还有一个弹出错误窗口,内容和上边差不多。

执行 sudo chmod 666 /var/lib/xware-desktop/xware_xwared.lock 后的输出:

"Qt Warning - invalid keysym: dead_actute" 
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 23, in new_run
    self._unpatched_run()
  File "/usr/lib64/python3.3/threading.py", line 858, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 70, in _watcherThread
    etmLockFile = open(constants.ETM_LOCK)
PermissionError: [Errno 13] 权限不够: '/var/lib/xware-desktop/xware_ETM.lock'
Exception in thread xwared/etm watch thread:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 23, in new_run
    self._unpatched_run()
  File "/usr/lib64/python3.3/threading.py", line 858, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 70, in _watcherThread
    etmLockFile = open(constants.ETM_LOCK)
PermissionError: [Errno 13] 权限不够: '/var/lib/xware-desktop/xware_ETM.lock'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib64/python3.3/threading.py", line 901, in _bootstrap_inner
    self.run()
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 27, in new_run
    sys.excepthook(*sys.exc_info())
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

set local torrent None.
"Qt Warning - invalid keysym: dead_actute" 
Traceback (most recent call last):
  File "/usr/bin/xware-desktop", line 138, in <module>
    app = XwareDesktop(sys.argv)
  File "/usr/bin/xware-desktop", line 65, in __init__
    self.mainWin = main.MainWindow(None)
  File "/usr/share/xware-desktop/frontend/main.py", line 23, in __init__
    self.setupUi(self)
  File "/usr/share/xware-desktop/frontend/ui_main.py", line 46, in setupUi
    self.statusBar_main = CustomStatusBar(MainWindow)
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 27, in __init__
    self.setupStatusBar()
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 34, in setupStatusBar
    self.quickSpeedLimitBtn = QuickSpeedLimitBtn(self)
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 25, in __init__
    self.slotToggleEnableFlag()
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 28, in slotToggleEnableFlag
    self.setEnabled(app.xwaredpy.etmStatus)
TypeError: QWidget.setEnabled(bool): argument 1 has unexpected type 'NoneType'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/xware-desktop", line 138, in <module>
    app = XwareDesktop(sys.argv)
  File "/usr/bin/xware-desktop", line 65, in __init__
    self.mainWin = main.MainWindow(None)
  File "/usr/share/xware-desktop/frontend/main.py", line 23, in __init__
    self.setupUi(self)
  File "/usr/share/xware-desktop/frontend/ui_main.py", line 46, in setupUi
    self.statusBar_main = CustomStatusBar(MainWindow)
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 27, in __init__
    self.setupStatusBar()
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 34, in setupStatusBar
    self.quickSpeedLimitBtn = QuickSpeedLimitBtn(self)
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 25, in __init__
    self.slotToggleEnableFlag()
  File "/usr/share/xware-desktop/frontend/Settings/QuickSpeedLimit.py", line 28, in slotToggleEnableFlag
    self.setEnabled(app.xwaredpy.etmStatus)
TypeError: QWidget.setEnabled(bool): argument 1 has unexpected type 'NoneType'

然后我又执行了 sudo chmod 666 /var/lib/xware-desktop/xware_ETM.lock 之后再次执行 xware-desktop
在桌面出现了一个大概 15mm*15mm 的置顶小方块,可以用鼠标来回拖动,猜测应该是一个显示不完全的浮窗。
在终端的输出如下:

"Qt Warning - invalid keysym: dead_actute" 
set local torrent None.
updated clipboard pattern regex \.ppt|\.m3u|\.flv|\.wma|\.xlsm|\.mov|\.cue|\.rar|\.tar\.lzma|\.pdf|\.avi|\.tgz|\.wv|\.tb2|\.3g2|\.docm|\.tar\.Z|\.sub|\.aac|\.odt|\.tar\.xz|\.tbz2|\.wmv|\.tar\.gz|\.mkv|\.zip|\.dmg|\.iso|\.tlz|\.epub|\.ape|\.apk|\.vob|\.rmvb|\.bin|\.txt|\.pptx|\.txz|\.ogg|\.webm|\.rm|\.docx|\.doc|\.wps|\.7z|\.exe|\.rom|\.tar\.bz2|\.tbz|\.cab|\.ra|\.xlt|\.3gp|\.mp3|\.tar\.lz|\.mp4|\.m4a|\.mp2|\.taz|\.tar|\.pptm|\.rpm|\.mp1|\.img|\.ttf|\.xltx|\.torrent|\.msi|\.deb|\.srt|\.wav|\.flac|\.rtf|\.jar|\.chm
load glyph failed err=6 face=0x1a840e0, glyph=12330
Try to consume, because xdjs loaded.
Xdjs says device not online, no consuming

最后停在这个地方就一直没动静了。

又出状况了,当我想使用 ctrl+c 结束终端进程,输出如下提示并弹出错误窗口,而且进程无法关闭:

^CTraceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 123, in slotTasksSummaryUpdated
    @pyqtSlot(bool)
KeyboardInterrupt
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CustomStatusBar/CStatusBar.py", line 123, in slotTasksSummaryUpdated
    @pyqtSlot(bool)
KeyboardInterrupt

"Qt Warning - invalid keysym: dead_actute"

我又试了用 systemctl 关闭后端服务,但前端进程依旧无法关闭。
最后没办法只能 PS 找出进程号来 kill 掉了

@marguerite

执行

sudo chmod 666 /var/lib/xware-desktop/xware_xwared.lock

报 /var/lib/xware-desktop/xware_ETM.lock 无权限错误
执行

sudo chmod 666 /var/lib/xware-desktop/xware_ETM.lock


成功启动前端,但是显示 ETM 离线。





重启服务后,再次报 /var/lib/xware-desktop/xware_xwared.lock 无权限错误。

PS:桌面环境 MATE

marguerite 你好,我是 Xware Desktop 的作者。今天搜索了一下 Xware Desktop 找到了这里。

感谢你对 openSuSE 的测试和打包。我原本想自己弄的,后来发现实在不会放弃了。

看到了你在顶楼列出了你对现有的 Xware Desktop 的一些不合理地方的改动,我想谈谈我对这些改动的看法,还有对未来版本的设想。

我为了省事直接把迅雷的 binary 放在了 repo 里。
几个月前我在迅雷固件的官方论坛上发帖想让迅雷明确一下迅雷固件的 License,迅雷官方无回应。要是迅雷允许自由分发的话,这一条倒是不太要紧。Xware Desktop 现在是 GPL3,不过我可以改成其它的授权(BSD、MIT。。)来与迅雷的协议兼容。
但在迅雷明确 License 之前,使用脚本下载 xware 还是很有必要的。你要做 shell 脚本的话,你可以从这里下载。http://dl.lazyzhu.com/file/thunder/xware/。lazyzhu 貌似是迅雷的员工,在迅雷的论坛上能看到他。

能够灵活地安装很好,赞同。这点也在我的 TODO 里面。我个人对 /opt 倒是没有什么负面的感情,毕竟 Google Chrome 就是这么做的。

先来说一下我怎么想出 xware:xware 这个主意的吧。
第一 xware 绑定 TCP9000 端口作为“API”、使用 /tmp/thunder、还会尝试写入 /var/run。这几点就让一台电脑上不能同时运行多个 xware 实例。在 xwared 程序里限制 xware:xware 就避免了多个用户尝试同时运行 xware 造成的麻烦。
第二 安全性。我不希望 xware 执行在 root 下。刚才说的 9000 端口甚至没有 auth 功能,网内的所有人都有权限访问,万一要是 ETM 出现漏洞后果很严重。(迅雷其实也知道这个问题,所以最近几个版本的 xware,迅雷干脆限制了这个 9000 端口只允许 127.0.0.1 访问。)

我对 xware:xware 带来的副作用的看法。
第一 安装起来不方便。
第二 各种权限配置的问题。

回到你提出的改动上面来。我认为使用 root 来运行一个访问 Internet 的程序是冒险的,而且它依然会造成用户下载下来的文件不是自己的,用户还是会陷入权限设置的麻烦里。

我对未来版本的想法是这样的,想听听你的意见。
Xware Desktop 不再强制要求以 xware:xware 执行,对执行用户或组没有任何要求。默认情况下由自己的用户执行。在~/.xware-desktop/ 里建立一个 chroot 文件夹,在~/.xware-desktop/chroot 里面软链接 /opt/xware-desktop。由 fakeroot 及 fakechroot 程序提供这个 chroot 环境。xware 在这个 fakechroot 里面运行。

这样做的好处:安全性有了相当的保证,安装起来比较方便,距离实现多用户同时使用也更近一步。
这样做的麻烦:arch 的官方源没有 lib32-fakechroot、ubuntu 里面的 fakeroot32 位 64 位不能同时装…。因此 Xware Desktop 需要自己带上 fakeroot 和 fakechroot。
这样做依然没有解决:9000 端口的抢占问题。不知道你有没有什么解决办法呢?

搜索一下 006 和 660 和 666 吧。我记得就这么几种。

最后解释一下 chrpath 问题:我知道 Debian 有时候爱 fork 东西,但我不知道 chrpath 的新版也是 Debian 做的。我没想过要指责 openSuSE。我从没用过 openSuSE,连怎么打包都不知道,没有指责的资格。但 Fedora 和 openSuSE 的 chrpath 太旧也是事实。而你在 Wiki 上写的“这是因为它就应该旧”,“偷偷摸摸… 没有少做”,语气上带有太多的负面感情,让 Debian 粉看到了一定不愿意。我觉得你的辩护有点 Overheated。要是明天 Wiki 上再出现一段为什么 Ubuntu 上不让同时装 32 位和 64 位的 pkg-config,我会一样摸不着头脑的。

刚把系统换成 64 位,我也帮着测试一下好了。openSUSE 13.1 x86_64 + KDE。

下载了女王提供的四个软件放在一个目录下做一个本地源用 YaST 图形界面安装。已经把系统软件包都切到这个源里的软件包。版本应该是没有问题。

  1. 终端运行 xwared(就是不运行 systemd 服务,直接开个窗口跑)

    cleanPreviousRun ETM_LOCK_PATH: No such file or directory
    pthread listening ok
    Open lock file: Permission denied
    pthread listening

然后就没有然后了。
2. 终端运行 xware-desktop

终端出现:

"Qt Warning - invalid keysym: dead_actute" 
set local torrent None.
updated clipboard pattern regex \.mp3|\.mp2|\.ppt|\.exe|\.mp4|\.chm|\.rpm|\.mp1|\.rtf|\.srt|\.rom|\.rm|\.msi|\.odt|\.pptx|\.cab|\.doc|\.apk|\.wmv|\.m3u|\.bin|\.3gp|\.tar\.lzma|\.jar|\.flv|\.tar\.bz2|\.avi|\.wav|\.deb|\.pdf|\.xlt|\.xlsm|\.docm|\.pptm|\.tbz|\.aac|\.mkv|\.tar\.Z|\.ogg|\.torrent|\.flac|\.docx|\.epub|\.zip|\.webm|\.tar\.xz|\.tar\.gz|\.tlz|\.m4a|\.tbz2|\.wps|\.wv|\.ttf|\.cue|\.rmvb|\.rar|\.7z|\.img|\.3g2|\.xltx|\.tar\.lz|\.ape|\.txz|\.tgz|\.ra|\.wma|\.sub|\.txt|\.tb2|\.taz|\.mov|\.vob|\.iso|\.dmg|\.tar
Try to consume, because xdjs loaded.
Xdjs says device not online, no consuming
set local torrent None.
set local torrent None.
Try to consume, because mask off.
Xdjs says device not online, no consuming
Try to consume, because xdjs loaded.
Xdjs says device not online, no consuming

点击尝试下载:

 弹出窗口显示: ETM 未启用,无法激活。需要启动 ETM 后,刷新页面。

终端多出几行:

extracted urls 
extracted urls 
set local torrent None.
Try to consume, because mask off.
Xdjs says device not online, no consuming
Try to consume, because xdjs loaded.
Xdjs says device not online, no consuming
set local torrent None.
Try to consume, because mask off.
Xdjs says device not online, no consuming
Try to consume, because xdjs loaded.
Xdjs says device not online, no consuming

用 Ctrl+c 退出时

终端出现:

^CTraceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/MonitorWidget/MonitorGraphicsView.py", line 82, in slotTaskUpdate
    @pyqtSlot(dict)
KeyboardInterrupt
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/MonitorWidget/MonitorGraphicsView.py", line 82, in slotTaskUpdate
    @pyqtSlot(dict)
KeyboardInterrupt
"Qt Warning - invalid keysym: dead_actute" 

同时弹出窗口显示:

 错误发生在 MainThread

Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/MonitorWidget/MonitorGraphicsView.py", line 82, in slotTaskUpdate
    @pyqtSlot(dict)
KeyboardInterrupt

============================ 结束 ============================

通过窗口关闭无异常。

运行 sudo systemctl start xwared.service 开启服务以后尝试:

  1. 运行 xwared

    cleanPreviousRun LOCK_PATH: Permission denied
    cleanPreviousRun ETM_LOCK_PATH: Permission denied
    pthread listening ok
    xwared: locked.
    pthread listening

  2. 运行 xware-desktop

    "Qt Warning - invalid keysym: dead_actute"
    set local torrent None.
    updated clipboard pattern regex .m4a|.tar.Z|.cab|.taz|.flv|.xlt|.tb2|.tar|.exe|.deb|.doc|.tar.gz|.jar|.ttf|.vob|.msi|.mp3|.tar.bz2|.iso|.sub|.xlsm|.pptm|.wav|.tar.lz|.chm|.cue|.7z|.docx|.webm|.tgz|.rom|.zip|.rm|.odt|.tar.xz|.pptx|.tbz2|.docm|.3gp|.tbz|.flac|.img|.rar|.wmv|.mkv|.wma|.tlz|.wps|.rpm|.ra|.3g2|.wv|.ppt|.tar.lzma|.txt|.bin|.ape|.rmvb|.torrent|.mp4|.rtf|.avi|.m3u|.mp1|.mp2|.txz|.xltx|.ogg|.pdf|.aac|.mov|.epub|.srt|.dmg|.apk
    Try to consume, because xdjs loaded.
    Xdjs says device not online, no consuming
    set local torrent None.
    set local torrent None.
    Try to consume, because mask off.
    Xdjs says device not online, no consuming
    Try to consume, because xdjs loaded.
    Xdjs says device not online, no consuming
    set local torrent None.
    Try to consume, because mask off.
    Xdjs says device not online, no consuming
    Try to consume, because xdjs loaded.
    Xdjs says device not online, no consuming

除了图形界面那个后端可以点以外好像没哟什么区别,尝试下载依然会弹出那个框框。然后我就点了一下重启后端,出现:

Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 106, in slotRestartETM
    sd = self.__prepareSocket()
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 118, in __prepareSocket
    sd.connect(constants.XWARED_SOCKET)
ConnectionRefusedError: [Errno 111] 拒绝连接
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/CrashReport/CrashAwareThreading.py", line 42, in __reportCrash
    if threading.current_thread() == threading.main_thread():
AttributeError: 'module' object has no attribute 'main_thread'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 106, in slotRestartETM
    sd = self.__prepareSocket()
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 118, in __prepareSocket
    sd.connect(constants.XWARED_SOCKET)
ConnectionRefusedError: [Errno 111] 拒绝连接
"Qt Warning - invalid keysym: dead_actute" 

图形界面弹出窗口:

 错误发生在 MainThread

Traceback (most recent call last):
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 106, in slotRestartETM
    sd = self.__prepareSocket()
  File "/usr/share/xware-desktop/frontend/xwaredpy.py", line 118, in __prepareSocket
    sd.connect(constants.XWARED_SOCKET)
ConnectionRefusedError: [Errno 111] 拒绝连接

============================ 结束 ============================

回这个帖子算挖坟吗?? :joy:

话说,这软件还有后文吗?适合小白正常用了吗?

估计烂尾了。

这项目现在是什么样的情况了?