You are not logged in.

#101 2010-03-13 22:22:08

efiloN
Member
Registered: 2010-03-13
Posts: 2

Re: Clyde - A better libalpm/makepkg wrapper

Or a "Would you like to remove leftover dependencies? [Y/N]". That one could be displayed for both makedepends and failed builds.

Offline

#102 2010-03-14 09:34:40

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: Clyde - A better libalpm/makepkg wrapper

I just started using Clyde, and it's asking me to select my default text editor - [request]: check if $EDITOR is set, and if so, USE IT, instead of asking me questions.

Offline

#103 2010-03-14 10:19:34

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

Re: Clyde - A better libalpm/makepkg wrapper

There are problems getting $EDITOR from Lua when sudo is involved (well in general really, it is not 100% bulletproof depending on how the user has set EDITOR), believe me, I tried.... Long story short, I would love to but it will not be happening.

Random trivia: It is not impossible to get EDITOR from  $SHELLrcs. I did it in the past before clyde.conf, it just relied on assumptions upon assumptions and was a huge, ugly, unreliable mess. Thus the config was born, which is dozens of times more reliable and clean and allows for cool things. You should have one anyway. (It will whinge until you make one as well so I highly recommend making one...)

Offline

#104 2010-03-14 10:58:28

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

Re: Clyde - A better libalpm/makepkg wrapper

Oh thats interesting, i think sudo doesnt really touch the the environment variables though I dont know any lua. But why not write the default editor in the config file based on $EDITOR when the config is created?

Offline

#105 2010-03-14 18:53:38

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

Re: Clyde - A better libalpm/makepkg wrapper

For sudo to preserve environment variables, you need to run sudo -E or have SETENV set in sudoers

Offline

#106 2010-03-15 04:34:13

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: Clyde - A better libalpm/makepkg wrapper

It wouldn't be as simple as dropping privileges to check that variable, then regaining them and continuing? Just a thought.

Offline

#107 2010-03-15 11:28:43

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: Clyde - A better libalpm/makepkg wrapper

for sudo users

c(){
case $1 in
     (-Si|-Ss|-Q*|-T)
          clyde "$@" ;;

     *)
          /usr/bin/sudo -E clyde "$@" || return $? ;; 
     esac
}

Last edited by quarkup (2010-03-15 11:29:16)


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#108 2010-03-16 11:22:12

Andrwe
Member
From: Leipzig/Germany
Registered: 2009-06-17
Posts: 322
Website

Re: Clyde - A better libalpm/makepkg wrapper

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

Last edited by Andrwe (2010-03-16 11:23:21)


Website: andrwe.org

Offline

#109 2010-03-17 16:35:45

IsSuE
Member
Registered: 2006-04-29
Posts: 309

Re: Clyde - A better libalpm/makepkg wrapper

how can i update my aur packages with clyde from git? i tried with --aur but that doesnt do anything

Offline

#110 2010-03-17 16:41:28

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

Re: Clyde - A better libalpm/makepkg wrapper

IsSuE wrote:

how can i update my aur packages with clyde from git? i tried with --aur but that doesnt do anything

it is not implemented yet.

Offline

#111 2010-03-17 21:03:58

scio
Member
From: Buffalo, NY
Registered: 2008-08-05
Posts: 366

Re: Clyde - A better libalpm/makepkg wrapper

In the mean time, you can just do -S on them to reinstall them.

Offline

#112 2010-03-17 21:29:54

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: Clyde - A better libalpm/makepkg wrapper

there is another "bug"

why do it checks for /var/lib/pacman/db.lck when all I want is an AUR package ??   wink


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#113 2010-03-17 23:39:56

schen
Member
Registered: 2009-06-06
Posts: 468

Re: Clyde - A better libalpm/makepkg wrapper

I have a small feature request: Whenever I used yaourt, I didn't have to type sudo, just

yaourt -Syu

or whatever else I had to do, and it would automatically prompt sudo like this:

schen@arch> yaourt -Syu                                                                                             ~
Password:

Just adding a little suggestion!

Offline

#114 2010-03-17 23:43:54

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Clyde - A better libalpm/makepkg wrapper

It helps to read the thread. That feature has already been discussed and will be implemented later.

Offline

#115 2010-03-18 00:29:13

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: Clyde - A better libalpm/makepkg wrapper

I would like to see feature like "always build from source".
So if I ran -Syu and there is an update for packageXY, it would build it from source and install it.
Those packages will be defined in conf file, ofcourse.

Last edited by ammon (2010-03-18 00:29:30)

Offline

#116 2010-03-18 17:47:11

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: Clyde - A better libalpm/makepkg wrapper

check:
having the [arch-games] repository "clyde -S true-combat" is installing from AUR, it should use the "true-combat" binary unless explicited to build from abs/aur/source


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#117 2010-03-18 18:27:04

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Clyde - A better libalpm/makepkg wrapper

quarkup wrote:

check:
having the [arch-games] repository "clyde -S true-combat" is installing from AUR, it should use the "true-combat" binary unless explicited to build from abs/aur/source

http://github.com/Kiwi/clyde/issues

Offline

#118 2010-03-18 21:17:41

schen
Member
Registered: 2009-06-06
Posts: 468

Re: Clyde - A better libalpm/makepkg wrapper

Sorry Daenyth. I did read the thread but I guess I didn't read it well enough.

Offline

#119 2010-03-19 10:04:55

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: Clyde - A better libalpm/makepkg wrapper

Is this a tilda problem?
tM3ZyYw


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#120 2010-03-19 19:04:27

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Clyde - A better libalpm/makepkg wrapper

ammon wrote:

I would like to see feature like "always build from source".
So if I ran -Syu and there is an update for packageXY, it would build it from source and install it.
Those packages will be defined in conf file, ofcourse.

I would like this too. Or if you could add a -b flag to build a package from abs.

clyde -Syb kernel26

Offline

#121 2010-03-19 19:18:40

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Clyde - A better libalpm/makepkg wrapper

Wouldn't -Syb be more as an "abs", and then -Syub would be to update from that?

Offline

#122 2010-03-20 02:15:58

quarkup
Member
From: Portugal
Registered: 2008-09-07
Posts: 497
Website

Re: Clyde - A better libalpm/makepkg wrapper

Cdh wrote:

Is this a tilda problem?
http://omploader.org/tM3ZyYw

you are not the only one, this has been mentioned - it happens also with yakuake (i posted a pic before on this thread).


If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.
Simplicity is the ultimate sophistication.

Offline

#123 2010-03-20 04:05:33

matthewbauer
Member
From: /usa/ks
Registered: 2009-07-20
Posts: 86

Re: Clyde - A better libalpm/makepkg wrapper

I enjoy using Clyde a lot.

But I think I've found a trivial bug:
When using clyde -Si of AUR packages the optional dependencies are not seperated correctly like:

Optional Deps  : aurvote:
                 vote
                 for
                 favorite
                 packages
                 from
                 AUR
,,,

Libertarian Arch Linux User

Offline

#124 2010-03-20 06:35:20

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

Re: Clyde - A better libalpm/makepkg wrapper

I have fixed that problem with opt depends in aur pkgs.

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.

quarkup, second issue, I am not sure how that is possible. Did you remember to run clyde -Sy after adding arch-games to /etc/clyde.conf? It should check repos first, and only move to aur if it did not find it in repos.

First issue, even though you "just want an AUR package", presuming you want to install and aren't just using -G, then it still has to do stuff that requires you do not have a db.lck.

ammon, check out pacbuilder and srcpac, they currently are more in the realm of building packages outside of aur from source than Clyde is.

ABS support will eventually be in Clyde just do not expect it any time incredibly soon.

schen, see here

Okay, so... in regards to -Syu --aur and color profiles. Still not done as you may have noticed. For that I would like to apologize. I have not been feeling incredibly well and kind of lazy and a bit burnt out, so even though I have been on Spring break, I have not done too much work on Clyde like I intended. As some of you know I work on several projects already, (curlpaste, ompluad, clyde, all excellent programs I might add!), in addition to trying to learn Ruby. My most recent endeavor is to write Pkgfile in Lua (Lpkgfile is about 5-6 times faster than Pkgfile), which has been...interesting. (Eventually I want to rewrite all of Pkgtools in Lua, btw). The whole thing is kind of hilarious and annoying at the same time.

Continue on if you want to hear a story:
Basically because of Cpufrequtils having a 95% threshold for ondemand governor even a simple Pkgfile search took a minute, (I did not know that was the reason it was so slow at the time) so I was like "screw this I'll do it in Lua." Later I found out that for most people Pkgfile took only like 7-10 seconds, but I was already getting faster results with Lpkgfile so I was semi-happy. It was still slower than I liked though, and knew it should/could be faster, so I experimented with various ways of making it better. Overall I spent about 15-20 hours on that task, only to always end up with something that took 3 seconds when I was getting 1.3 with the regular way. The regular way being to iterate over the pkgtools/lists directory opening and reading every 'files' file and doing pattern matches. My, theoretically better, but in practice slower, way of making serialized files that could be loaded into Lua as tables was the majority of that time. The data structures are massive so loading them into ram was problematic. Mostly it was slow to do so, it also used a lot of ram and cpu. Anyway, I learned a few cool tricks that I may be able to use in future projects but for this one are pretty pointless at the moment. So I decided to stick with the way I had, 1.3 seconds is pretty darn swift wink . Then it went back to being slow, that was when I started monitoring my cpu speed when I ran the tests and found that it was not scaling properly and found out about Cpufrequtils being mean to me, and fixed it. This also greatly improved flash performance! big_smile See here for info on that

tl;dr
I will try to get to color profiles and -Syu --aur this weekend...and fix a few bugs.

Offline

#125 2010-03-20 09:13:08

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

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.

Yeah terminal capabilities are mess. I dont want to disappoint you, but tilda is a standard vte terminal (gnome terminal, sakura, xfceterminal uses this same widget), i got the same issue in urxvt (tmux is just a multiplexer like screen) and some else got in in the standard kde terminal widget (i guess that is what yakauke using). Imho more than 90% of arch users use one from this three. What terminal program do you use?

Offline

Board footer

Powered by FluxBB