Merge pull request #432 from Jguer/5.1

5.1 vendor update
This commit is contained in:
J Guerreiro 2018-05-29 00:08:15 +01:00 committed by GitHub
commit 030f847243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 21 deletions

4
Gopkg.lock generated
View File

@ -5,7 +5,7 @@
branch = "master" branch = "master"
name = "github.com/jguer/go-alpm" name = "github.com/jguer/go-alpm"
packages = ["."] packages = ["."]
revision = "6150b61c07385c54c6dd8087b9be05cf8b064424" revision = "ad1a7ae8a5232dbbe48dc3f75a42e6812f2dce11"
[[projects]] [[projects]]
branch = "master" branch = "master"
@ -18,7 +18,7 @@
name = "github.com/mikkeloscar/gopkgbuild" name = "github.com/mikkeloscar/gopkgbuild"
packages = ["."] packages = ["."]
revision = "7b0e7c63b22efc73e1c10e6f3117fdc03cd21816" revision = "7b0e7c63b22efc73e1c10e6f3117fdc03cd21816"
[solve-meta] [solve-meta]
analyzer-name = "dep" analyzer-name = "dep"
analyzer-version = 1 analyzer-version = 1

View File

@ -114,18 +114,14 @@ func (rdr *confReader) ParseLine() (tok iniToken, err error) {
rdr.Lineno++ rdr.Lineno++
line = bytes.TrimSpace(line) line = bytes.TrimSpace(line)
comment := bytes.IndexByte(line, '#')
if comment >= 0 {
line = line[:comment]
}
if len(line) == 0 { if len(line) == 0 {
tok.Type = tokenComment tok.Type = tokenComment
return return
} }
switch line[0] { switch line[0] {
case '#':
tok.Type = tokenComment
return
case '[': case '[':
closing := bytes.IndexByte(line, ']') closing := bytes.IndexByte(line, ']')
if closing < 0 { if closing < 0 {

View File

@ -89,7 +89,7 @@ func (h Handle) RegisterSyncDb(dbname string, siglevel SigLevel) (*Db, error) {
cName := C.CString(dbname) cName := C.CString(dbname)
defer C.free(unsafe.Pointer(cName)) defer C.free(unsafe.Pointer(cName))
db := C.alpm_register_syncdb(h.ptr, cName, C.alpm_siglevel_t(siglevel)) db := C.alpm_register_syncdb(h.ptr, cName, C.int(siglevel))
if db == nil { if db == nil {
return nil, h.LastError() return nil, h.LastError()
} }

View File

@ -62,7 +62,7 @@ func (mod DepMod) String() string {
} }
// Signature checking level. // Signature checking level.
type SigLevel uint type SigLevel int
const ( const (
SigPackage SigLevel = 1 << iota SigPackage SigLevel = 1 << iota
@ -79,7 +79,7 @@ const (
const SigUseDefault SigLevel = 1 << 31 const SigUseDefault SigLevel = 1 << 31
// Signature status // Signature status
type SigStatus uint type SigStatus int
const ( const (
SigStatusValid SigStatus = iota SigStatusValid SigStatus = iota

View File

@ -534,7 +534,7 @@ func (h Handle) GetDefaultSigLevel() (SigLevel, error) {
} }
func (h Handle) SetDefaultSigLevel(siglevel SigLevel) error { func (h Handle) SetDefaultSigLevel(siglevel SigLevel) error {
ok := C.alpm_option_set_default_siglevel(h.ptr, C.alpm_siglevel_t(siglevel)) ok := C.alpm_option_set_default_siglevel(h.ptr, C.int(siglevel))
if ok < 0 { if ok < 0 {
return h.LastError() return h.LastError()
@ -552,7 +552,7 @@ func (h Handle) GetLocalFileSigLevel() (SigLevel, error) {
} }
func (h Handle) SetLocalFileSigLevel(siglevel SigLevel) error { func (h Handle) SetLocalFileSigLevel(siglevel SigLevel) error {
ok := C.alpm_option_set_local_file_siglevel(h.ptr, C.alpm_siglevel_t(siglevel)) ok := C.alpm_option_set_local_file_siglevel(h.ptr, C.int(siglevel))
if ok < 0 { if ok < 0 {
return h.LastError() return h.LastError()
@ -570,7 +570,7 @@ func (h Handle) GetRemoteFileSigLevel() (SigLevel, error) {
} }
func (h Handle) SetRemoteFileSigLevel(siglevel SigLevel) error { func (h Handle) SetRemoteFileSigLevel(siglevel SigLevel) error {
ok := C.alpm_option_set_remote_file_siglevel(h.ptr, C.alpm_siglevel_t(siglevel)) ok := C.alpm_option_set_remote_file_siglevel(h.ptr, C.int(siglevel))
if ok < 0 { if ok < 0 {
return h.LastError() return h.LastError()

View File

@ -159,18 +159,16 @@ func (pkg Package) OptionalDepends() DependList {
} }
// Depends returns the package's check dependency list. // Depends returns the package's check dependency list.
//Exists in futre alpm func (pkg Package) CheckDepends() DependList {
/*func (pkg Package) CheckDepends() DependList {
ptr := unsafe.Pointer(C.alpm_pkg_get_checkdepends(pkg.pmpkg)) ptr := unsafe.Pointer(C.alpm_pkg_get_checkdepends(pkg.pmpkg))
return DependList{(*list)(ptr)} return DependList{(*list)(ptr)}
}*/ }
// Depends returns the package's make dependency list. // Depends returns the package's make dependency list.
//Exists in futre alpm func (pkg Package) MakeDepends() DependList {
/*func (pkg Package) MakeDepends() DependList {
ptr := unsafe.Pointer(C.alpm_pkg_get_makedepends(pkg.pmpkg)) ptr := unsafe.Pointer(C.alpm_pkg_get_makedepends(pkg.pmpkg))
return DependList{(*list)(ptr)} return DependList{(*list)(ptr)}
}*/ }
// Description returns the package's description. // Description returns the package's description.
func (pkg Package) Description() string { func (pkg Package) Description() string {