Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
da19f302
Unverified
Commit
da19f302
authored
Apr 05, 2019
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: nuke geth bug, nobody is using it anyway
parent
ee376f67
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
160 deletions
+0
-160
bugcmd.go
cmd/geth/bugcmd.go
+0
-113
main.go
cmd/geth/main.go
+0
-1
browser.go
cmd/internal/browser/browser.go
+0
-46
No files found.
cmd/geth/bugcmd.go
deleted
100644 → 0
View file @
ee376f67
// Copyright 2017 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// go-ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
package
main
import
(
"bytes"
"fmt"
"io"
"io/ioutil"
"net/url"
"os/exec"
"runtime"
"strings"
"github.com/ethereum/go-ethereum/cmd/internal/browser"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/cmd/utils"
cli
"gopkg.in/urfave/cli.v1"
)
var
bugCommand
=
cli
.
Command
{
Action
:
utils
.
MigrateFlags
(
reportBug
),
Name
:
"bug"
,
Usage
:
"opens a window to report a bug on the geth repo"
,
ArgsUsage
:
" "
,
Category
:
"MISCELLANEOUS COMMANDS"
,
}
const
issueURL
=
"https://github.com/ethereum/go-ethereum/issues/new"
// reportBug reports a bug by opening a new URL to the go-ethereum GH issue
// tracker and setting default values as the issue body.
func
reportBug
(
ctx
*
cli
.
Context
)
error
{
// execute template and write contents to buff
var
buff
bytes
.
Buffer
fmt
.
Fprintln
(
&
buff
,
"#### System information"
)
fmt
.
Fprintln
(
&
buff
)
fmt
.
Fprintln
(
&
buff
,
"Version:"
,
params
.
VersionWithMeta
)
fmt
.
Fprintln
(
&
buff
,
"Go Version:"
,
runtime
.
Version
())
fmt
.
Fprintln
(
&
buff
,
"OS:"
,
runtime
.
GOOS
)
printOSDetails
(
&
buff
)
fmt
.
Fprintln
(
&
buff
,
header
)
// open a new GH issue
if
!
browser
.
Open
(
issueURL
+
"?body="
+
url
.
QueryEscape
(
buff
.
String
()))
{
fmt
.
Printf
(
"Please file a new issue at %s using this template:
\n\n
%s"
,
issueURL
,
buff
.
String
())
}
return
nil
}
// copied from the Go source. Copyright 2017 The Go Authors
func
printOSDetails
(
w
io
.
Writer
)
{
switch
runtime
.
GOOS
{
case
"darwin"
:
printCmdOut
(
w
,
"uname -v: "
,
"uname"
,
"-v"
)
printCmdOut
(
w
,
""
,
"sw_vers"
)
case
"linux"
:
printCmdOut
(
w
,
"uname -sr: "
,
"uname"
,
"-sr"
)
printCmdOut
(
w
,
""
,
"lsb_release"
,
"-a"
)
case
"openbsd"
,
"netbsd"
,
"freebsd"
,
"dragonfly"
:
printCmdOut
(
w
,
"uname -v: "
,
"uname"
,
"-v"
)
case
"solaris"
:
out
,
err
:=
ioutil
.
ReadFile
(
"/etc/release"
)
if
err
==
nil
{
fmt
.
Fprintf
(
w
,
"/etc/release: %s
\n
"
,
out
)
}
else
{
fmt
.
Printf
(
"failed to read /etc/release: %v
\n
"
,
err
)
}
}
}
// printCmdOut prints the output of running the given command.
// It ignores failures; 'go bug' is best effort.
//
// copied from the Go source. Copyright 2017 The Go Authors
func
printCmdOut
(
w
io
.
Writer
,
prefix
,
path
string
,
args
...
string
)
{
cmd
:=
exec
.
Command
(
path
,
args
...
)
out
,
err
:=
cmd
.
Output
()
if
err
!=
nil
{
fmt
.
Printf
(
"%s %s: %v
\n
"
,
path
,
strings
.
Join
(
args
,
" "
),
err
)
return
}
fmt
.
Fprintf
(
w
,
"%s%s
\n
"
,
prefix
,
bytes
.
TrimSpace
(
out
))
}
const
header
=
`
#### Expected behaviour
#### Actual behaviour
#### Steps to reproduce the behaviour
#### Backtrace
`
cmd/geth/main.go
View file @
da19f302
...
...
@@ -212,7 +212,6 @@ func init() {
makecacheCommand
,
makedagCommand
,
versionCommand
,
bugCommand
,
licenseCommand
,
// See config.go
dumpConfigCommand
,
...
...
cmd/internal/browser/browser.go
deleted
100644 → 0
View file @
ee376f67
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package browser provides utilities for interacting with users' browsers.
package
browser
import
(
"os"
"os/exec"
"runtime"
)
// Commands returns a list of possible commands to use to open a url.
func
Commands
()
[][]
string
{
var
cmds
[][]
string
if
exe
:=
os
.
Getenv
(
"BROWSER"
);
exe
!=
""
{
cmds
=
append
(
cmds
,
[]
string
{
exe
})
}
switch
runtime
.
GOOS
{
case
"darwin"
:
cmds
=
append
(
cmds
,
[]
string
{
"/usr/bin/open"
})
case
"windows"
:
cmds
=
append
(
cmds
,
[]
string
{
"cmd"
,
"/c"
,
"start"
})
default
:
cmds
=
append
(
cmds
,
[]
string
{
"xdg-open"
})
}
cmds
=
append
(
cmds
,
[]
string
{
"chrome"
},
[]
string
{
"google-chrome"
},
[]
string
{
"chromium"
},
[]
string
{
"firefox"
},
)
return
cmds
}
// Open tries to open url in a browser and reports whether it succeeded.
func
Open
(
url
string
)
bool
{
for
_
,
args
:=
range
Commands
()
{
cmd
:=
exec
.
Command
(
args
[
0
],
append
(
args
[
1
:
],
url
)
...
)
if
cmd
.
Start
()
==
nil
{
return
true
}
}
return
false
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment