diff --git a/Gopkg.lock b/Gopkg.lock index d0bf2bd7..6a852405 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -5,19 +5,19 @@ branch = "master" name = "github.com/jguer/go-alpm" packages = ["."] - revision = "b5b0f1a50034078ac481705ac6608d42beeb1695" + revision = "946a37df2f6cbb5b3c26870a9a51d3fc02ea0fe1" [[projects]] branch = "master" name = "github.com/mikkeloscar/aur" packages = ["."] - revision = "dc2f99767ec5d809269bd3bac3878f6e949f8e64" + revision = "03627b6521ed20e90583c747d106f65a33bd3720" [[projects]] branch = "master" name = "github.com/mikkeloscar/gopkgbuild" packages = ["."] - revision = "9fbe9e0515b65906f121834b3e1e18fa0d2b2ab3" + revision = "25a016aca9de1ceb489929f7925dae4ce0919ed0" [solve-meta] analyzer-name = "dep" diff --git a/config.go b/config.go index 409c51bb..5f595d74 100644 --- a/config.go +++ b/config.go @@ -40,7 +40,7 @@ type Configuration struct { CleanAfter bool `json:"cleanAfter"` } -var version = "2.297" +var version = "2.365" // baseURL givers the AUR default address. const baseURL string = "https://aur.archlinux.org" diff --git a/vendor/github.com/jguer/go-alpm/README.md b/vendor/github.com/jguer/go-alpm/README.md index 9a764497..615dabd4 100644 --- a/vendor/github.com/jguer/go-alpm/README.md +++ b/vendor/github.com/jguer/go-alpm/README.md @@ -9,17 +9,17 @@ This project is MIT Licensed. See LICENSE for details. 1. Import the go-alpm repository in your go script - import "github.com/demizer/go-alpm" + import "github.com/jguer/go-alpm" 2. Copy the library to your GOPATH mkdir ~/go export GOPATH=~/go - go get github.com/demizer/go-alpm + go get github.com/jguer/go-alpm 3. Try the included examples - cd $GOPATH/src/github.com/demizer/go-alpm/examples + cd $GOPATH/src/github.com/jguer/go-alpm/examples go run installed.go ## Contributors diff --git a/vendor/github.com/jguer/go-alpm/conf.go b/vendor/github.com/jguer/go-alpm/conf.go index 7e351e85..0d86e1bc 100644 --- a/vendor/github.com/jguer/go-alpm/conf.go +++ b/vendor/github.com/jguer/go-alpm/conf.go @@ -177,12 +177,12 @@ lineloop: // pop reader stack. l := len(rdrStack) if l == 1 { - return conf, nil + break lineloop } rdr = rdrStack[l-2] rdrStack = rdrStack[:l-1] default: - return conf, err + break lineloop case nil: // Ok. } @@ -209,7 +209,7 @@ lineloop: if err != nil { err = fmt.Errorf("error while processing Include directive at line %d: %s", rdr.Lineno, err) - return conf, err + break lineloop } rdr = newConfReader(f) rdrStack = append(rdrStack, rdr) @@ -219,7 +219,7 @@ lineloop: deltaRatio, err := strconv.ParseFloat(line.Values[0], 64) if err != nil { - return conf, err + break lineloop } conf.UseDelta = deltaRatio @@ -230,7 +230,7 @@ lineloop: if currentSection != "options" { err = fmt.Errorf("option %s outside of [options] section, at line %d", line.Name, rdr.Lineno) - return conf, err + break lineloop } // main options. if opt, ok := optionsMap[line.Name]; ok { @@ -250,19 +250,24 @@ lineloop: *fieldP = strings.Join(line.Values, " ") case *[]string: //many valued option. - *fieldP = line.Values + *fieldP = append(*fieldP, line.Values...) } } } } + + if len(conf.CacheDir) == 0 { + conf.CacheDir = []string{"/var/cache/pacman/pkg/"} //should only be set if the config does not specify this + } + + return conf, err } func (conf *PacmanConfig) SetDefaults() { conf.RootDir = "/" conf.DBPath = "/var/lib/pacman" conf.DBPath = "/var/lib/pacman/" - conf.CacheDir = []string{"/var/cache/pacman/pkg/"} - conf.HookDir = []string{"/etc/pacman.d/hooks/"} + conf.HookDir = []string{"/etc/pacman.d/hooks/"} //should be added to whatever the config states conf.GPGDir = "/etc/pacman.d/gnupg/" conf.LogFile = "/var/log/pacman.log" conf.UseDelta = 0.7 diff --git a/vendor/github.com/jguer/go-alpm/enums.go b/vendor/github.com/jguer/go-alpm/enums.go index 9778bf20..2b11ebc4 100644 --- a/vendor/github.com/jguer/go-alpm/enums.go +++ b/vendor/github.com/jguer/go-alpm/enums.go @@ -108,3 +108,13 @@ const ( QuestionSelectProvider QuestionImportKey ) + +type Validation int + +const ( + ValidationNone Validation = 1 << iota + ValidationMD5Sum + ValidationSHA256Sum + ValidationSignature + ValidationUnkown Validation = 0 +) diff --git a/vendor/github.com/jguer/go-alpm/examples/installed.go b/vendor/github.com/jguer/go-alpm/examples/installed.go index a85634ca..66f87133 100644 --- a/vendor/github.com/jguer/go-alpm/examples/installed.go +++ b/vendor/github.com/jguer/go-alpm/examples/installed.go @@ -7,7 +7,7 @@ package main import ( - "github.com/demizer/go-alpm" + "github.com/jguer/go-alpm" "os" "fmt" ) diff --git a/vendor/github.com/jguer/go-alpm/examples/search.go b/vendor/github.com/jguer/go-alpm/examples/search.go index 3455013d..79342122 100644 --- a/vendor/github.com/jguer/go-alpm/examples/search.go +++ b/vendor/github.com/jguer/go-alpm/examples/search.go @@ -7,7 +7,7 @@ package main import ( - "github.com/demizer/go-alpm" + "github.com/jguer/go-alpm" "fmt" ) diff --git a/vendor/github.com/jguer/go-alpm/examples/updates.go b/vendor/github.com/jguer/go-alpm/examples/updates.go index 87e1af18..29e12997 100644 --- a/vendor/github.com/jguer/go-alpm/examples/updates.go +++ b/vendor/github.com/jguer/go-alpm/examples/updates.go @@ -8,7 +8,7 @@ package main import ( "fmt" - "github.com/demizer/go-alpm" + "github.com/jguer/go-alpm" "log" "os" ) diff --git a/vendor/github.com/jguer/go-alpm/package.go b/vendor/github.com/jguer/go-alpm/package.go index e664ece4..772480b6 100644 --- a/vendor/github.com/jguer/go-alpm/package.go +++ b/vendor/github.com/jguer/go-alpm/package.go @@ -93,11 +93,34 @@ func (l DependList) Slice() []Depend { return slice } + +func (pkg Package) FileName() string { + return C.GoString(C.alpm_pkg_get_filename(pkg.pmpkg)) +} + +func (pkg Package) Base() string { + return C.GoString(C.alpm_pkg_get_base(pkg.pmpkg)) +} + +func (pkg Package) Base64Signature() string { + return C.GoString(C.alpm_pkg_get_base64_sig(pkg.pmpkg)) +} + + +func (pkg Package) Validation() Validation { + return Validation(C.alpm_pkg_get_validation(pkg.pmpkg)) +} + // Architecture returns the package target Architecture. func (pkg Package) Architecture() string { return C.GoString(C.alpm_pkg_get_arch(pkg.pmpkg)) } +func (pkg Package) Deltas() StringList { + ptr := unsafe.Pointer(C.alpm_pkg_get_deltas(pkg.pmpkg)) + return StringList{(*list)(ptr)} +} + // Backup returns a list of package backups. func (pkg Package) Backup() BackupList { ptr := unsafe.Pointer(C.alpm_pkg_get_backup(pkg.pmpkg)) @@ -131,6 +154,26 @@ func (pkg Package) Depends() DependList { return DependList{(*list)(ptr)} } +// Depends returns the package's optional dependency list. +func (pkg Package) OptionalDepends() DependList { + ptr := unsafe.Pointer(C.alpm_pkg_get_optdepends(pkg.pmpkg)) + return DependList{(*list)(ptr)} +} + +// Depends returns the package's check dependency list. +//Exists in futre alpm +/*func (pkg Package) CheckDepends() DependList { + ptr := unsafe.Pointer(C.alpm_pkg_get_checkdepends(pkg.pmpkg)) + return DependList{(*list)(ptr)} +}*/ + +// Depends returns the package's make dependency list. +//Exists in futre alpm +/*func (pkg Package) MakeDepends() DependList { + ptr := unsafe.Pointer(C.alpm_pkg_get_makedepends(pkg.pmpkg)) + return DependList{(*list)(ptr)} +}*/ + // Description returns the package's description. func (pkg Package) Description() string { return C.GoString(C.alpm_pkg_get_desc(pkg.pmpkg)) diff --git a/vendor/github.com/mikkeloscar/aur/aur.go b/vendor/github.com/mikkeloscar/aur/aur.go index 2457662b..897dc003 100644 --- a/vendor/github.com/mikkeloscar/aur/aur.go +++ b/vendor/github.com/mikkeloscar/aur/aur.go @@ -35,6 +35,7 @@ type Pkg struct { URLPath string `json:"URLPath"` Depends []string `json:"Depends"` MakeDepends []string `json:"MakeDepends"` + CheckDepends []string `json:"CheckDepends"` Conflicts []string `json:"Conflicts"` Replaces []string `json:"Replaces"` OptDepends []string `json:"OptDepends"` diff --git a/vendor/github.com/mikkeloscar/gopkgbuild/lex.go b/vendor/github.com/mikkeloscar/gopkgbuild/lex.go index 70f7336f..12518bcb 100644 --- a/vendor/github.com/mikkeloscar/gopkgbuild/lex.go +++ b/vendor/github.com/mikkeloscar/gopkgbuild/lex.go @@ -244,9 +244,7 @@ func lexVariable(l *lexer) stateFn { // strip arch from source_arch like constructs witharch := strings.SplitN(variable, "_", 2) if len(witharch) == 2 { - if _, ok := archs[witharch[1]]; ok { - variable = witharch[0] - } + variable = witharch[0] } if _, ok := variables[variable]; ok { diff --git a/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild.go b/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild.go index f455e31a..2193ad9a 100644 --- a/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild.go +++ b/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild.go @@ -8,41 +8,6 @@ import ( "strings" ) -// Arch is a system architecture -type Arch uint8 - -const ( - // Any architecture - Any Arch = iota - // I686 architecture - I686 - // X8664 x86_64 (64bit) architecture - X8664 - // ARMv5 architecture (archlinux-arm) - ARMv5 - // ARMv6h architecture (archlinux-arm) - ARMv6h - // ARMv7h architecture (archlinux-arm) - ARMv7h - // ARMv8 architecture (64bit) (archlinux-arm) - ARMv8 - // MIPS64 architecture - MIPS64 -) - -var archs = map[string]Arch{ - "any": Any, - "i686": I686, - "x86": I686, - "x86_64": X8664, - "aarch64": ARMv8, - "arm": ARMv5, - "armv5": ARMv5, - "armv6h": ARMv6h, - "armv7h": ARMv7h, - "mips64el": MIPS64, -} - // Dependency describes a dependency with min and max version, if any. type Dependency struct { Name string // dependency name @@ -69,7 +34,7 @@ type PKGBUILD struct { Epoch int Pkgbase string Pkgdesc string - Arch []Arch // required + Arch []string // required URL string License []string // recommended Groups []string @@ -248,6 +213,24 @@ func parse(input string) (*PKGBUILD, error) { Loop: for { token := lexer.nextItem() + + // strip arch from source_arch like constructs + witharch := strings.SplitN(token.val, "_", 2) + if len(witharch) == 2 { + found := false + for _, arch := range pkgbuild.Arch { + if arch == witharch[1] { + token.val = witharch[0] + found = true + break + } + } + + if !found { + return nil, fmt.Errorf("unsupported arch for variable: %s", token.val) + } + } + switch token.typ { case itemPkgbase: next = lexer.nextItem() @@ -288,11 +271,7 @@ Loop: pkgbuild.Pkgdesc = next.val case itemArch: next = lexer.nextItem() - if arch, ok := archs[next.val]; ok { - pkgbuild.Arch = append(pkgbuild.Arch, arch) - } else { - return nil, fmt.Errorf("invalid Arch: %s", next.val) - } + pkgbuild.Arch = append(pkgbuild.Arch, next.val) case itemURL: next = lexer.nextItem() pkgbuild.URL = next.val @@ -380,7 +359,7 @@ Loop: case itemEOF: break Loop default: - return nil, fmt.Errorf(token.val) + return nil, fmt.Errorf("invalid variable: %s", token.val) } } return pkgbuild, nil diff --git a/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild_test.go b/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild_test.go index 8345da96..d6e7c2a8 100644 --- a/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild_test.go +++ b/vendor/github.com/mikkeloscar/gopkgbuild/pkgbuild_test.go @@ -179,6 +179,7 @@ func TestRandomCoreSRCINFOs(t *testing.T) { "linux", "pip2pkgbuild", "biicode", + "teamviewer", } for _, srcinfo := range srcinfos { diff --git a/vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_teamviewer b/vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_teamviewer new file mode 100644 index 00000000..a1d6ccb5 --- /dev/null +++ b/vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/PKGBUILD_teamviewer @@ -0,0 +1,66 @@ +# Maintainer: Alex Taber + +pkgname=teamviewer +pkgver=12.0.90041 +pkgrel=7 +pkgdesc='All-In-One Software for Remote Support and Online Meetings' +arch=('i686' 'x86_64') +url='http://www.teamviewer.com' +license=('custom') +options=('!strip') +provides=('teamviewer') +conflicts=('teamviewer-beta') +depends_x86_64=( + 'lib32-fontconfig' + 'lib32-libpng12' + 'lib32-libsm' + 'lib32-libxinerama' + 'lib32-libxrender' + 'lib32-libjpeg6-turbo' + 'lib32-libxtst' + 'lib32-freetype2' + 'lib32-dbus' + 'libxtst') +depends_i686=( + 'fontconfig' + 'libpng12' + 'libsm' + 'libxinerama' + 'libxrender' + 'libjpeg6-turbo' + 'freetype2' + 'libxtst') +install=teamviewer.install +source_x86_64=("https://download.teamviewer.com/download/version_${pkgver%%.*}x/teamviewer_${pkgver}_amd64.deb" + "https://archive.archlinux.org/packages/l/lib32-freetype2/lib32-freetype2-2.8-2-x86_64.pkg.tar.xz") +source_i686=("https://download.teamviewer.com/download/version_${pkgver%%.*}x/teamviewer_${pkgver}_i386.deb" + "https://archive.archlinux.org/packages/f/freetype2/freetype2-2.8-2-i686.pkg.tar.xz") +sha256sums_i686=('8f2f108d2e303705a55111fd8af6561f25537b017bcc795766d6aba63a32eea5' + 'd33cf8be0c4be1c602d368fb363c9029d87f2bc4fdfcae5063595ac482ca39e8') +sha256sums_x86_64=('a30bfaa0ddfa7f6ab03141f0deb8fd0a26760e1b18ea1cb9e54b5b54bf2c0131' + '4f39c9bd52579ac5d13980d760a5434fdb0f0638df07d2abca9ea44a779185e3') + +prepare() { + warning "If the install fails, you need to uninstall previous major version of Teamviewer" + mkdir data + cd data + tar -xf ../data.tar.bz2 +} + +package() { + # Install + warning "If the install fails, you need to uninstall previous major version of Teamviewer" + cp -dr --no-preserve=ownership ./data/{etc,opt,usr,var} "${pkgdir}"/ + + # freetype workaround + [ -e "${srcdir}/usr/lib32/libfreetype.so.6.14.0" ] && install -D -m0755 "${srcdir}/usr/lib32/libfreetype.so.6.14.0" "${pkgdir}/opt/teamviewer/tv_bin/wine/lib/libfreetype.so.6" + [ -e "${srcdir}/usr/lib/libfreetype.so.6.14.0" ] && install -D -m0755 "${srcdir}/usr/lib/libfreetype.so.6.14.0" "${pkgdir}/opt/teamviewer/tv_bin/wine/lib/libfreetype.so.6" + + # Additional files + rm "${pkgdir}"/opt/teamviewer/tv_bin/xdg-utils/xdg-email + install -D -m0644 "${pkgdir}"/opt/teamviewer/tv_bin/script/teamviewerd.service \ + "${pkgdir}"/usr/lib/systemd/system/teamviewerd.service + install -d -m0755 "${pkgdir}"/usr/{share/applications,share/licenses/teamviewer} + ln -s /opt/teamviewer/License.txt \ + "${pkgdir}"/usr/share/licenses/teamviewer/LICENSE +} diff --git a/vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_teamviewer b/vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_teamviewer new file mode 100644 index 00000000..dce0406b --- /dev/null +++ b/vendor/github.com/mikkeloscar/gopkgbuild/test_pkgbuilds/SRCINFO_teamviewer @@ -0,0 +1,43 @@ +# Generated by mksrcinfo v8 +# Sat Feb 17 20:08:59 UTC 2018 +pkgbase = teamviewer + pkgdesc = All-In-One Software for Remote Support and Online Meetings + pkgver = 12.0.90041 + pkgrel = 7 + url = http://www.teamviewer.com + install = teamviewer.install + arch = i686 + arch = x86_64 + license = custom + provides = teamviewer + conflicts = teamviewer-beta + options = !strip + source_i686 = https://download.teamviewer.com/download/version_12x/teamviewer_12.0.90041_i386.deb + source_i686 = https://archive.archlinux.org/packages/f/freetype2/freetype2-2.8-2-i686.pkg.tar.xz + depends_i686 = fontconfig + depends_i686 = libpng12 + depends_i686 = libsm + depends_i686 = libxinerama + depends_i686 = libxrender + depends_i686 = libjpeg6-turbo + depends_i686 = freetype2 + depends_i686 = libxtst + sha256sums_i686 = 8f2f108d2e303705a55111fd8af6561f25537b017bcc795766d6aba63a32eea5 + sha256sums_i686 = d33cf8be0c4be1c602d368fb363c9029d87f2bc4fdfcae5063595ac482ca39e8 + source_x86_64 = https://download.teamviewer.com/download/version_12x/teamviewer_12.0.90041_amd64.deb + source_x86_64 = https://archive.archlinux.org/packages/l/lib32-freetype2/lib32-freetype2-2.8-2-x86_64.pkg.tar.xz + depends_x86_64 = lib32-fontconfig + depends_x86_64 = lib32-libpng12 + depends_x86_64 = lib32-libsm + depends_x86_64 = lib32-libxinerama + depends_x86_64 = lib32-libxrender + depends_x86_64 = lib32-libjpeg6-turbo + depends_x86_64 = lib32-libxtst + depends_x86_64 = lib32-freetype2 + depends_x86_64 = lib32-dbus + depends_x86_64 = libxtst + sha256sums_x86_64 = a30bfaa0ddfa7f6ab03141f0deb8fd0a26760e1b18ea1cb9e54b5b54bf2c0131 + sha256sums_x86_64 = 4f39c9bd52579ac5d13980d760a5434fdb0f0638df07d2abca9ea44a779185e3 + +pkgname = teamviewer +