You are not logged in.

#126 2010-03-20 09:38:56

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: Clyde - A better libalpm/makepkg wrapper

When I touch that code I test in gnome-terminal, konsole, terminal, rxvt-unicode-256color (use this full time), screen, terminator, tmux, tty, and have tried a few others in the past that worked and have not changed the code since then, but I forgot them and do not have them installed anymore. Tmux is the only one that fails out of those at progress bars.

Offline

#127 2010-03-20 13:59:10

cool
Member
Registered: 2008-09-12
Posts: 111
Website

Re: Clyde - A better libalpm/makepkg wrapper

Hi,
can you tell me how to fix these errors:

gaurish ~ > clyde chromium 
1 extra/chromium 5.0.307.11-1
    The open-source project behind Google Chrome, an attempt at creating a safer, faster, and more stable browser.
2 community/chromium-bsu 0.9.14-1
    A fast paced top scrolling shooter
3 aur/chromeplus 1.3.3.1-1 (4)
    a web browser based on Chromium
4 aur/chromium-browser-bin LATEST-18 (953)
    The open-source project behind Google Chrome
5 aur/chromium-browser-svn 2010-33 (76)
    An open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web
6 aur/chromium-browser-svn-fontsfix 2010-30 (0)
    An open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web. SVN version with
    fontconfig patch.
7 aur/chromium-codecs-ffmpeg-nonfree-bin 41283-1 (220)
    Non-free ffmpeg codecs for 'chromium-browser-bin'
8 aur/iron 4.0.275.2-3 (323)
    A web browser based on chromium without Google's tracking 'features'
