You are not logged in.

#76 2010-03-08 22:51:59

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

Re: Clyde - A better libalpm/makepkg wrapper

well done

Offline

#77 2010-03-09 00:16:56

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

Re: Clyde - A better libalpm/makepkg wrapper

Change «$*» to «"$@"» to autoquote properly

Offline

#78 2010-03-09 00:20:04

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

Re: Clyde - A better libalpm/makepkg wrapper

quarkup wrote:
#! /bin/sh

case $1 in
     (-Si | -Ss | -Q*)
          clyde $* ;;

     (-S* | -R* | -U | *)
          /usr/bin/sudo clyde $* || /bin/su -c clyde $* ;; 
     esac

exit 0;

Any reason why you don't just make it

#! /bin/sh

case $1 in
     -Si|-Ss|-Q*)
          clyde "$@" ;;

     *)
          /usr/bin/sudo clyde "$@" || /bin/su -c clyde "$@" ;; 
     esac

exit 0;

?

Or is not putting a ( before the 'case' a bashism?

Offline

#79 2010-03-09 00:26:58

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

Re: Clyde - A better libalpm/makepkg wrapper

well i just looked at the manual right now and it has seemed easier to understand the meaning that way
wink


edit: the shell function would be as simple as

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

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

Last edited by quarkup (2010-03-09 13:11:21)


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

#80 2010-03-09 06:55:51

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

Re: Clyde - A better libalpm/makepkg wrapper

any reason to choose such a function over an alias?

Last edited by EnvoyRising (2010-03-09 06:57:37)

Offline

#81 2010-03-09 10:45:18

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

Re: Clyde - A better libalpm/makepkg wrapper

EnvoyRising wrote:

any reason to choose such a function over an alias?

An alias does not work with arguments the way it is needed.
The functions can filter those arguments and choose what to do for each case.

Using aliases, it would not be possible to choose if there is a need to use root privileges - in some syncing operations and removing packages there is a need to be root (the superuser) therefore by using these superuser tools, like 'sudo' or 'su' the problem gets solved.
Other operations like querying or getting info on packages (-Ss and -Si) would not need the 'superuser' privileges and therefore there is no need to ask for the password.


edit

@Kiwi:

the lines are all scrambled again with that yakuake terminal ( its simmilar to this: http://img38.imageshack.us/img38/5092/clydeupgrade.png )
I am usually pushing the terminal up/down because of other applications and possibly that is interfering with the clyde's output..
This time i upgraded 300 packages and It just seems to happen when upgrading/installing many packages (this require more lines to output)..

Last edited by quarkup (2010-03-09 15:50:53)


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

#82 2010-03-09 15:01:24

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

Re: Clyde - A better libalpm/makepkg wrapper

quarkup wrote:

the lines are all scrambled again with that yakuake terminal ( its simmilar to this: http://img38.imageshack.us/img38/5092/clydeupgrade.png )
I am usually pushing the terminal up/down because of other applications and possibly that is interfering with the clyde's output..
This time i upgraded 300 packages and It just seems to happen when upgrading/installing many packages (this require more lines to output)..

I got exactly the same with uxrvt and tmux.

Offline

#83 2010-03-09 18:43:58

smartboyathome
Member
From: $HOME
Registered: 2007-12-23
Posts: 334
Website

Re: Clyde - A better libalpm/makepkg wrapper

I just wanted to note that I'm using this function for clyde, a slight variation on the previous two:

clyde() {
    case $1 in
        (-Ss | -Si)
            /usr/bin/clyde "$@" ;;
        (-S* | -R* | -U)
            /usr/bin/sudo clyde "$@" ;;
        *)
            /usr/bin/clyde "$@" ;;
    esac
}

The main difference is that by putting (-Ss | -Si) first, I can make sure that they aren't used in the -S* function. This allows me to use sudo only where its really needed IMO, and it allows for greater flexibility. wink

Offline

#84 2010-03-09 19:25:13

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

Re: Clyde - A better libalpm/makepkg wrapper

Right, but searching, etc with clyde via sudo doesn't harm anything, so I still don't see how the above helps? Is it strictly for the sake of not calling sudo where it isn't technically needed?

Don't get me wrong, I think it's clever, but IMHO its merits, are outweighed by its brevity.

At any rate, this community never ceases to amaze me with its creativity, so don't take my posts as a diss to anyone who is using it.

Offline

#85 2010-03-09 22:21:18

smartboyathome
Member
From: $HOME
Registered: 2007-12-23
Posts: 334
Website

Re: Clyde - A better libalpm/makepkg wrapper

EnvoyRising wrote:

Right, but searching, etc with clyde via sudo doesn't harm anything, so I still don't see how the above helps? Is it strictly for the sake of not calling sudo where it isn't technically needed?

It is more on the just in case factor, and can save time by not having to enter your password where it isn't strictly needed. At least, that is why I am doing it, because I can't speak for anyone else.

Offline

#86 2010-03-09 22:51:00

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

Re: Clyde - A better libalpm/makepkg wrapper

That's my case too.

In my opinion it is easier to make searches or getting info for packages dependencies without using every time the password - the same way that I think that it is easier to execute a small command than a big one, specially for those who frequently use the AUR/repos.


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

#87 2010-03-09 23:14:59

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

Re: Clyde - A better libalpm/makepkg wrapper

In my opinion, and as far as I can get, this is a good function.
Created by and for those who prefer a more techie and suitable approach..
wink

c() {
    case $1 in
        (-Ss | -Si | -Q* | -T)
            /usr/bin/clyde "$@" ;;
        (-S* | -R* | -U | *)
            /usr/bin/sudo /usr/bin/clyde "$@" || /bin/su -c /usr/bin/clyde "$@" || return $? ;;
    esac
}

Notice: If you have a funcion with the name of an alias, the function will not work (bash prefers the aliases to functions and applications).


- edited again due to the "special" flags (things like --noconfirm and etc.. which ususally are put before the -S flags)

Last edited by quarkup (2010-03-11 00:53:00)


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

#88 2010-03-10 03:02:29

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

Re: Clyde - A better libalpm/makepkg wrapper

EnvoyRising wrote:

Right, but searching, etc with clyde via sudo doesn't harm anything, so I still don't see how the above helps? Is it strictly for the sake of not calling sudo where it isn't technically needed?

Its good practice from a security standpoint not to elevate permissions unless necessary. Sure you can be reasonably sure that clyde will behave, but what if it doesn't? Also, as other people pointed out, entering password eat up time, especially strong ones.

Offline

#89 2010-03-10 06:52:07

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

Re: Clyde - A better libalpm/makepkg wrapper

I don't mess around in clyde/pacman much, so for me the time argument issue is moot. Especially since sudo stays active for a certain amount of time after executed. However, I do by the security option. I will conceed that it is annoying to have to type a password for simply searching though. Perhaps I'll try it out, not sure.

At any rate, I understand this thread isn't a "Convence EnvoyRising to use more geeky/convenient methods to envoke clyde thread, but I certaintly appreciate the responses, and think they will help others out as well.

Back on topic though, clyde is so far the only pacman replacement (because it's not a wrapper tongue) that I have kept for more than one day since I've found yaourt. I'm really impressed with the transparency of it's interface -- that is, I could have aliased clyde with pacman OR yaourt and not realized that it was in fact clyde underneathe if not for the blatant difference in speed. Thanks Kiwi!

Offline

#90 2010-03-10 10:17:07

sxe
Member
Registered: 2009-06-04
Posts: 103

Re: Clyde - A better libalpm/makepkg wrapper

EnvoyRising wrote:

Back on topic though, clyde is so far the only pacman replacement (because it's not a wrapper tongue) that I have kept for more than one day since I've found yaourt. I'm really impressed with the transparency of it's interface -- that is, I could have aliased clyde with pacman OR yaourt and not realized that it was in fact clyde underneathe if not for the blatant difference in speed. Thanks Kiwi!

I second this. Thanks for your work Kiwi. I'm waiting for the day i can remove yaourt and use clyde only. smile

Offline

#91 2010-03-11 21:56:00

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

Re: Clyde - A better libalpm/makepkg wrapper

You guys are welcome. big_smile

Anyway, spring break starts tomorrow so expect me to be doing lots of work on Clyde for a good part of that week.

As I said earlier I have implementations of -G/-Gd/-Sc/-Scc written I just have not pushed them for various reasons...I shall try to do that tonight.

I still have not done color profiles so I will do that next because I told someone I would get them in soon. >.> Then on to updating --help and -Su --aur!

Offline

#92 2010-03-11 22:12:51

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

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

You guys are welcome. big_smile

Anyway, spring break starts tomorrow so expect me to be doing lots of work on Clyde for a good part of that week.

As I said earlier I have implementations of -G/-Gd/-Sc/-Scc written I just have not pushed them for various reasons...I shall try to do that tonight.

I still have not done color profiles so I will do that next because I told someone I would get them in soon. >.> Then on to updating --help and -Su --aur!

Looking forward to those additions. I prefer building packages from aur by hand anyways and this way I can finally remove of packer.

Offline

#93 2010-03-11 22:47:10

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: Clyde - A better libalpm/makepkg wrapper

Hey - I was just reinstalling a pkg I maintain (goobook-svn) and noticed that permissions seem to be different on the files when I install via clyde vs using the PKGBUILD and makepkg. With clyde, I get:

[firecat53@homeserver ~]$ ls /usr/lib/python2.6/site-packages/goobook-1.1-py2.6.egg-info/ -l
total 28
-rwx------ 1 root root    1 Mar 11 14:42 dependency_links.txt
-rwx------ 1 root root   42 Mar 11 14:42 entry_points.txt
-rwx------ 1 root root 4721 Mar 11 14:42 PKG-INFO
-rwx------ 1 root root   12 Mar 11 14:42 requires.txt
-rwx------ 1 root root  300 Mar 11 14:42 SOURCES.txt
-rwx------ 1 root root    8 Mar 11 14:42 top_level.txt

and with makepkg, pacman -U, I get:

[firecat53@homeserver ~]$ ls /usr/lib/python2.6/site-packages/goobook-1.1-py2.6.egg-info/ -l
total 28
-rw-r--r-- 1 root root    1 Mar 11 12:47 dependency_links.txt
-rw-r--r-- 1 root root   42 Mar 11 12:47 entry_points.txt
-rw-r--r-- 1 root root 4721 Mar 11 12:47 PKG-INFO
-rw-r--r-- 1 root root   12 Mar 11 12:47 requires.txt
-rw-r--r-- 1 root root  300 Mar 11 12:47 SOURCES.txt
-rw-r--r-- 1 root root    8 Mar 11 12:47 top_level.txt

Is this a clyde issue, or a problem with my PKGBUILD?

Thanks,
Scott

Offline

#94 2010-03-13 12:29:16

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

Re: Clyde - A better libalpm/makepkg wrapper

I think I fixed that, firecat53, as I had you test it on IRC. >.>

I have added -Sc/-Scc/-G/-Gd, updated --help (thanks evaryont for doing a bit of that), and fixed a few minor bugs nobody else had noticed. (all pushed to github)

I will be changing -G most likely to store the files in the current directory, unless you guys like it how it is now. Currently it stores the files it downloads in /tmp/clyde/pkgname/pkgname.tar.gz and /tmp/clyde/pkgname/pkgname/PKGBUILD/install, etc.

Sometime I will be making it so you can change where it stores tmp files. I should also add a switch/config for storing built packages too...they too currently go in tmp. You can, however, set PKGDEST in /etc/makepkg.conf and it will honor that. (Technically it does not have control over whether it gets moved or not, but it will properly change directory if makepkg.conf does have that set).

So, a bunch of people on IRC want colors for -Qi/Si and a few others, and someone mentioned options for removing makedepends, and I still want/need to finish the color profiles and -Syu --aur. You can expect some major updates along those lines in the next few days.

There also seems to be a bug with installing multiple aur pkgs or some such (it hangs indefinitely at/towards the end), I have a hunch as to why but am not sure. I will test it out later. (I think it is miscounting how many packages it has installed and/or it needs to install, so thus waits for more work when there is not any).

Thanks!

Offline

#95 2010-03-13 15:02:58

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

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

I will be changing -G most likely to store the files in the current directory, unless you guys like it how it is now. Currently it stores the files it downloads in /tmp/clyde/pkgname/pkgname.tar.gz and /tmp/clyde/pkgname/pkgname/PKGBUILD/install, etc.

So, a bunch of people on IRC want colors for -Qi/Si and a few others, and someone mentioned options for removing makedepends, and I still want/need to finish the color profiles and -Syu --aur. You can expect some major updates along those lines in the next few days.

Thanks Kiwi !

I agree with the -G to download the PKGBUILD files to the current directory also. In my opinion it would be easier because usually I use -G to edit the overall files and use makepkg after then. It could create a folder for that package too, like "clyde -G xpto" would create the folder "xpto" and grab the PKGBUILD files to this folder.



- A Feature Request (a simple one)

I am not sure about this but it would be very helpful if clyde had a flag to create a new PKGBUILD template
like copying the /usr/share/pacman/PKGBUILD.proto file to a new directory

like
"clyde -Gt xpto" or "clyde -Gn xpto"

- would create a directory named "xpto";
- would copy the /usr/share/pacman/PKGBUILD.proto template to that folder; (changing the $pkgname to "xpto" would be great too)



- Would this be considered a bug ?

When installing aur's packages from the AUR like: "clyde -S aur/quiteinsane"
Clyde does not recognize (yet) that the beginning "aur/" means the AUR although imo it could do the same as "clyde -S quiteinsane"


Hey Kiwi, good job with clyde ^^


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

#96 2010-03-13 17:22:58

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

Re: Clyde - A better libalpm/makepkg wrapper

- Would this be considered a bug ?

When installing aur's packages from the AUR like: "clyde -S aur/quiteinsane"
Clyde does not recognize (yet) that the beginning "aur/" means the AUR although imo it could do the same as "clyde -S quiteinsane"

Not so much a bug, just a missing feature. I intend to make aur/package work the same as in normal repos to override the one it wants to install, I just have not got to it....

For those who are not aware: If two repos have the same name package, it is possible to install from a specific one by installing it as 'repo/package' instead of 'package'.

Offline

#97 2010-03-13 17:44:47

Tyriel
Member
From: Melbourne, Australia
Registered: 2009-01-20
Posts: 161
Website

Re: Clyde - A better libalpm/makepkg wrapper

I have to say thanks... this is an awesome project.  Keep up the great work!


The software required Windows XP or better, so I installed archlinux.

Offline

#98 2010-03-13 18:02:22

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

Re: Clyde - A better libalpm/makepkg wrapper

Kiwi wrote:

- Would this be considered a bug ?

When installing aur's packages from the AUR like: "clyde -S aur/quiteinsane"
Clyde does not recognize (yet) that the beginning "aur/" means the AUR although imo it could do the same as "clyde -S quiteinsane"

Not so much a bug, just a missing feature. I intend to make aur/package work the same as in normal repos to override the one it wants to install, I just have not got to it....

For those who are not aware: If two repos have the same name package, it is possible to install from a specific one by installing it as 'repo/package' instead of 'package'.

There's no need for this at all, since packages in AUR are not allowed to share a name with packages in the official repos. About the only thing it could be used for is to prefer aur over arch-games or archlinunxfr perhaps.

Offline

#99 2010-03-13 18:19:15

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

Re: Clyde - A better libalpm/makepkg wrapper

Clyde installs dependencies before I can edit the PKGBUILD. Even if I want to remove some dependencies in the PKGBUILD I still have to install them first. Is it possible to show edit before installing dependencies?

I was the "someone" on IRC that suggested removing makedepends after install. I have a related thing: I still have all dependencies installed if a package fails to build. Would it be possible to remove leftover packages after a failed build?

Offline

#100 2010-03-13 20:49:07

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

Re: Clyde - A better libalpm/makepkg wrapper

efiloN wrote:

Clyde installs dependencies before I can edit the PKGBUILD. Even if I want to remove some dependencies in the PKGBUILD I still have to install them first. Is it possible to show edit before installing dependencies?

I was the "someone" on IRC that suggested removing makedepends after install. I have a related thing: I still have all dependencies installed if a package fails to build. Would it be possible to remove leftover packages after a failed build?

I'd rather it didn't for the simple fact that if a build fails and I can correct the error that caused it to fail, I don't want to have to reinstall all of the dependencies. Perhaps a flag/config option?

Last edited by EnvoyRising (2010-03-13 20:55:55)

Offline

Board footer

Powered by FluxBB