Skip to content

Commit b82a929

Browse files
committed
Fix some lintian warnings
1 parent b6b6d67 commit b82a929

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

backend/aptdaemon/conf/com.ubuntukylin.softwarecenter.conf

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212

1313
<!-- Allow anyone to invoke methods on the interfaces -->
1414
<policy context="default">
15-
<allow send_interface="com.ubuntukylin.softwarecenter"/>
1615
<allow send_destination="com.ubuntukylin.softwarecenter"
17-
send_interface="org.freedesktop.DBus.Introspectable"/>
16+
send_interface="com.ubuntukylin.softwarecenter"/>
17+
<allow send_destination="com.ubuntukylin.softwarecenter"
18+
send_interface="org.freedesktop.DBus.Introspectable"/>
1819
<allow send_destination="com.ubuntukylin.softwarecenter"
19-
send_interface="org.freedesktop.DBus.Properties"/>
20+
send_interface="org.freedesktop.DBus.Properties"/>
2021
</policy>
2122
</busconfig>

ubuntu_kylin_software_center_daemon/apt_dbus_service.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
HTTP_SOURCE_UBUNTUKYLIN = "http://archive.ubuntukylin.com:10006/ubuntukylin"
6060
DEB_SOURCE_UBUNTUKYLIN = "deb " + HTTP_SOURCE_UBUNTUKYLIN
6161
UBUNTUKYLIN_SOFTWARECENTER_ACTION = 'com.ubuntukylin.softwarecenter.action'
62-
62+
LIB_PATH = "/var/lib/"
63+
DPKG_PATH = LIB_PATH + "dpkg/lock"
6364

6465
class WorkItem:
6566
def __init__(self, pkgname, action, kwargs):
@@ -87,7 +88,7 @@ def run(self):
8788
time.sleep(0.5)
8889
continue
8990

90-
if is_file_locked("/var/lib/dpkg/lock") is True or 1 == self.uksc_is_working:
91+
if is_file_locked(DPKG_PATH) is True or 1 == self.uksc_is_working:
9192
time.sleep(0.5)
9293
continue
9394

@@ -128,7 +129,8 @@ def is_file_locked(lockfile):
128129
"""
129130
Check whether ``apt-get`` or ``dpkg`` is currently active by check the lock file.
130131
131-
This works by checking whether the lock file like ``/var/lib/dpkg/lock``
132+
This works by checking whether the lock file like ``/var/lib/
133+
dpkg/lock``
132134
``/var/lib/apt/lists/lock`` is locked by an ``apt-get`` or ``dpkg`` process,
133135
which in turn is done by momentarily trying to acquire the lock.
134136
This means that the current process needs to have sufficient privileges.
@@ -590,7 +592,7 @@ def check_work_item(self):
590592
if len(self.worklist) != 0:
591593
workitemcount = len(self.worklist)
592594
self.mutex.release()
593-
dpkg_is_running = is_file_locked("/var/lib/dpkg/lock")
595+
dpkg_is_running = is_file_locked(DPKG_PATH)
594596
if dpkg_is_running is True:
595597
dpkg_is_running = 1
596598
else:

0 commit comments

Comments
 (0)