Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151107708
D14550.id42809.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14550.id42809.diff
View Options
Index: head/Tools/scripts/getpatch
===================================================================
--- head/Tools/scripts/getpatch
+++ head/Tools/scripts/getpatch
@@ -134,6 +134,8 @@
URL_BASE = 'https://bugs.freebsd.org/bugzilla/'
URL_SHOW = '{}/show_bug.cgi?id='.format(URL_BASE)
+ REGEX_ATTACHMENTS_TABLE = r'<table id="attachment_table">(.*?)</table>'
+ REGEX_ATTACHMENT_TR = r'(<tr id="a\d+"[^<]+>.*?</tr>)'
REGEX_URL = r'<a href="([^<]+)">Details</a>'
REGEX = r'<div class="details">([^ ]+) \(text/plain(?:; charset=[-\w]+)?\)'
@@ -147,8 +149,7 @@
return None
return match.group(1)
- def _get_patch_urls(self, data):
- patch_urls = {}
+ def _get_patch_url(self, data):
for url in re.findall(self.REGEX_URL, str(data)):
url = '{}{}'.format(self.URL_BASE, url)
file_name = self._get_patch_name(url)
@@ -158,7 +159,20 @@
self.out(msg.format(url))
continue
download_url = url[:url.find('&')]
+ return download_url, file_name
+
+ def _get_patch_urls(self, data):
+ patch_urls = {}
+ match = re.search(self.REGEX_ATTACHMENTS_TABLE, str(data), re.DOTALL)
+ if match is None:
+ return patch_urls
+ table = match.group(1)
+ for tr in re.findall(self.REGEX_ATTACHMENT_TR, str(data), re.DOTALL):
+ if (tr.find('bz_tr_obsolete') >= 0):
+ continue
+ download_url, file_name = self._get_patch_url(tr)
patch_urls[download_url] = file_name
+
return patch_urls
def fetch(self, *largs, **kwargs):
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 3:09 AM (20 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31007911
Default Alt Text
D14550.id42809.diff (1 KB)
Attached To
Mode
D14550: getpatch: do not download obsolete attachments
Attached
Detach File
Event Timeline
Log In to Comment