==>  Enter #'s (separated by blanks) of packages to be installed
==>  ------------------------------------------------------------
==> 7
:: chromium-codecs-ffmpeg-nonfree-bin package not found, searching for group...
:: chromium-codecs-ffmpeg-nonfree-bin group not found, searching AUR...                                                                               
/tmp/lua_LXUNhI: line 45: msg: command not found                                                                                                      
/tmp/lua_LXUNhI: line 48: msg2: command not found
/tmp/lua_LXUNhI: line 54: [: : integer expression expected
/tmp/lua_LXUNhI: line 59: devel_update: command not found
/tmp/lua_LXUNhI: line 45: msg: command not found
/tmp/lua_LXUNhI: line 48: msg2: command not found
/tmp/lua_LXUNhI: line 54: [: : integer expression expected
/tmp/lua_LXUNhI: line 59: devel_update: command not found
/tmp/lua_LXUNhI: line 45: msg: command not found
/tmp/lua_LXUNhI: line 48: msg2: command not found
/tmp/lua_LXUNhI: line 54: [: : integer expression expected
/tmp/lua_LXUNhI: line 59: devel_update: command not found

==> Installing the following packages from AUR                                                                                                        
Targets (3): chromium-codecs-ffmpeg-nonfree-bin  chromium-browser-bin  libjpeg6



=> Proceed with installation? [Y/n] y
/tmp/lua_BKdax9: line 45: msg: command not found
/tmp/lua_BKdax9: line 48: msg2: command not found
/tmp/lua_BKdax9: line 54: [: : integer expression expected
/tmp/lua_BKdax9: line 59: devel_update: command not found
/tmp/lua_BKdax9: line 45: msg: command not found
/tmp/lua_BKdax9: line 48: msg2: command not found
/tmp/lua_BKdax9: line 54: [: : integer expression expected
/tmp/lua_BKdax9: line 59: devel_update: command not found
/tmp/lua_BKdax9: line 45: msg: command not found
/tmp/lua_BKdax9: line 48: msg2: command not found
/tmp/lua_BKdax9: line 54: [: : integer expression expected
/tmp/lua_BKdax9: line 59: devel_update: command not found
/tmp/lua_k4MEhg: line 45: msg: command not found
/tmp/lua_k4MEhg: line 48: msg2: command not found
/tmp/lua_k4MEhg: line 54: [: : integer expression expected
/tmp/lua_k4MEhg: line 59: devel_update: command not found
/tmp/lua_k4MEhg: line 45: msg: command not found
/tmp/lua_k4MEhg: line 48: msg2: command not found
/tmp/lua_k4MEhg: line 54: [: : integer expression expected
/tmp/lua_k4MEhg: line 59: devel_update: command not found
/tmp/lua_k4MEhg: line 45: msg: command not found
/tmp/lua_k4MEhg: line 48: msg2: command not found
/tmp/lua_k4MEhg: line 54: [: : integer expression expected
/tmp/lua_k4MEhg: line 59: devel_update: command not found
==> Downloading libjpeg6.tar.gz

built from git, two days ago.

> clyde -V

    .--.          .---.        Clyde v0.0.1 - lualpm v0.0.1
   '-._ \ .-.  .-|O O  | ~~    Copyright (C) 2009 Robert Djubek
   .-'  / '-'  '-|~~~  |  ~~~  This program may be freely redistributed under
    '--'         |.-.-.| ~~    the terms of the GNU General Public License.

Last edited by cool (2010-03-20 14:03:50)

Offline

#128 2010-03-20 14:07:47

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: Clyde - A better libalpm/makepkg wrapper

Ugh, I am beginning to hate tmux and tilde (whatever that is). IMO they are buggy...if something works in 90% of terminals, and especially since I don't do anything screwy or out of the norm or even stupid, then they are not doing something right. Nonetheless, I will try and figure out a way of making Clyde work with them, though I still blame those programs. Clyde may have some bugs, but I do not think this can be considered entirely a problem with Clyde.

I've never had any terminal gfx problems with any other package manager/wrapper than Clyde; yaourt, powerpill/bauerbill, packer, pacman-color and regular pacman (as well as others like apt-get and aptitude) work just fine between a wide range of terminals. (xterm, xterm with tmux, urxvt, urxvt with tmux, VTE variants (roxterm, tilda, gnome-terminal, xfce-terminal, lxterminal, evilvte, regular vte, and so on), VTE variants with tmux). It seems perfectly clear that Clyde is the issue.

Last edited by JohannesSM64 (2010-03-20 14:19:12)

Offline

#129 2010-03-20 20:02:18

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: Clyde - A better libalpm/makepkg wrapper

cool, you can fix it by updating as I have pushed a fix for that. big_smile

Patches welcome to remove the standard ANSI escape codes that these retarded terminal emulators cannot handle, and still maintain the same behavior in the other dozen terminals they work perfectly fine in.

Edit: I removed the ANSI codes, because I am tired of people complaining. Removing the codes means that there is no longer a ghost chasing pac-man for ILoveCandy. If anyone can figure out how to add the ghost back please do as this pisses me off! I left the existing code for the ghost there and just commented it. The file is clydelib/callback.lua function is fill_progress... the comments with the -- at the beginning of the line are purely for reference and were already there, the ones with -- immediately before code are what I commented.

Last edited by Kiwi (2010-03-20 21:30:08)

Offline

#130 2010-03-20 21:47:21

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: Clyde - A better libalpm/makepkg wrapper

There is a known bug related to how tmux handles ANSI codes, and 256color support in general. This bug seems to effect all distros (it's not clyde's fault, or Arch's). Pester the tmux devs to fix it!


.:[My Blog] || [My GitHub]:.

Offline

#131 2010-03-20 22:10:41

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443

Re: Clyde - A better libalpm/makepkg wrapper

Patches welcome to remove the standard ANSI escape codes that these retarded terminal emulators cannot handle, and still maintain the same behavior in the other dozen terminals they work perfectly fine in.

Ok why not just dump how wget does it and do exactly the same?

Offline

#132 2010-03-20 22:38:15

cool
Member
Registered: 2008-09-12
Posts: 111
Website

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

cool, you can fix it by updating as I have pushed a fix for that. big_smile

Thanks. big_smile

Offline

#133 2010-03-20 22:46:12

EnvoyRising
Member
Registered: 2008-08-08
Posts: 118

Re: Clyde - A better libalpm/makepkg wrapper

As far as tmux + terminal colors, perhaps the following is related and useful:
http://osdir.com/ml/debian-bugs-dist/20 … 07932.html

If not, disregard this message smile

edit:
or not, seems to be screen specific. Perhaps a good hint though.

Last edited by EnvoyRising (2010-03-20 22:47:10)

Offline

#134 2010-03-20 22:56:51

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443

Re: Clyde - A better libalpm/makepkg wrapper

Too bad i am using it in an 88 colors urxvt.

Offline

#135 2010-03-21 03:49:53

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

Edit: I removed the ANSI codes, because I am tired of people complaining. Removing the codes means that there is no longer a ghost chasing pac-man for ILoveCandy. If anyone can figure out how to add the ghost back please do as this pisses me off! I left the existing code for the ghost there and just commented it. The file is clydelib/callback.lua function is fill_progress... the comments with the -- at the beginning of the line are purely for reference and were already there, the ones with -- immediately before code are what I commented.

Is there any chance it could just be made an option?

Another way is check 'tput colors' (there should be a way to do this inside of lua/c)

Last edited by some-guy94 (2010-03-21 03:50:10)

Offline

#136 2010-03-24 04:56:55

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: Clyde - A better libalpm/makepkg wrapper

I have made a few updates to Clyde.

I had thought I had implemented all of -U, but I had only done part of it. It may or may not have worked sometimes but it was not fully complete. Now it should be. I say should be because it is kind of hard to test some of the scenarios that can happen, but I think I covered all the bases with the code, but some of the cases are untested. It will not be hard or take long to fix if there is anything wrong, though, so if anyone has a problem just let me know and it will be fixed pretty quickly.

I changed all instances of white bold to bright, this should fix the invisible text when using a white background. Hopefully this will appease some people for the time being while I work on the color profiles to truly resolve the situation.

I added colors to -Si and -Qi as a few people requested that on IRC a while ago and I had some time today that I was bored but not in the mood to seriously code, and that stuff was fairly easy and only required a few additional modifications to existing functions, other than just adding the colorize codes. (Basically the functions that display the strings and tables use the length of the title string to determine indentation if it wrapped, but when you color them it adds length to the string but not how it is displayed, so I had to add adjustment parameters to three functions, for those who care).

Offline

#137 2010-03-24 05:16:24

thestinger
Package Maintainer (PM)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: Clyde - A better libalpm/makepkg wrapper

just a little bug (or missing feature?):

when I add anything to the NoExtract array in /etc/clyde.conf I get this error when running -S commands:

lua: /usr/bin/clyde:679: attempt to call local 'optionfunc' (a nil value)
stack traceback:
        /usr/bin/clyde:679: in function 'setrepeatingoption'
        /usr/bin/clyde:746: in function '?'
        /usr/bin/clyde:881: in function </usr/bin/clyde:684>
        (tail call): ?
        /usr/bin/clyde:966: in function </usr/bin/clyde:929>
        (tail call): ?
        [C]: ?

the NoExtract array in /etc/pacman.conf still works for pacman -S

Last edited by thestinger (2010-03-24 05:17:19)

Offline

#138 2010-03-24 05:31:30

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: Clyde - A better libalpm/makepkg wrapper

Minor spelling failure in a function (I had options_add_noextract, should have been option_add_noextract). It is fixed now and pushed to git. Thanks.

Offline

#139 2010-03-25 12:13:22

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: Clyde - A better libalpm/makepkg wrapper

I really liked the feature in yaourt that it showed whether a package update is software update or just a new release. In other words, it showed the versions of the old and the new package. I suppose there's no plan to implement such behavior in clyde?

Offline

#140 2010-03-25 13:08:43

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: Clyde - A better libalpm/makepkg wrapper

I might (probably) but I do not like that feature all that well (kind of clutters up stuff, imo) so there would be an /etc/clyde.conf option and CLI flag there that allows you enable it or disable it. I do not know if I would have it off or on by default, probably off.

BTW, if you have not updated Clyde in the past two days (a bit less actually but just to be safe) you really should. I had a minor spelling failure in one of the arguments to the function that adds the flag that makes AUR dependencies install as dependencies.

Programmer talk: I had a comma instead of a period in this "tblinsert(config.flags, "T_F_ALLDEPS")" as "tblinsert(config,flags, "T_F_ALLDEPS")" which meant it inserted the value of flags (a nil value) into the config table, instead of inserting "T_F_ALLDEPS" into the config.flags table, which is passed to libalpm to tell it to install as deps, so dependencies were getting installed explicitly. Sorry for that and thanks Daenyth for pointing that out.

BTW, if you do not know by now, I am on IRC most of the time as DigitalKiwi, so if you need to contact me just pop in and PM me if I do not respond in a channel (any of #archlinux, #archlinux-offtopic, and #archlinux-pacman).

Offline

#141 2010-03-25 15:40:58

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443

Re: Clyde - A better libalpm/makepkg wrapper

I might (probably) but I do not like that feature all that well (kind of clutters up stuff, imo) so there would be an /etc/clyde.conf option and CLI flag there that allows you enable it or disable it. I do not know if I would have it off or on by default, probably off.

I agree about it is way to clunky in yaourt but the feature itself is nice. What about color coding it? For example making only pkgrel updated packages grey and every other package white. I see no need for showing the previous version number.

Offline

#142 2010-03-25 15:55:29

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

Re: Clyde - A better libalpm/makepkg wrapper

Would there possibly be a way for clyde to report the status of AUR? So if AUR is down it prints a warning saying so.

Offline

#143 2010-03-26 04:59:48

ShoeUnited
Member
Registered: 2008-04-20
Posts: 8

Re: Clyde - A better libalpm/makepkg wrapper

22:43 < DigitalKiwi> "I love clyde, it is the best, kiwi in no way told me to say this"


Also, probably my first post ever.  YAY CLYDE!

-Shoe


Clyde Have you tried it?  AUR: clyde-git https://aur.archlinux.org/packages.php?ID=34686

...Well?   Have you seen the flippin' chart yet?!  http://omploader.org/vM3p6eg

Offline

#144 2010-03-26 06:46:30

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Clyde - A better libalpm/makepkg wrapper

ijanos wrote:

I might (probably) but I do not like that feature all that well (kind of clutters up stuff, imo) so there would be an /etc/clyde.conf option and CLI flag there that allows you enable it or disable it. I do not know if I would have it off or on by default, probably off.

I agree about it is way to clunky in yaourt but the feature itself is nice. What about color coding it? For example making only pkgrel updated packages grey and every other package white. I see no need for showing the previous version number.

I do. One most software packages a major update may need more preparation for than a minor update.

So, for example, if firefox is updated I'd want to know whether it was 3.6.1-3.6.2 or 3.6.1-3.7.0. The first would not affect much of anything except for bugs. The second may very well invalidate all my plugins.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#145 2010-03-26 09:03:15

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: Clyde - A better libalpm/makepkg wrapper

ShoeUnited wrote:

22:43 < DigitalKiwi> "I love clyde, it is the best, kiwi in no way told me to say this"


Also, probably my first post ever.  YAY CLYDE!

-Shoe

IMHO ShoeUnited == Kiwi big_smile

Offline

#146 2010-03-26 10:01:56

Sertse
Member
Registered: 2009-11-19
Posts: 35

Re: Clyde - A better libalpm/makepkg wrapper

Trying out clyde, liking it so far.

Though I'm a su user, so I'm hoping the whole permissions thing is worked on soon, since you're not meant to do aur things as root. (I know it has been discussed before heh)

Edit: Heh, taking to time o convert to sudo is probably easier. Though ay way to have bash completion with clyde?

Last edited by Sertse (2010-03-26 10:14:10)

Offline

#147 2010-03-26 12:07:14

Kiwi
Member
Registered: 2008-02-24
Posts: 153

Re: Clyde - A better libalpm/makepkg wrapper

I am not as nub as ShoeUnited (sorry Shoe!).

Somewhere in this thread someone posted a bash completion and another place someone said how to do it with zsh. Too tired/do not have enough time/in a foul mood (personal shit, you do not want to know)/ to look it up now but if you have not found it/nobody has pointed it out/next time I am on I will look them up.

Status of AUR is a tricky and hard to test thing, afaict. Any suggestions on how it would test if AUR is down? And how I test testing it? And how do you distinguish between if AUR is down or you do not have proper connectivity? (Other than the massive fail that happens if you try to -S a package without Internet, lawl, I will fix that this weekend for sure). I immediately can think of two ways but one is ugly and the other is so-so.

Due to afore mentioned personal reasons I have not worked on Clyde much more than a few bugs that popped up this week, but it is weekend soon so if I am sober hmm I might actually get some of the stuff done that I keep saying. >.>

Offline

#148 2010-03-26 12:23:30

evr
Arch Linux f@h Team Member
Registered: 2009-01-23
Posts: 554

Re: Clyde - A better libalpm/makepkg wrapper

@Sertse see the post by Andrwe below for bash-completion

Andrwe wrote:

Hi,

I've ported the bash-completion for pacman to clyde.
Here is the file, just save it as clyde in /etc/bash_completion.d/ and relogin.

# vim: set ft=sh ts=2 sw=2 et:
# file: /etc/bash_completion.d/clyde

# Bash completion for clyde
# Original: Manolis Tzanidakis <mtzanidakis@freemail.gr>
# Ported by: Andrwe Lord Weber lord-weber-andrwe <at> renona-studios <dot> org
#
# Distributed under the terms of the GNU General Public License, v2 or later.
#

## initial functions

rem_selected ()
{
  # (Adapted from bash_completion by Ian Macdonald <ian@caliban.org>)
  # This removes any options from the list of completions that have
  # already been specified on the command line.
  COMPREPLY=($(echo "${COMP_WORDS[@]}" | \
    (while read -d ' ' i; do
      [ "${i}" == "" ] && continue
      # flatten array with spaces on either side,
      # otherwise we cannot grep on word boundaries of
      # first and last word
      COMPREPLY=" ${COMPREPLY[@]} "
      # remove word from list of completions
      COMPREPLY=(${COMPREPLY/ ${i%% *} / })
    done
    echo ${COMPREPLY[@]})))
  return 0
}

_available_repos ()
{
  COMPREPLY=( $( compgen -W "$(grep '\[' /etc/clyde.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )" -- $cur ) )
}

_installed_pkgs ()
{
  local installed_pkgs
  installed_pkgs=$( ls /var/lib/pacman/local/ )
  COMPREPLY=( $( compgen -W "$( for i in $installed_pkgs; do echo ${i%-*-*}; done )" -- $cur ) )
}

_available_pkgs ()
{
  #find balks easilly on a find /foo/*/* type dir, especially one like
  #   /var/lib/pacman/*/*
  # This little change-up removes the find *and* only uses enabled repos
  local available_pkgs
  local enabled_repos
  enabled_repos=$( grep '\[' /etc/pacman.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
  available_pkgs=$( for r in $enabled_repos; do echo /var/lib/pacman/sync/$r/*; done )
  COMPREPLY=( $( compgen -W "$( for i in $available_pkgs; do j=${i##*/}; echo ${j%-*-*}; done )" -- $cur ) )
}

_installed_groups ()
{
  local installed_groups
  installed_groups=$( find /var/lib/pacman/local -name desc -exec sed -ne '/%GROUPS%/,/^$/{//d; p}' {} \; | sort -u )
  COMPREPLY=( $( compgen -W "$( for i in $installed_groups; do echo ${i%-*-*}; done )" -- $cur ) )
}

_available_groups ()
{
  #find balks easilly on a find /foo/*/* type dir, especially one like
  #   /var/lib/pacman/*/*
  # This little change-up removes the find *and* only uses enabled repos
  local available_groups
  local enabled_repos
  enabled_repos=$( grep '\[' /etc/clyde.conf | grep -v -e 'options' -e '^#' | tr -d '[]' )
  available_groups=$( for r in $enabled_repos; do sed '/%GROUPS%/,/^$/{//d; p}' /var/lib/pacman/sync/$r/*/desc | sort -u; done )
  COMPREPLY=( $( compgen -W "$( for i in $available_groups; do echo ${i%-*-*}; done )" -- $cur ) )
}

## makepkg completion

_makepkg ()
{
  local cur prev
  COMPREPLY=()
  cur=${COMP_WORDS[COMP_CWORD]}
  prev=${COMP_WORDS[COMP_CWORD-1]}

  case "$prev" in
    -p)
      _filedir
      return 0
    ;;
    --help|--cleancache)
      COMPREPLY=''
      return 0
    ;;
  esac

  if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '\
      -A --ignorearch \
      -b --builddeps \
      -c --clean \
      -C --cleancache \
      -d --nodeps \
      -e --noextract \
      -f --force \
      -g --geninteg \
      -h --help \
      -i --install \
      -L --log \
      -m --nocolor \
      -o --nobuild \
      -p \
      -r --rmdeps \
      -s --syncdeps \
      --asroot \
      --source \
      --noconfirm \
      --noprogressbar' -- $cur ) )
  fi

  rem_selected
}
complete -o default -F _makepkg makepkg

## pacman completion

_instring ()
{
  str="${1}"
  shift 1
  for c in "${@}"; do
    if [ $(expr index "${str}" "${c}") -gt 0 ]; then
      return 0
    fi
  done
  return 1
}

_clyde ()
{
  local a arg toparse op mod cur
  COMPREPLY=()

  # This argument parsing is done so we can check for flag existance later
  #  right now it's a tad crappy, but does the job
  for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )); do
    a=${COMP_WORDS[i]}
    arg="${a:0:2}"
    toparse="${a:2}"

    case "${arg}" in
      -@(U|R|S|Q|h|V))
        op="${arg/-}"
        mod="${mod}${a:2}"
        ;;
      --)
        arg="${a:2}"
        case "${arg}" in
          remove) op="R" ;;
          upgrade) op="U" ;;
          query) op="Q" ;;
          sync) op="S" ;;
          help) op="h" ;;
          version) op="V" ;;
          verbose) mod="${mod}v" ;;
          root) mod="${mod}r" ;;
          dbpath) mod="${mod}b" ;;
          nodeps) mod="${mod}d" ;;
          force) mod="${mod}f" ;;
          groups) mod="${mod}g" ;;
          info) mod="${mod}i" ;;
          list) mod="${mod}l" ;;
          print-uris) mod="${mod}p" ;;
          search) mod="${mod}s" ;;
          sysupgrade) mod="${mod}u" ;;
          upgrades) mod="${mod}u" ;;
          downloadonly) mod="${mod}w" ;;
          refresh) mod="${mod}y" ;;
          changelog) mod="${mod}c" ;;
          deps) mod="${mod}d" ;;
          explicit) mod="${mod}e" ;;
          unrequired) mod="${mod}t" ;;
          foreign) mod="${mod}m" ;;
          owns) mod="${mod}o" ;;
          file) mod="${mod}p" ;;
          search) mod="${mod}s" ;;
          upgrades) mod="${mod}u" ;;
          cascade) mod="${mod}c" ;;
          check) mod="${mod}k" ;;
          dbonly) mod="${mod}k" ;;
          nosave) mod="${mod}n" ;;
          recursive) mod="${mod}s" ;;
          unneeded) mod="${mod}u" ;;
        esac ;;
      *) toparse="${a}" ;;
    esac

    arglen=$(( ${#toparse}-1 ))
    for c in $(seq 0 "${arglen}"); do
      arg=${toparse:$c:1}
      [ "${arg}" != "-" ] && mod="${mod}${arg}"
    done
  done

  cur=${COMP_WORDS[COMP_CWORD]}

  if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '\
      -h --help \
      -Q --query \
      -R --remove \
      -S --sync \
      -U --upgrade \
      -V --version \
      ' -- $cur ) )
    rem_selected
    return 0
  fi

  if [[ "$cur" == -* ]]; then
    case "${op}" in
      U)
        COMPREPLY=( $( compgen -W '\
          --asdeps \
          --asexplicit \
          -d --nodeps \
          -f --force \
          -h --help \
          --config \
          --logfile \
          --noconfirm \
          --noprogressbar \
          --noscriptlet \
          -v --verbose \
          -r --root \
          -b --dbpath \
          --cachedir \
          ' -- $cur ) )
        return 0
        ;;
      R)
        COMPREPLY=( $( compgen -W '\
          -c --cascade \
          -d --nodeps \
          -h --help \
          -k --dbonly \
          -n --nosave \
          -s --recursive \
          -u --unneeded \
          --config \
          --logfile \
          --noconfirm \
          --noprogressbar \
          --noscriptlet \
          -v --verbose \
          -r --root \
          -b --dbpath \
          --cachedir \
          ' -- $cur ) )
        return 0
        ;;
      S)
        COMPREPLY=( $( compgen -W '\
          --asdeps \
          --asexplicit \
          -c --clean \
          -d --nodeps \
          -f --force \
          -g --groups \
          -h --help \
          -i --info \
          -l --list \
          -p --print-uris \
          -s --search \
          -u --sysupgrade \
          -w --downloadonly \
          -y --refresh \
          --needed \
          --ignore \
          --ignoregroup \
          --config \
          --logfile \
          --noconfirm \
          --noprogressbar \
          --noscriptlet \
          -v --verbose \
          -r --root \
          -b --dbpath \
          --cachedir \
          ' -- $cur ) )
        return 0
        ;;
      Q)
        COMPREPLY=( $( compgen -W '\
          -c --changelog \
          -d --deps \
          -e --explicit \
          -g --groups \
          -h --help \
          -i --info \
          -k --check \
          -l --list \
          -m --foreign \
          -o --owns \
          -p --file \
          -s --search \
          -t --unrequired \
          -u --upgrades \
          --config \
          --logfile \
          --noconfirm \
          --noprogressbar \
          --noscriptlet \
          -v --verbose \
          -r --root \
          -b --dbpath \
          --cachedir \
          ' -- $cur ) )
        return 0
        ;;
    esac
    rem_selected
  else
    case "${op}" in
      U)
        COMPREPLY=( $( compgen -d -- "$cur" ) \
                    $( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
        return 0
        ;;
      h|V)
        COMPREPLY=''
        return 0
        ;;
      Q)
        if _instring $mod g; then
          _installed_groups
        elif _instring $mod o; then
          COMPREPLY=( $( compgen -d -- "$cur" ) \
                      $( compgen -f -- "$cur" ) )
        elif _instring $mod p; then
          COMPREPLY=( $( compgen -d -- "$cur" ) \
                      $( compgen -f -X '!*.pkg.tar.gz' -- "$cur" ) )
        elif _instring $mod u; then
          COMPREPLY=''
          return 0
        else
          _installed_pkgs
        fi
        return 0
        ;;
      R)
        _installed_pkgs
        return 0
        ;;
      S)
        if _instring $mod l; then
          _available_repos
        else
          _available_pkgs
        fi
        return 0
        ;;
    esac
  fi

  rem_selected
}
complete -o filenames -F _clyde clyde

Offline

#149 2010-03-26 12:57:52

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

I am not as nub as ShoeUnited (sorry Shoe!).

Sorry if my joke bothered you Kiwi. Basically I meant, not seriously, that you and ShowUnited were the same person. I was implying that his comment was yours in a sort of cheap advertisement. It was just a joke. Didn't meant to piss you neither meant to ridicule yours and Ghost's project. Actually I use Clyde and i like it. wink Anyway we are all noobs when confronted to other people. There is always someone who is smarter, more skilled, has more experience ecc.

Last edited by ArchArael (2010-03-26 13:15:13)

Offline

#150 2010-03-26 14:09:01

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

Status of AUR is a tricky and hard to test thing, afaict. Any suggestions on how it would test if AUR is down? And how I test testing it? And how do you distinguish between if AUR is down or you do not have proper connectivity? (Other than the massive fail that happens if you try to -S a package without Internet, lawl, I will fix that this weekend for sure). I immediately can think of two ways but one is ugly and the other is so-so.

If AUR goes down, there's probably no sane way to test of that. However, don't they usually put up a "down for maintenance" message up?

Offline

Board footer

Powered by FluxBB