mirror of https://github.com/mattn/go-sqlite3.git
Add go.mod and go.sum for upgrade (#978)
* Add go.mod and go.sum for upgrade * Fix upgrade tools to have to run on upgrade directory
This commit is contained in:
parent
bb15a32a4f
commit
48c6a56ee0
|
@ -0,0 +1,5 @@
|
||||||
|
module github.com/mattn/go-sqlite3/upgrade
|
||||||
|
|
||||||
|
go 1.16
|
||||||
|
|
||||||
|
require github.com/PuerkitoBio/goquery v1.7.1 // indirect
|
|
@ -0,0 +1,12 @@
|
||||||
|
github.com/PuerkitoBio/goquery v1.7.1 h1:oE+T06D+1T7LNrn91B4aERsRIeCLJ/oPSa6xB9FPnz4=
|
||||||
|
github.com/PuerkitoBio/goquery v1.7.1/go.mod h1:XY0pP4kfraEmmV1O7Uf6XyjoslwsneBbgeDjLYuN8xY=
|
||||||
|
github.com/andybalholm/cascadia v1.2.0 h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=
|
||||||
|
github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
|
||||||
|
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q=
|
||||||
|
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
@ -1,5 +1,5 @@
|
||||||
// +build !cgo
|
//go:build !cgo && upgrade && ignore
|
||||||
// +build upgrade,ignore
|
// +build !cgo,upgrade,ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
@ -98,16 +98,25 @@ func mergeFile(src string, dst string) error {
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println("Go-SQLite3 Upgrade Tool")
|
fmt.Println("Go-SQLite3 Upgrade Tool")
|
||||||
|
|
||||||
|
wd, err := os.Getwd()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
if filepath.Base(wd) != "upgrade" {
|
||||||
|
log.Printf("Current directory is %q but should run in upgrade directory", wd)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Download Amalgamation
|
// Download Amalgamation
|
||||||
_, amalgamation, err := download("sqlite-amalgamation-")
|
_, amalgamation, err := download("sqlite-amalgamation-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to download: sqlite-amalgamation; %s", err)
|
log.Fatalf("Failed to download: sqlite-amalgamation; %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Download Source
|
// Download Source
|
||||||
_, source, err := download("sqlite-src-")
|
_, source, err := download("sqlite-src-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Failed to download: sqlite-src; %s", err)
|
log.Fatalf("Failed to download: sqlite-src; %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Amalgamation Zip Reader
|
// Create Amalgamation Zip Reader
|
||||||
|
@ -127,11 +136,11 @@ func main() {
|
||||||
var f *os.File
|
var f *os.File
|
||||||
switch path.Base(zf.Name) {
|
switch path.Base(zf.Name) {
|
||||||
case "sqlite3.c":
|
case "sqlite3.c":
|
||||||
f, err = os.Create("sqlite3-binding.c")
|
f, err = os.Create("../sqlite3-binding.c")
|
||||||
case "sqlite3.h":
|
case "sqlite3.h":
|
||||||
f, err = os.Create("sqlite3-binding.h")
|
f, err = os.Create("../sqlite3-binding.h")
|
||||||
case "sqlite3ext.h":
|
case "sqlite3ext.h":
|
||||||
f, err = os.Create("sqlite3ext.h")
|
f, err = os.Create("../sqlite3ext.h")
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -186,9 +195,9 @@ func main() {
|
||||||
var f *os.File
|
var f *os.File
|
||||||
switch path.Base(zf.Name) {
|
switch path.Base(zf.Name) {
|
||||||
case "userauth.c":
|
case "userauth.c":
|
||||||
f, err = os.Create("userauth.c")
|
f, err = os.Create("../userauth.c")
|
||||||
case "sqlite3userauth.h":
|
case "sqlite3userauth.h":
|
||||||
f, err = os.Create("userauth.h")
|
f, err = os.Create("../userauth.h")
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -211,10 +220,10 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge SQLite User Authentication into amalgamation
|
// Merge SQLite User Authentication into amalgamation
|
||||||
if err := mergeFile("userauth.c", "sqlite3-binding.c"); err != nil {
|
if err := mergeFile("../userauth.c", "../sqlite3-binding.c"); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if err := mergeFile("userauth.h", "sqlite3-binding.h"); err != nil {
|
if err := mergeFile("../userauth.h", "../sqlite3-binding.h"); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue