Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P8
getpatch
Active
Public
Actions
Authored by
bapt
on Jun 5 2014, 10:37 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F249: file
Jun 5 2014, 10:37 AM
2014-06-05 10:37:49 (UTC+0)
Subscribers
None
#!/bin/sh
fget
()
{
fetch
-q
--no-verify-peer
-o
-
"https://bugs.freebsd.org/bugzilla/jsonrpc.cgi?method=Bug.attachments¶ms=[{\"ids\": [\"
$1
\"]}]"
}
patch
=
$1
res
=
$(
fget
$patch
)
error
=
$(
echo
$res
|
jshon
-e
error
-t
)
if
[
$error
=
"object"
]
;
then
echo
$res
|
jshon
-e
error
-e
message
exit
1
fi
nbattach
=
$(
echo
$res
|
jshon
-e
result
-e
bugs
-e
$patch
-l
)
if
[
$nbattach
-eq
0
]
;
then
echo
"No attachement found for #
$patch
"
exit
1
fi
i
=
0
while
[
$i
-lt
$nbattach
]
;
do
obsolete
=
$(
echo
$res
|
jshon
-e
result
-e
bugs
-e
$patch
-e
$i
-e
is_obsolete
)
if
[
$obsolete
-eq
1
]
;
then
continue
fi
filename
=
$(
echo
$res
|
jshon
-e
result
-e
bugs
-e
$patch
-e
$i
-e
file_name
-u
)
data
=
$(
echo
$res
|
jshon
-e
result
-e
bugs
-e
$patch
-e
$i
-e
data
-u
)
echo
"Creating
$filename
"
echo
"
${
data
}
=="
|
b64decode
-r
>
$filename
i
=
$((
$i
+
1
))
done
Event Timeline
bapt
edited the content of this paste.
(Show Details)
Jun 5 2014, 10:37 AM
2014-06-05 10:37:49 (UTC+0)
bapt
updated the paste's language from
autodetect
to
bash
.
bapt
changed the visibility from "All Users" to "Public (No Login Required)".
bapt
changed the title of this paste from untitled to
getpatch
.
wma
mentioned this in
D12421: Compile loader as Little-Endian on PPC64/POWER8
.
Sep 22 2017, 11:30 AM
2017-09-22 11:30:44 (UTC+0)
wma
mentioned this in
D15566: Make opal_pci driver work with POWER9
.
May 25 2018, 4:32 AM
2018-05-25 04:32:35 (UTC+0)
bdragon
mentioned this in
D17183: Fix random DMA failure on powernv
.
Sep 17 2018, 6:44 PM
2018-09-17 18:44:54 (UTC+0)
kbowling
mentioned this in
D17407: Enable TCP Fast Open support on PPC
.
Oct 5 2018, 12:21 AM
2018-10-05 00:21:09 (UTC+0)
Log In to Comment