Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F249
file
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
bapt
Jun 5 2014, 10:37 AM
2014-06-05 10:37:49 (UTC+0)
Size
957 B
Referenced Files
None
Subscribers
None
file
View Options
#!/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
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
204
Default Alt Text
file (957 B)
Attached To
Mode
P8 getpatch
Attached
Detach File
Event Timeline
Log In to Comment