Skip to content

Commit

Permalink
Merge pull request #13 from Ckath/libalpm13
Browse files Browse the repository at this point in the history
Libalpm13 fixups
  • Loading branch information
zqqw authored Jun 2, 2021
2 parents bf4b402 + 7099e75 commit 334e09a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions completion/zsh.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- a/zsh
+++ b/zsh
@@ -1,1 +1,1 @@
-#compdef pacman pacman.static=pacman pacman-key makepkg
-#compdef pacman pacman.static=pacman pacman-conf pacman-key makepkg
+#compdef pakku
@@ -139,2 +139,6 @@
'--print-format[Specify how the targets should be printed]'
Expand Down Expand Up @@ -30,13 +30,16 @@
@@ -371,1 +380,1 @@
-_pakku_zsh_comp() {
+_pakku_comp() {
@@ -501,17 +510,0 @@
@@ -596,20 +616,0 @@
-
-_pakku_comp() {
- case "$service" in
- makepkg)
- _makepkg "$@"
- ;;
- pacman-conf)
- _pakku_conf "$@"
- ;;
- pacman-key)
- _pakku_key "$@"
- ;;
Expand Down
6 changes: 3 additions & 3 deletions src/wrapper/alpm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ proc newAlpmHandle*(root: cstring, dbpath: cstring, err: var cint): ptr AlpmHand
proc release*(handle: ptr AlpmHandle): cint
{.cdecl, importc: "alpm_release".}

proc setArch*(handle: ptr AlpmHandle, arch: cstring): cint
{.cdecl, importc: "alpm_option_set_arch".}
proc addArch*(handle: ptr AlpmHandle, arch: cstring): cint
{.cdecl, importc: "alpm_option_add_architecture".}

proc vercmp*(a: cstring, b: cstring): cint
{.cdecl, importc: "alpm_pkg_vercmp".}
Expand Down Expand Up @@ -137,7 +137,7 @@ template withAlpm*(root: string, db: string, dbs: seq[string], arch: string,
.replace("%s", "$#") % [dbName, $handle.errno.errorAlpm]

try:
discard handle.setArch(arch)
discard handle.addArch(arch)
body
finally:
discard handle.release()
Expand Down

0 comments on commit 334e09a

Please sign in to comment.