mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-28 18:56:15 +01:00
Add config option for the Package.status mtime heuristic
By default, the "status_mtime_heuristic" config option is disabled.
This commit is contained in:
parent
0f820e1fd5
commit
48a35fed91
@ -180,7 +180,10 @@ DEFAULTS = {'apiurl': 'https://api.opensuse.org',
|
|||||||
'maintained_update_project_attribute': 'OBS:UpdateProject',
|
'maintained_update_project_attribute': 'OBS:UpdateProject',
|
||||||
'show_download_progress': '0',
|
'show_download_progress': '0',
|
||||||
# path to the vc script
|
# path to the vc script
|
||||||
'vc-cmd': '/usr/lib/build/vc'
|
'vc-cmd': '/usr/lib/build/vc',
|
||||||
|
|
||||||
|
# heuristic to speedup Package.status
|
||||||
|
'status_mtime_heuristic': '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
# some distros like Debian rename and move build to obs-build
|
# some distros like Debian rename and move build to obs-build
|
||||||
@ -196,7 +199,8 @@ config = DEFAULTS.copy()
|
|||||||
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd',
|
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd',
|
||||||
'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive',
|
'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive',
|
||||||
'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check',
|
'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check',
|
||||||
'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time', 'no_preinstallimage']
|
'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time', 'no_preinstallimage',
|
||||||
|
'status_mtime_heuristic']
|
||||||
|
|
||||||
api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj']
|
api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj']
|
||||||
|
|
||||||
|
@ -1843,7 +1843,6 @@ class Package:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
alwaysdigest = False
|
|
||||||
known_by_meta = False
|
known_by_meta = False
|
||||||
exists = False
|
exists = False
|
||||||
exists_in_store = False
|
exists_in_store = False
|
||||||
@ -1867,10 +1866,12 @@ class Package:
|
|||||||
state = 'A'
|
state = 'A'
|
||||||
elif exists and exists_in_store and known_by_meta:
|
elif exists and exists_in_store and known_by_meta:
|
||||||
filemeta = self.findfilebyname(n)
|
filemeta = self.findfilebyname(n)
|
||||||
if (alwaysdigest or os.path.getmtime(localfile) != filemeta.mtime) and dgst(localfile) != filemeta.md5:
|
state = ' '
|
||||||
|
if conf.config['status_mtime_heuristic']:
|
||||||
|
if os.path.getmtime(localfile) != filemeta.mtime:
|
||||||
|
state = 'M'
|
||||||
|
elif dgst(localfile) != filemeta.md5:
|
||||||
state = 'M'
|
state = 'M'
|
||||||
else:
|
|
||||||
state = ' '
|
|
||||||
elif n in self.to_be_added and not exists:
|
elif n in self.to_be_added and not exists:
|
||||||
state = '!'
|
state = '!'
|
||||||
elif not exists and exists_in_store and known_by_meta and not n in self.to_be_deleted:
|
elif not exists and exists_in_store and known_by_meta and not n in self.to_be_deleted:
|
||||||
|
Loading…
Reference in New Issue
Block a user