libpng:update and moved to /usr/lib
[nyanlinux.git] / files / bugz
blob300414e9352c25ed9099f6bd2e80aae0e1e33f93
1 #!/bin/sh
2 #lynx does not support file upload in a multipart/form-data form
3 #bugid file mime desc
4 set -e
6 curl=/nyan/curl/current/bin/curl
8 url=https://bugs.freedesktop.org
10 html=$(mktemp)
11 cookies=$(mktemp)
13 Bugzilla_login_token=
14 while test -z "$Bugzilla_login_token"
16 $curl --silent \
17 --insecure \
18 --cookie $cookies \
19 --cookie-jar $cookies \
20 --output $html \
21 "$url/index.cgi?GoAheadAndLogIn=1"
23 Bugzilla_login_token=$(cat $html | tr -d '\n' | sed 's/^.*Bugzilla_login_token"[[:space:]]\{1,\}value="\([^"]*\)".*$/\1/')
24 echo Bugzilla_login_token=$Bugzilla_login_token
25 sleep 1
26 done
28 Bugzilla_login=sylvain.bertrand\@gmail.com
29 Bugzilla_password=root
31 $curl --silent \
32 --insecure \
33 --cookie $cookies \
34 --cookie-jar $cookies \
35 --data-urlencode "Bugzilla_login=$Bugzilla_login" \
36 --data-urlencode "Bugzilla_password=$Bugzilla_password" \
37 --data-urlencode "Bugzilla_restrictlogin=checked" \
38 --data-urlencode "GoAheadAndLogIn=1" \
39 --data-urlencode "Bugzilla_login_token=$Bugzilla_login_token" \
40 --data-urlencode "GoAheadAndLogIn=Log in" \
41 "$url/index.cgi" >/dev/null
44 #*******************************************************************************
46 sleep 1
47 attachment_token=
48 $curl --silent \
49 --insecure \
50 --cookie $cookies \
51 --cookie-jar $cookies \
52 --output $html \
53 "$url/attachment.cgi?bugid=$1&action=enter"
55 attachment_token=$(cat $html | tr -d '\n' | sed 's/^.*name="token"[[:space:]]\{1,\}value="\([^"]*\)".*$/\1/')
56 echo attachment_token=$attachment_token
57 rm $html
59 if test -z "$attachment_token"; then
60 exit 1
63 sleep 1
64 $curl --silent \
65 --insecure \
66 --cookie $cookies \
67 --cookie-jar $cookies \
68 --form "bugid=$1" \
69 --form "action=insert" \
70 --form "token=$attachment_token" \
71 --form data=@$2 \
72 --form "contenttypemethod=manual" \
73 --form "contenttypeentry=$3" \
74 --form "description=$4" \
75 --form "submit=Submit" \
76 "$url/attachment.cgi" >/dev/null
77 rm $cookies