Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
aports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
alpine
aports
Commits
7d6cd374
Commit
7d6cd374
authored
5 years ago
by
Leo
Browse files
Options
Downloads
Patches
Plain Diff
testing/lab: add upstream patches for shell completion and xdg compliance
parent
9e124e2c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
testing/lab/APKBUILD
+32
-3
32 additions, 3 deletions
testing/lab/APKBUILD
testing/lab/allow-completion.patch
+38
-0
38 additions, 0 deletions
testing/lab/allow-completion.patch
testing/lab/xdg.patch
+27
-0
27 additions, 0 deletions
testing/lab/xdg.patch
with
97 additions
and
3 deletions
testing/lab/APKBUILD
+
32
−
3
View file @
7d6cd374
...
...
@@ -2,7 +2,7 @@
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname
=
lab
pkgver
=
0.16.0
pkgrel
=
0
pkgrel
=
1
pkgdesc
=
"A Git Wrapper for GitLab"
url
=
"https://zaquestion.github.io/lab/"
arch
=
"all"
...
...
@@ -10,7 +10,14 @@ license="CC0-1.0"
depends
=
"git"
makedepends
=
"go"
checkdepends
=
"bash"
source
=
"lab-
$pkgver
.tar.gz::https://github.com/zaquestion/lab/archive/v
$pkgver
.tar.gz"
subpackages
=
"
$pkgname
-bash-completion:bashcomp:noarch
$pkgname
-zsh-completion:zshcomp:noarch
"
source
=
"lab-
$pkgver
.tar.gz::https://github.com/zaquestion/lab/archive/v
$pkgver
.tar.gz
allow-completion.patch
xdg.patch
"
builddir
=
"
$srcdir
/src/github.com/zaquestion/
$pkgname
"
options
=
"net !check"
# Tests require configured GitLab account with SSH keys
...
...
@@ -25,6 +32,8 @@ prepare() {
build
()
{
GO111MODULE
=
on go build
-ldflags
"-X main.version=
$pkgver
"
-o
bin/
$pkgname
./bin/lab completion bash
>
lab.bash
./bin/lab completion zsh
>
_lab.zsh
}
package
()
{
...
...
@@ -37,4 +46,24 @@ cleanup_srcdir() {
default_cleanup_srcdir
}
sha512sums
=
"8036dd3921f2e02433274a4e3dc215e8afc604c385753105c8640f2795f4566641a30a27ce8ddb99496bab5101e573a7607ca3990c4e6587834a6ecf061e92f2 lab-0.16.0.tar.gz"
bashcomp
()
{
depends
=
""
pkgdesc
=
"Bash completions for
$pkgname
"
install_if
=
"
$pkgname
=
$pkgver
-r
$pkgrel
bash-completion"
install
-Dm644
"
$builddir
"
/lab.bash
\
"
$subpkgdir
"
/usr/share/bash-completion/completions/
$pkgname
}
zshcomp
()
{
depends
=
""
pkgdesc
=
"Zsh completions for
$pkgname
"
install_if
=
"
$pkgname
=
$pkgver
-r
$pkgrel
zsh"
install
-Dm644
"
$builddir
"
/_lab.zsh
\
"
$subpkgdir
"
/usr/share/zsh/site-functions/_
$pkgname
}
sha512sums
=
"8036dd3921f2e02433274a4e3dc215e8afc604c385753105c8640f2795f4566641a30a27ce8ddb99496bab5101e573a7607ca3990c4e6587834a6ecf061e92f2 lab-0.16.0.tar.gz
9241ae986e7669f46c6bafbf0532bff730eb11b74c73b37785d926c8dc88e9de528a6ad9d685e79e1e8a5e44b903dbe213af92648038fb59514ea2c696ea7dd4 allow-completion.patch
f45e5f0ccfcfea03090b78fd2af200165883f329684e2301644b88828c072fedf8ff2832254ca3d44c0e1e95e60bff5145f5decbb85907ac9241cbaf5514a146 xdg.patch"
This diff is collapsed.
Click to expand it.
testing/lab/allow-completion.patch
0 → 100644
+
38
−
0
View file @
7d6cd374
From c5d445472c183f6437966b2b1e9e68dab5926c24 Mon Sep 17 00:00:00 2001
From: Zaq? Wiedmann <zaquestion@gmail.com>
Date: Thu, 25 Jul 2019 12:37:49 -0700
Subject: [PATCH] #321: allow completions to be generated without
authenticating with GitLab
This makes it easy for distributors to provide completion out of the box in packaged versions of lab
---
main.go | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/main.go b/main.go
index 9a836b9..ba3f21c 100644
--- a/main.go
+++ b/main.go
@@ -127,6 +127,20 @@
func getUser(host, token string) string {
func main() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
cmd.Version = version
- lab.Init(loadConfig())
+ if !skipInit() {
+ lab.Init(loadConfig())
+ }
cmd.Execute()
}
+
+func skipInit() bool {
+ if len(os.Args) <= 1 {
+ return false
+ }
+ switch os.Args[1] {
+ case "completion":
+ return true
+ default:
+ return false
+ }
+}
This diff is collapsed.
Click to expand it.
testing/lab/xdg.patch
0 → 100644
+
27
−
0
View file @
7d6cd374
From 63bb26a320d43f8ce79626b0adeeaae73f90fd8a Mon Sep 17 00:00:00 2001
From: Leo <thinkabit.ukim@gmail.com>
Date: Thu, 25 Jul 2019 04:05:41 -0300
Subject: [PATCH] try XDG_CONFIG_HOME
---
main.go | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/main.go b/main.go
index dddf7a3..9a836b9 100644
--- a/main.go
+++ b/main.go
@@ -35,7 +35,11 @@
func loadConfig() (string, string, string) {
home = u.HomeDir
}
}
- confpath := path.Join(home, ".config")
+ // Try XDG_CONFIG_HOME which is declared in XDG base directory specification
+ confpath := os.Getenv("XDG_CONFIG_HOME")
+ if confpath == "" {
+ confpath = path.Join(home, ".config")
+ }
if _, err := os.Stat(confpath); os.IsNotExist(err) {
os.Mkdir(confpath, 0700)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment