forked from pool/bluez
Accepting request 1195075 from Base:System
OBS-URL: https://build.opensuse.org/request/show/1195075 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bluez?expand=0&rev=206
This commit is contained in:
commit
4db4db560f
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b828d418c93ced1f55b616fb5482cf01537440bfb34fbda1a564f3ece94735d8
|
||||
size 2381208
|
BIN
bluez-5.77.tar.xz
(Stored with Git LFS)
Normal file
BIN
bluez-5.77.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,26 +0,0 @@
|
||||
Index: bluez-5.71/Makefile.in
|
||||
===================================================================
|
||||
--- bluez-5.71.orig/Makefile.in
|
||||
+++ bluez-5.71/Makefile.in
|
||||
@@ -4179,7 +4179,7 @@ unit_tests = $(am__append_68) unit/test-
|
||||
@DEPRECATED_TRUE@@READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \
|
||||
@DEPRECATED_TRUE@@READLINE_TRUE@ src/libshared-glib.la $(GLIB_LIBS) -lreadline
|
||||
|
||||
-@CUPS_TRUE@cupsdir = $(libdir)/cups/backend
|
||||
+@CUPS_TRUE@cupsdir = $(prefix)/lib/cups/backend
|
||||
@CUPS_TRUE@profiles_cups_bluetooth_SOURCES = profiles/cups/main.c \
|
||||
@CUPS_TRUE@ profiles/cups/cups.h \
|
||||
@CUPS_TRUE@ profiles/cups/sdp.c \
|
||||
Index: bluez-5.71/Makefile.tools
|
||||
===================================================================
|
||||
--- bluez-5.71.orig/Makefile.tools
|
||||
+++ bluez-5.71/Makefile.tools
|
||||
@@ -541,7 +541,7 @@ endif
|
||||
endif
|
||||
|
||||
if CUPS
|
||||
-cupsdir = $(libdir)/cups/backend
|
||||
+cupsdir = $(prefix)/lib/cups/backend
|
||||
|
||||
cups_PROGRAMS = profiles/cups/bluetooth
|
||||
|
22
bluez-no-cups-devel-buildreq.patch
Normal file
22
bluez-no-cups-devel-buildreq.patch
Normal file
@ -0,0 +1,22 @@
|
||||
Subject: avoid cups-devel buildrequires
|
||||
Author: Stefan Seyfried <seife+obs@b1-sytems.com>
|
||||
Date: 2024-08-15
|
||||
|
||||
The only thing required from cups-devel during build is the cups_serverbin
|
||||
variable. Unfortunately, pulling in cups-devel creates a huge dependency
|
||||
loop.
|
||||
To avoid this, just hardcode the cups_serverbin value for now.
|
||||
|
||||
Index: b/configure.ac
|
||||
===================================================================
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -252,7 +252,7 @@ AC_ARG_ENABLE(cups, AS_HELP_STRING([--di
|
||||
AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no")
|
||||
if (test "${enable_cups}" != "no"); then
|
||||
AC_MSG_CHECKING([cups directory])
|
||||
- cups_serverbin=`$PKG_CONFIG cups --variable=cups_serverbin`
|
||||
+ cups_serverbin="/usr/lib/cups"
|
||||
AC_MSG_RESULT([${cups_serverbin}])
|
||||
fi
|
||||
AM_CONDITIONAL(CUPS_SERVERBIN, test "${cups_serverbin}" != "")
|
@ -1,601 +0,0 @@
|
||||
Index: bluez-5.65/test/bluezutils.py
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/bluezutils.py
|
||||
+++ bluez-5.65/test/bluezutils.py
|
||||
@@ -17,7 +17,7 @@ def find_adapter(pattern=None):
|
||||
|
||||
def find_adapter_in_objects(objects, pattern=None):
|
||||
bus = dbus.SystemBus()
|
||||
- for path, ifaces in objects.items():
|
||||
+ for path, ifaces in list(objects.items()):
|
||||
adapter = ifaces.get(ADAPTER_INTERFACE)
|
||||
if adapter is None:
|
||||
continue
|
||||
@@ -37,7 +37,7 @@ def find_device_in_objects(objects, devi
|
||||
if adapter_pattern:
|
||||
adapter = find_adapter_in_objects(objects, adapter_pattern)
|
||||
path_prefix = adapter.object_path
|
||||
- for path, ifaces in objects.items():
|
||||
+ for path, ifaces in list(objects.items()):
|
||||
device = ifaces.get(DEVICE_INTERFACE)
|
||||
if device is None:
|
||||
continue
|
||||
Index: bluez-5.65/test/example-advertisement
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/example-advertisement
|
||||
+++ bluez-5.65/test/example-advertisement
|
||||
@@ -164,7 +164,7 @@ def find_adapter(bus):
|
||||
DBUS_OM_IFACE)
|
||||
objects = remote_om.GetManagedObjects()
|
||||
|
||||
- for o, props in objects.items():
|
||||
+ for o, props in list(objects.items()):
|
||||
if LE_ADVERTISING_MANAGER_IFACE in props:
|
||||
return o
|
||||
|
||||
Index: bluez-5.65/test/example-gatt-client
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/example-gatt-client
|
||||
+++ bluez-5.65/test/example-gatt-client
|
||||
@@ -33,7 +33,7 @@ hr_ctrl_pt_chrc = None
|
||||
|
||||
|
||||
def generic_error_cb(error):
|
||||
- print('D-Bus call failed: ' + str(error))
|
||||
+ print(('D-Bus call failed: ' + str(error)))
|
||||
mainloop.quit()
|
||||
|
||||
|
||||
@@ -69,10 +69,10 @@ def sensor_contact_val_to_str(val):
|
||||
|
||||
def body_sensor_val_cb(value):
|
||||
if len(value) != 1:
|
||||
- print('Invalid body sensor location value: ' + repr(value))
|
||||
+ print(('Invalid body sensor location value: ' + repr(value)))
|
||||
return
|
||||
|
||||
- print('Body sensor location value: ' + body_sensor_val_to_str(value[0]))
|
||||
+ print(('Body sensor location value: ' + body_sensor_val_to_str(value[0])))
|
||||
|
||||
|
||||
def hr_msrmt_start_notify_cb():
|
||||
@@ -104,12 +104,12 @@ def hr_msrmt_changed_cb(iface, changed_p
|
||||
hr_msrmt = value[1] | (value[2] << 8)
|
||||
next_ind = 3
|
||||
|
||||
- print('\tHR: ' + str(int(hr_msrmt)))
|
||||
- print('\tSensor Contact status: ' +
|
||||
- sensor_contact_val_to_str(sc_status))
|
||||
+ print(('\tHR: ' + str(int(hr_msrmt))))
|
||||
+ print(('\tSensor Contact status: ' +
|
||||
+ sensor_contact_val_to_str(sc_status)))
|
||||
|
||||
if ee_status:
|
||||
- print('\tEnergy Expended: ' + str(int(value[next_ind])))
|
||||
+ print(('\tEnergy Expended: ' + str(int(value[next_ind]))))
|
||||
|
||||
|
||||
def start_client():
|
||||
@@ -147,7 +147,7 @@ def process_chrc(chrc_path):
|
||||
global hr_ctrl_pt_chrc
|
||||
hr_ctrl_pt_chrc = (chrc, chrc_props)
|
||||
else:
|
||||
- print('Unrecognized characteristic: ' + uuid)
|
||||
+ print(('Unrecognized characteristic: ' + uuid))
|
||||
|
||||
return True
|
||||
|
||||
@@ -162,7 +162,7 @@ def process_hr_service(service_path, chr
|
||||
if uuid != HR_SVC_UUID:
|
||||
return False
|
||||
|
||||
- print('Heart Rate Service found: ' + service_path)
|
||||
+ print(('Heart Rate Service found: ' + service_path))
|
||||
|
||||
# Process the characteristics.
|
||||
for chrc_path in chrc_paths:
|
||||
@@ -199,14 +199,14 @@ def main():
|
||||
chrcs = []
|
||||
|
||||
# List characteristics found
|
||||
- for path, interfaces in objects.items():
|
||||
- if GATT_CHRC_IFACE not in interfaces.keys():
|
||||
+ for path, interfaces in list(objects.items()):
|
||||
+ if GATT_CHRC_IFACE not in list(interfaces.keys()):
|
||||
continue
|
||||
chrcs.append(path)
|
||||
|
||||
# List sevices found
|
||||
- for path, interfaces in objects.items():
|
||||
- if GATT_SERVICE_IFACE not in interfaces.keys():
|
||||
+ for path, interfaces in list(objects.items()):
|
||||
+ if GATT_SERVICE_IFACE not in list(interfaces.keys()):
|
||||
continue
|
||||
|
||||
chrc_paths = [d for d in chrcs if d.startswith(path + "/")]
|
||||
Index: bluez-5.65/test/example-gatt-server
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/example-gatt-server
|
||||
+++ bluez-5.65/test/example-gatt-server
|
||||
@@ -293,7 +293,7 @@ class HeartRateMeasurementChrc(Character
|
||||
min(0xffff, self.service.energy_expended + 1)
|
||||
self.hr_ee_count += 1
|
||||
|
||||
- print('Updating value: ' + repr(value))
|
||||
+ print(('Updating value: ' + repr(value)))
|
||||
|
||||
self.PropertiesChanged(GATT_CHRC_IFACE, { 'Value': value }, [])
|
||||
|
||||
@@ -355,7 +355,7 @@ class HeartRateControlPointChrc(Characte
|
||||
raise InvalidValueLengthException()
|
||||
|
||||
byte = value[0]
|
||||
- print('Control Point value: ' + repr(byte))
|
||||
+ print(('Control Point value: ' + repr(byte)))
|
||||
|
||||
if byte != 1:
|
||||
raise FailedException("0x80")
|
||||
@@ -408,12 +408,12 @@ class BatteryLevelCharacteristic(Charact
|
||||
self.battery_lvl -= 2
|
||||
if self.battery_lvl < 0:
|
||||
self.battery_lvl = 0
|
||||
- print('Battery Level drained: ' + repr(self.battery_lvl))
|
||||
+ print(('Battery Level drained: ' + repr(self.battery_lvl)))
|
||||
self.notify_battery_level()
|
||||
return True
|
||||
|
||||
def ReadValue(self, options):
|
||||
- print('Battery Level read: ' + repr(self.battery_lvl))
|
||||
+ print(('Battery Level read: ' + repr(self.battery_lvl)))
|
||||
return [dbus.Byte(self.battery_lvl)]
|
||||
|
||||
def StartNotify(self):
|
||||
@@ -466,11 +466,11 @@ class TestCharacteristic(Characteristic)
|
||||
CharacteristicUserDescriptionDescriptor(bus, 1, self))
|
||||
|
||||
def ReadValue(self, options):
|
||||
- print('TestCharacteristic Read: ' + repr(self.value))
|
||||
+ print(('TestCharacteristic Read: ' + repr(self.value)))
|
||||
return self.value
|
||||
|
||||
def WriteValue(self, value, options):
|
||||
- print('TestCharacteristic Write: ' + repr(value))
|
||||
+ print(('TestCharacteristic Write: ' + repr(value)))
|
||||
self.value = value
|
||||
|
||||
|
||||
@@ -538,11 +538,11 @@ class TestEncryptCharacteristic(Characte
|
||||
CharacteristicUserDescriptionDescriptor(bus, 3, self))
|
||||
|
||||
def ReadValue(self, options):
|
||||
- print('TestEncryptCharacteristic Read: ' + repr(self.value))
|
||||
+ print(('TestEncryptCharacteristic Read: ' + repr(self.value)))
|
||||
return self.value
|
||||
|
||||
def WriteValue(self, value, options):
|
||||
- print('TestEncryptCharacteristic Write: ' + repr(value))
|
||||
+ print(('TestEncryptCharacteristic Write: ' + repr(value)))
|
||||
self.value = value
|
||||
|
||||
class TestEncryptDescriptor(Descriptor):
|
||||
@@ -584,11 +584,11 @@ class TestSecureCharacteristic(Character
|
||||
CharacteristicUserDescriptionDescriptor(bus, 3, self))
|
||||
|
||||
def ReadValue(self, options):
|
||||
- print('TestSecureCharacteristic Read: ' + repr(self.value))
|
||||
+ print(('TestSecureCharacteristic Read: ' + repr(self.value)))
|
||||
return self.value
|
||||
|
||||
def WriteValue(self, value, options):
|
||||
- print('TestSecureCharacteristic Write: ' + repr(value))
|
||||
+ print(('TestSecureCharacteristic Write: ' + repr(value)))
|
||||
self.value = value
|
||||
|
||||
|
||||
@@ -616,7 +616,7 @@ def register_app_cb():
|
||||
|
||||
|
||||
def register_app_error_cb(error):
|
||||
- print('Failed to register application: ' + str(error))
|
||||
+ print(('Failed to register application: ' + str(error)))
|
||||
mainloop.quit()
|
||||
|
||||
|
||||
@@ -625,8 +625,8 @@ def find_adapter(bus):
|
||||
DBUS_OM_IFACE)
|
||||
objects = remote_om.GetManagedObjects()
|
||||
|
||||
- for o, props in objects.items():
|
||||
- if GATT_MANAGER_IFACE in props.keys():
|
||||
+ for o, props in list(objects.items()):
|
||||
+ if GATT_MANAGER_IFACE in list(props.keys()):
|
||||
return o
|
||||
|
||||
return None
|
||||
Index: bluez-5.65/test/list-devices
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/list-devices
|
||||
+++ bluez-5.65/test/list-devices
|
||||
@@ -33,16 +33,16 @@ def extract_uuids(uuid_list):
|
||||
objects = manager.GetManagedObjects()
|
||||
|
||||
all_devices = (str(path) for path, interfaces in objects.items() if
|
||||
- "org.bluez.Device1" in interfaces.keys())
|
||||
+ "org.bluez.Device1" in list(interfaces.keys()))
|
||||
|
||||
for path, interfaces in objects.items():
|
||||
- if "org.bluez.Adapter1" not in interfaces.keys():
|
||||
+ if "org.bluez.Adapter1" not in list(interfaces.keys()):
|
||||
continue
|
||||
|
||||
print("[ " + path + " ]")
|
||||
|
||||
properties = interfaces["org.bluez.Adapter1"]
|
||||
- for key in properties.keys():
|
||||
+ for key in list(properties.keys()):
|
||||
value = properties[key]
|
||||
if (key == "UUIDs"):
|
||||
list = extract_uuids(value)
|
||||
@@ -58,7 +58,7 @@ for path, interfaces in objects.items():
|
||||
dev = objects[dev_path]
|
||||
properties = dev["org.bluez.Device1"]
|
||||
|
||||
- for key in properties.keys():
|
||||
+ for key in list(properties.keys()):
|
||||
value = properties[key]
|
||||
if (key == "UUIDs"):
|
||||
list = extract_uuids(value)
|
||||
Index: bluez-5.65/test/pbap-client
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/pbap-client
|
||||
+++ bluez-5.65/test/pbap-client
|
||||
@@ -135,11 +135,11 @@ if __name__ == '__main__':
|
||||
print(header)
|
||||
for line in lines:
|
||||
print(line),
|
||||
- print
|
||||
+ print()
|
||||
|
||||
def test_paths(paths):
|
||||
if len(paths) == 0:
|
||||
- print
|
||||
+ print()
|
||||
print("FINISHED")
|
||||
mainloop.quit()
|
||||
return
|
||||
Index: bluez-5.65/test/sap_client.py
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/sap_client.py
|
||||
+++ bluez-5.65/test/sap_client.py
|
||||
@@ -165,7 +165,7 @@ class SAPParam_ConnectionStatus(SAPParam
|
||||
|
||||
def __validate(self):
|
||||
if self.value is not None and self.value not in (0x00, 0x01, 0x02, 0x03, 0x04):
|
||||
- print "Warning. ConnectionStatus value in reserved range (0x%x)" % self.value
|
||||
+ print("Warning. ConnectionStatus value in reserved range (0x%x)" % self.value)
|
||||
|
||||
def deserialize(self, buf):
|
||||
ret = SAPParam.deserialize(self, buf)
|
||||
@@ -183,7 +183,7 @@ class SAPParam_ResultCode(SAPParam):
|
||||
|
||||
def __validate(self):
|
||||
if self.value is not None and self.value not in (0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07):
|
||||
- print "Warning. ResultCode value in reserved range (0x%x)" % self.value
|
||||
+ print("Warning. ResultCode value in reserved range (0x%x)" % self.value)
|
||||
|
||||
def deserialize(self, buf):
|
||||
ret = SAPParam.deserialize(self, buf)
|
||||
@@ -201,7 +201,7 @@ class SAPParam_DisconnectionType(SAPPara
|
||||
|
||||
def __validate(self):
|
||||
if self.value is not None and self.value not in (0x00, 0x01):
|
||||
- print "Warning. DisconnectionType value in reserved range (0x%x)" % self.value
|
||||
+ print("Warning. DisconnectionType value in reserved range (0x%x)" % self.value)
|
||||
|
||||
def deserialize(self, buf):
|
||||
ret = SAPParam.deserialize(self, buf)
|
||||
@@ -227,7 +227,7 @@ class SAPParam_StatusChange(SAPParam):
|
||||
|
||||
def __validate(self):
|
||||
if self.value is not None and self.value not in (0x00, 0x01, 0x02, 0x03, 0x04, 0x05):
|
||||
- print "Warning. StatusChange value in reserved range (0x%x)" % self.value
|
||||
+ print("Warning. StatusChange value in reserved range (0x%x)" % self.value)
|
||||
|
||||
def deserialize(self, buf):
|
||||
ret = SAPParam.deserialize(self, buf)
|
||||
@@ -245,7 +245,7 @@ class SAPParam_TransportProtocol(SAPPara
|
||||
|
||||
def __validate(self):
|
||||
if self.value is not None and self.value not in (0x00, 0x01):
|
||||
- print "Warning. TransportProtoco value in reserved range (0x%x)" % self.value
|
||||
+ print("Warning. TransportProtoco value in reserved range (0x%x)" % self.value)
|
||||
|
||||
def deserialize(self, buf):
|
||||
ret = SAPParam.deserialize(self, buf)
|
||||
@@ -728,7 +728,7 @@ class SAPClient:
|
||||
self.port = first_match["port"]
|
||||
self.host = first_match["host"]
|
||||
|
||||
- print "SAP Service found on %s(%s)" % first_match["name"] % self.host
|
||||
+ print("SAP Service found on %s(%s)" % first_match["name"] % self.host)
|
||||
|
||||
def __connectRFCOMM(self):
|
||||
self.sock=BluetoothSocket( RFCOMM )
|
||||
@@ -739,19 +739,19 @@ class SAPClient:
|
||||
def __sendMsg(self, msg):
|
||||
if isinstance(msg, SAPMessage):
|
||||
s = msg.serialize()
|
||||
- print "\tTX: " + msg.getContent()
|
||||
+ print("\tTX: " + msg.getContent())
|
||||
return self.sock.send(s.tostring())
|
||||
|
||||
def __rcvMsg(self, msg):
|
||||
if isinstance(msg, SAPMessage):
|
||||
- print "\tRX Wait: %s(id = 0x%.2x)" % (msg.name, msg.id)
|
||||
+ print("\tRX Wait: %s(id = 0x%.2x)" % (msg.name, msg.id))
|
||||
data = self.sock.recv(self.bufsize)
|
||||
if data:
|
||||
if msg.deserialize(array('B',data)):
|
||||
- print "\tRX: len(%d) %s" % (len(data), msg.getContent())
|
||||
+ print("\tRX: len(%d) %s" % (len(data), msg.getContent()))
|
||||
return msg
|
||||
else:
|
||||
- print "msg: %s" % array('B',data)
|
||||
+ print("msg: %s" % array('B',data))
|
||||
raise BluetoothError ("Message deserialization failed.")
|
||||
else:
|
||||
raise BluetoothError ("Timeout. No data received.")
|
||||
@@ -797,8 +797,8 @@ class SAPClient:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_disconnectByClient(self, timeout=0):
|
||||
@@ -808,8 +808,8 @@ class SAPClient:
|
||||
time.sleep(timeout) # let srv to close rfcomm
|
||||
self.__disconnectRFCOMM()
|
||||
return True
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_disconnectByServer(self, timeout=0):
|
||||
@@ -823,8 +823,8 @@ class SAPClient:
|
||||
|
||||
return self.proc_disconnectByClient(timeout)
|
||||
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_transferAPDU(self, apdu = "Sample APDU command"):
|
||||
@@ -832,8 +832,8 @@ class SAPClient:
|
||||
self.__sendMsg(SAPMessage_TRANSFER_APDU_REQ(apdu))
|
||||
params = self.__rcvMsg(SAPMessage_TRANSFER_APDU_RESP()).getParams()
|
||||
return True
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_transferATR(self):
|
||||
@@ -841,8 +841,8 @@ class SAPClient:
|
||||
self.__sendMsg(SAPMessage_TRANSFER_ATR_REQ())
|
||||
params = self.__rcvMsg(SAPMessage_TRANSFER_ATR_RESP()).getParams()
|
||||
return True
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_powerSimOff(self):
|
||||
@@ -850,8 +850,8 @@ class SAPClient:
|
||||
self.__sendMsg(SAPMessage_POWER_SIM_OFF_REQ())
|
||||
params = self.__rcvMsg(SAPMessage_POWER_SIM_OFF_RESP()).getParams()
|
||||
return True
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_powerSimOn(self):
|
||||
@@ -862,8 +862,8 @@ class SAPClient:
|
||||
return self.proc_transferATR()
|
||||
|
||||
return True
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_resetSim(self):
|
||||
@@ -874,23 +874,23 @@ class SAPClient:
|
||||
return self.proc_transferATR()
|
||||
|
||||
return True
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_reportStatus(self):
|
||||
try:
|
||||
params = self.__rcvMsg(SAPMessage_STATUS_IND()).getParams()
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_transferCardReaderStatus(self):
|
||||
try:
|
||||
self.__sendMsg(SAPMessage_TRANSFER_CARD_READER_STATUS_REQ())
|
||||
params = self.__rcvMsg(SAPMessage_TRANSFER_CARD_READER_STATUS_RESP()).getParams()
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_errorResponse(self):
|
||||
@@ -899,8 +899,8 @@ class SAPClient:
|
||||
self.__sendMsg(SAPMessage_CONNECT_REQ())
|
||||
|
||||
params = self.__rcvMsg(SAPMessage_ERROR_RESP()).getParams()
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
def proc_setTransportProtocol(self, protocol = 0):
|
||||
@@ -922,8 +922,8 @@ class SAPClient:
|
||||
else:
|
||||
return False
|
||||
|
||||
- except BluetoothError , e:
|
||||
- print "Error. " +str(e)
|
||||
+ except BluetoothError as e:
|
||||
+ print("Error. " +str(e))
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
Index: bluez-5.65/test/simple-agent
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/simple-agent
|
||||
+++ bluez-5.65/test/simple-agent
|
||||
@@ -24,9 +24,9 @@ dev_path = None
|
||||
|
||||
def ask(prompt):
|
||||
try:
|
||||
- return raw_input(prompt)
|
||||
- except:
|
||||
return input(prompt)
|
||||
+ except:
|
||||
+ return eval(input(prompt))
|
||||
|
||||
def set_trusted(path):
|
||||
props = dbus.Interface(bus.get_object("org.bluez", path),
|
||||
Index: bluez-5.65/test/simple-player
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/simple-player
|
||||
+++ bluez-5.65/test/simple-player
|
||||
@@ -119,7 +119,7 @@ class InputHandler:
|
||||
return True
|
||||
|
||||
try:
|
||||
- exec "self.player.%s" % s
|
||||
+ exec("self.player.%s" % s)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
Index: bluez-5.65/test/test-adapter
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/test-adapter
|
||||
+++ bluez-5.65/test/test-adapter
|
||||
@@ -69,7 +69,7 @@ if (args[0] == "list"):
|
||||
|
||||
props = interfaces["org.bluez.Adapter1"]
|
||||
|
||||
- for (key, value) in props.items():
|
||||
+ for (key, value) in list(props.items()):
|
||||
if (key == "Class"):
|
||||
print(" %s = 0x%06x" % (key, value))
|
||||
else:
|
||||
Index: bluez-5.65/test/test-discovery
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/test-discovery
|
||||
+++ bluez-5.65/test/test-discovery
|
||||
@@ -39,10 +39,10 @@ def print_compact(address, properties):
|
||||
def print_normal(address, properties):
|
||||
print("[ " + address + " ]")
|
||||
|
||||
- for key in properties.keys():
|
||||
+ for key in list(properties.keys()):
|
||||
value = properties[key]
|
||||
if type(value) is dbus.String:
|
||||
- value = unicode(value).encode('ascii', 'replace')
|
||||
+ value = str(value).encode('ascii', 'replace')
|
||||
if (key == "Class"):
|
||||
print(" %s = 0x%06x" % (key, value))
|
||||
else:
|
||||
@@ -71,7 +71,7 @@ def interfaces_added(path, interfaces):
|
||||
|
||||
if compact and skip_dev(dev, properties):
|
||||
return
|
||||
- devices[path] = dict(devices[path].items() + properties.items())
|
||||
+ devices[path] = dict(list(devices[path].items()) + list(properties.items()))
|
||||
else:
|
||||
devices[path] = properties
|
||||
|
||||
@@ -94,7 +94,7 @@ def properties_changed(interface, change
|
||||
|
||||
if compact and skip_dev(dev, changed):
|
||||
return
|
||||
- devices[path] = dict(devices[path].items() + changed.items())
|
||||
+ devices[path] = dict(list(devices[path].items()) + list(changed.items()))
|
||||
else:
|
||||
devices[path] = changed
|
||||
|
||||
Index: bluez-5.65/test/test-hfp
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/test-hfp
|
||||
+++ bluez-5.65/test/test-hfp
|
||||
@@ -186,7 +186,7 @@ class HfpProfile(dbus.service.Object):
|
||||
version = 0x0105
|
||||
features = 0
|
||||
print("NewConnection(%s, %d)" % (path, fd))
|
||||
- for key in properties.keys():
|
||||
+ for key in list(properties.keys()):
|
||||
if key == "Version":
|
||||
version = properties[key]
|
||||
elif key == "Features":
|
||||
Index: bluez-5.65/test/test-profile
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/test-profile
|
||||
+++ bluez-5.65/test/test-profile
|
||||
@@ -34,7 +34,7 @@ class Profile(dbus.service.Object):
|
||||
def NewConnection(self, path, fd, properties):
|
||||
self.fd = fd.take()
|
||||
print("NewConnection(%s, %d)" % (path, self.fd))
|
||||
- for key in properties.keys():
|
||||
+ for key in list(properties.keys()):
|
||||
if key == "Version" or key == "Features":
|
||||
print(" %s = 0x%04x" % (key, properties[key]))
|
||||
else:
|
||||
Index: bluez-5.65/test/map-client
|
||||
===================================================================
|
||||
--- bluez-5.65.orig/test/map-client
|
||||
+++ bluez-5.65/test/map-client
|
||||
@@ -27,7 +27,7 @@ def unwrap(x):
|
||||
printed. Taken from d-feet """
|
||||
|
||||
if isinstance(x, list):
|
||||
- return map(unwrap, x)
|
||||
+ return list(map(unwrap, x))
|
||||
|
||||
if isinstance(x, tuple):
|
||||
return tuple(map(unwrap, x))
|
||||
@@ -35,7 +35,7 @@ def unwrap(x):
|
||||
if isinstance(x, dict):
|
||||
return dict([(unwrap(k), unwrap(v)) for k, v in x.items()])
|
||||
|
||||
- for t in [unicode, str, long, int, float, bool]:
|
||||
+ for t in [str, str, int, int, float, bool]:
|
||||
if isinstance(x, t):
|
||||
return t(x)
|
||||
|
@ -1,3 +1,56 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 15 06:51:24 UTC 2024 - Stefan Seyfried <seife+obs@b1-systems.com>
|
||||
|
||||
- add bluez-no-cups-devel-buildreq.patch to avoid cups-devel
|
||||
buildrequires which results in an excessive build loop
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 5 12:12:11 UTC 2024 - Dirk Müller <dmueller@suse.com>
|
||||
|
||||
- update to 5.77:
|
||||
* Fix issue with storing and handling connection parameters.
|
||||
* Fix issue with handling device that are marked as temporary.
|
||||
* Fix issue with HID and special handling for non-keyboards.
|
||||
* Fix issue with BR/EDR not support when discoverable is off.
|
||||
* Add support for initial implementation of ASHA profile.
|
||||
* Fix issue with broadcast channel location and stream
|
||||
capabilities.
|
||||
* Fix issue with handling BIS management and synchronization.
|
||||
* Fix issue with handling Extended Advertising.
|
||||
* Fix issue with UserspaceHID and replay structures.
|
||||
* Add support for providing PPCP characteristic.
|
||||
* Fix issue with build system and header inclusion.
|
||||
* Fix issue with not enabling Wideband Speech when available.
|
||||
* Fix issue with UserspaceHID and Bluetooth Classic devices.
|
||||
* Fix issue with checking for services being connected.
|
||||
* Fix issue with GATT client connection creation.
|
||||
* Fix issue with OBEX and small file transfers.
|
||||
* Fix issue with handling pairing with Apple AirPods.
|
||||
* Fix issue with BAP and setting up broadcast source.
|
||||
* Fix issue with BAP and register all endpoints.
|
||||
* Fix issue with BAP and missing metadata property.
|
||||
* Fix issue with BAP and not handling out of order responses.
|
||||
* Fix issue with BAP and attempting to set device as
|
||||
connectable.
|
||||
* Add support for CCP plugin for call control profile.
|
||||
* Fix issue with BAP and handling stream IO linking.
|
||||
* Fix issue with BAP and setup of multiple streams per
|
||||
endpoint.
|
||||
* Fix issue with AVDTP and potential incorrect transaction
|
||||
label.
|
||||
* Fix issue with A2DP and handling crash on suspend.
|
||||
* Fix issue with GATT database and an invalid pointer.
|
||||
* Add support for AICS service.
|
||||
- drop bluez-test-2to3.diff, bluez-cups-libexec.patch:
|
||||
upstream has different solutions for ages, use those instead
|
||||
- drop fix-link-key-address-type.patch,
|
||||
fix-a2dp-suspend-crash.patch: upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 5 00:03:24 UTC 2024 - Chang <calad0i.fill@outlook.com>
|
||||
|
||||
- add fix-a2dp-suspend-crash.patch (Issue #701 in upstream)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jun 11 09:15:31 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
|
23
bluez.spec
23
bluez.spec
@ -35,7 +35,7 @@
|
||||
%endif
|
||||
|
||||
Name: bluez
|
||||
Version: 5.71
|
||||
Version: 5.77
|
||||
Release: 0
|
||||
Summary: Bluetooth Stack for Linux
|
||||
License: GPL-2.0-or-later
|
||||
@ -50,16 +50,12 @@ Source9: bluez.changes.sle
|
||||
# fix some logitech HID devices, bnc#681049, bnc#850478 --seife+obs@b1-systems.com
|
||||
Patch1: bluez-5.11-logitech-hid2hci.patch
|
||||
Patch2: bluez-sdp-unix-path.patch
|
||||
# PATCH-FIX-UPSTREAM: find the cups dir in libexec not in libdir
|
||||
Patch3: bluez-cups-libexec.patch
|
||||
# avoid cups-devel buildrequires --seife+obs@b1-systems.com
|
||||
Patch3: bluez-no-cups-devel-buildreq.patch
|
||||
# workaround for broken tests (reported upstream but not yet fixed)
|
||||
Patch4: bluez-disable-broken-tests.diff
|
||||
# PATCH-FIX-UPSTREAM: taken from https://github.com/bluez/bluez/commit/7ad5669402c9acff8e4cc808edc12a41df36654e -- Fix for broken pairing in 5.71
|
||||
Patch5: fix-link-key-address-type.patch
|
||||
# disable tests for bypass boo#1078285
|
||||
Patch12: disable_some_obex_tests.patch
|
||||
# get rid of python2. WARNING: this is autogenerated by 2to3 and might not work
|
||||
Patch13: bluez-test-2to3.diff
|
||||
# bsc#1013708 CVE-2016-9797
|
||||
Patch14: hcidump-Add-assoc-dump-function-assoc-date-length-ch.patch
|
||||
# bsc#1015171 CVE-2016-9917
|
||||
@ -85,6 +81,8 @@ BuildRequires: readline-devel
|
||||
BuildRequires: systemd-rpm-macros
|
||||
BuildRequires: pkgconfig(alsa)
|
||||
BuildRequires: pkgconfig(check)
|
||||
## we use bluez-no-cups-devel-buildreq.patch instead to avoid a build loop
|
||||
# BuildRequires: pkgconfig(cups)
|
||||
BuildRequires: pkgconfig(dbus-1) >= 1.6
|
||||
BuildRequires: pkgconfig(glib-2.0) >= 2.28
|
||||
BuildRequires: pkgconfig(libcap-ng)
|
||||
@ -94,6 +92,7 @@ BuildRequires: pkgconfig(sndfile)
|
||||
BuildRequires: pkgconfig(udev)
|
||||
# for rst2man
|
||||
BuildRequires: python3-docutils
|
||||
BuildRequires: python3-Pygments
|
||||
# libgio-2_0-0 has a runtime dependency on shared-mime-info, which is not
|
||||
# required for building here, but causes a build loop
|
||||
#!BuildIgnore: shared-mime-info
|
||||
@ -392,9 +391,6 @@ done
|
||||
%{_bindir}/hex2hcd
|
||||
%{_bindir}/isotest
|
||||
%{_bindir}/mpris-proxy
|
||||
%dir %{_libdir}/bluetooth
|
||||
%dir %{_libdir}/bluetooth/plugins
|
||||
%{_libdir}/bluetooth/plugins/sixaxis.so
|
||||
%dir %{_libexecdir}/bluetooth
|
||||
%{_libexecdir}/bluetooth/bluetoothd
|
||||
%if %{with mesh}
|
||||
@ -416,6 +412,7 @@ done
|
||||
%{_mandir}/man1/hid2hci.1%{?ext_man}
|
||||
%{_mandir}/man1/l2ping.1%{?ext_man}
|
||||
%{_mandir}/man1/rctest.1%{?ext_man}
|
||||
%{_mandir}/man1/bluetoothctl.1%{?ext_man}
|
||||
%{_mandir}/man1/bluetoothctl-mgmt.1%{?ext_man}
|
||||
%{_mandir}/man1/bluetoothctl-monitor.1%{?ext_man}
|
||||
%{_mandir}/man1/bluetoothctl-admin.1%{?ext_man}
|
||||
@ -440,11 +437,15 @@ done
|
||||
%{_datadir}/dbus-1/system-services/org.bluez.service
|
||||
# not packaged, boo#1151518
|
||||
###%%{_datadir}/dbus-1/system-services/org.bluez.mesh.service
|
||||
%{_sysconfdir}/bluetooth/input.conf
|
||||
%{_sysconfdir}/bluetooth/mesh-main.conf
|
||||
%{_sysconfdir}/bluetooth/network.conf
|
||||
|
||||
%files obexd
|
||||
%{_libexecdir}/bluetooth/obexd
|
||||
%{_datadir}/dbus-1/services/org.bluez.obex.service
|
||||
%{_userunitdir}/obex.service
|
||||
%{_userunitdir}/dbus-org.bluez.obex.service
|
||||
|
||||
%if %{with bluez_deprecated}
|
||||
%files deprecated
|
||||
@ -463,6 +464,7 @@ done
|
||||
%{_mandir}/man1/sdptool.1%{?ext_man}
|
||||
%{_mandir}/man1/ciptool.1%{?ext_man}
|
||||
%{_mandir}/man1/rfcomm.1%{?ext_man}
|
||||
%{_mandir}/man7/rfcomm.7%{?ext_man}
|
||||
%endif
|
||||
|
||||
%files devel
|
||||
@ -488,6 +490,7 @@ done
|
||||
%{_bindir}/btgatt-client
|
||||
%dir %{_libdir}/bluez
|
||||
%{_libdir}/bluez/test
|
||||
%{_mandir}/man7/l2cap.7%{?ext_man}
|
||||
|
||||
%files auto-enable-devices
|
||||
%dir %{_sysconfdir}/bluetooth
|
||||
|
@ -1,163 +0,0 @@
|
||||
From 7ad5669402c9acff8e4cc808edc12a41df36654e Mon Sep 17 00:00:00 2001
|
||||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
||||
Date: Wed, 20 Dec 2023 12:20:03 -0500
|
||||
Subject: [PATCH] adapter: Fix link key address type for old kernels
|
||||
|
||||
On old kernels only BDADDR_BREDR is supported so this attempts to detect
|
||||
that and retry.
|
||||
|
||||
Fixes: https://github.com/bluez/bluez/issues/686
|
||||
---
|
||||
src/adapter.c | 59 ++++++++++++++++++++++++++++++++++++++-------------
|
||||
1 file changed, 44 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/adapter.c b/src/adapter.c
|
||||
index ee70b00d2..022390f0d 100644
|
||||
--- a/src/adapter.c
|
||||
+++ b/src/adapter.c
|
||||
@@ -311,6 +311,7 @@ struct btd_adapter {
|
||||
bool pincode_requested; /* PIN requested during last bonding */
|
||||
GSList *connections; /* Connected devices */
|
||||
GSList *devices; /* Devices structure pointers */
|
||||
+ GSList *load_keys; /* Devices keys to be loaded */
|
||||
GSList *connect_list; /* Devices to connect when found */
|
||||
struct btd_device *connect_le; /* LE device waiting to be connected */
|
||||
sdp_list_t *services; /* Services associated to adapter */
|
||||
@@ -4284,6 +4285,9 @@ static int set_privacy(struct btd_adapter *adapter, uint8_t privacy)
|
||||
return -1;
|
||||
}
|
||||
|
||||
+static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
|
||||
+ bool retry);
|
||||
+
|
||||
static void load_link_keys_complete(uint8_t status, uint16_t length,
|
||||
const void *param, void *user_data)
|
||||
{
|
||||
@@ -4293,18 +4297,31 @@ static void load_link_keys_complete(uint8_t status, uint16_t length,
|
||||
btd_error(adapter->dev_id,
|
||||
"Failed to load link keys for hci%u: %s (0x%02x)",
|
||||
adapter->dev_id, mgmt_errstr(status), status);
|
||||
+
|
||||
+ if (status == MGMT_STATUS_INVALID_PARAMS) {
|
||||
+ load_link_keys(adapter, btd_opts.debug_keys, true);
|
||||
+ /* Release keys after retry since we shall only retry
|
||||
+ * once.
|
||||
+ */
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
return;
|
||||
}
|
||||
|
||||
DBG("link keys loaded for hci%u", adapter->dev_id);
|
||||
+
|
||||
+done:
|
||||
+ g_slist_free_full(adapter->load_keys, g_free);
|
||||
+ adapter->load_keys = NULL;
|
||||
}
|
||||
|
||||
-static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
|
||||
- bool debug_keys)
|
||||
+static void load_link_keys(struct btd_adapter *adapter, bool debug_keys,
|
||||
+ bool retry)
|
||||
{
|
||||
struct mgmt_cp_load_link_keys *cp;
|
||||
struct mgmt_link_key_info *key;
|
||||
- size_t key_count, cp_size;
|
||||
+ size_t count, cp_size;
|
||||
unsigned int id;
|
||||
GSList *l;
|
||||
|
||||
@@ -4318,12 +4335,14 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
|
||||
if (!(adapter->supported_settings & MGMT_SETTING_BREDR))
|
||||
return;
|
||||
|
||||
- key_count = g_slist_length(keys);
|
||||
+ count = g_slist_length(adapter->load_keys);
|
||||
+ if (!count)
|
||||
+ return;
|
||||
|
||||
- DBG("hci%u keys %zu debug_keys %d", adapter->dev_id, key_count,
|
||||
- debug_keys);
|
||||
+ DBG("hci%u keys %zu debug_keys %d retry %s", adapter->dev_id, count,
|
||||
+ debug_keys, retry ? "true" : "false");
|
||||
|
||||
- cp_size = sizeof(*cp) + (key_count * sizeof(*key));
|
||||
+ cp_size = sizeof(*cp) + (count * sizeof(*key));
|
||||
|
||||
cp = g_try_malloc0(cp_size);
|
||||
if (cp == NULL) {
|
||||
@@ -4341,13 +4360,18 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
|
||||
* behavior for debug keys.
|
||||
*/
|
||||
cp->debug_keys = debug_keys;
|
||||
- cp->key_count = htobs(key_count);
|
||||
+ cp->key_count = htobs(count);
|
||||
|
||||
- for (l = keys, key = cp->keys; l != NULL; l = g_slist_next(l), key++) {
|
||||
+ for (l = adapter->load_keys, key = cp->keys; l != NULL;
|
||||
+ l = g_slist_next(l), key++) {
|
||||
struct link_key_info *info = l->data;
|
||||
|
||||
bacpy(&key->addr.bdaddr, &info->bdaddr);
|
||||
- key->addr.type = info->bdaddr_type;
|
||||
+ /* Old kernels might only support loading with type set to
|
||||
+ * BDADDR_BREDR so on retry set that instead of using the stored
|
||||
+ * info.
|
||||
+ */
|
||||
+ key->addr.type = retry ? BDADDR_BREDR : info->bdaddr_type;
|
||||
key->type = info->type;
|
||||
memcpy(key->val, info->key, 16);
|
||||
key->pin_len = info->pin_len;
|
||||
@@ -4359,9 +4383,12 @@ static void load_link_keys(struct btd_adapter *adapter, GSList *keys,
|
||||
|
||||
g_free(cp);
|
||||
|
||||
- if (id == 0)
|
||||
+ if (id == 0) {
|
||||
btd_error(adapter->dev_id, "Failed to load link keys for hci%u",
|
||||
adapter->dev_id);
|
||||
+ g_slist_free_full(adapter->load_keys, g_free);
|
||||
+ adapter->load_keys = NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
static void load_ltks_complete(uint8_t status, uint16_t length,
|
||||
@@ -4873,7 +4900,6 @@ static void load_defaults(struct btd_adapter *adapter)
|
||||
static void load_devices(struct btd_adapter *adapter)
|
||||
{
|
||||
char dirname[PATH_MAX];
|
||||
- GSList *keys = NULL;
|
||||
GSList *ltks = NULL;
|
||||
GSList *irks = NULL;
|
||||
GSList *params = NULL;
|
||||
@@ -4964,7 +4990,8 @@ static void load_devices(struct btd_adapter *adapter)
|
||||
}
|
||||
|
||||
if (key_info)
|
||||
- keys = g_slist_append(keys, key_info);
|
||||
+ adapter->load_keys = g_slist_append(adapter->load_keys,
|
||||
+ key_info);
|
||||
|
||||
if (ltk_info)
|
||||
ltks = g_slist_append(ltks, ltk_info);
|
||||
@@ -5013,8 +5040,7 @@ static void load_devices(struct btd_adapter *adapter)
|
||||
|
||||
closedir(dir);
|
||||
|
||||
- load_link_keys(adapter, keys, btd_opts.debug_keys);
|
||||
- g_slist_free_full(keys, g_free);
|
||||
+ load_link_keys(adapter, btd_opts.debug_keys, false);
|
||||
|
||||
load_ltks(adapter, ltks);
|
||||
g_slist_free_full(ltks, g_free);
|
||||
@@ -6930,6 +6956,9 @@ static void adapter_remove(struct btd_adapter *adapter)
|
||||
g_slist_free(adapter->devices);
|
||||
adapter->devices = NULL;
|
||||
|
||||
+ g_slist_free(adapter->load_keys);
|
||||
+ adapter->load_keys = NULL;
|
||||
+
|
||||
discovery_cleanup(adapter, 0);
|
||||
|
||||
unload_drivers(adapter);
|
Loading…
Reference in New Issue
Block a user