You are not logged in.

#76 2010-01-17 10:45:10

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

r6 wrote:

Bruenig, one more thing, could you make -Ss the default option? This is the behaviour I'm used to with yaourt. (eg. you can type yaourt python to search for python).

All along I have been waiting to add this with the numbered prefixes and so on because I knew messing with the pacman output in order to get it right would be really difficult. Yaourt does it by walking through each line of the pacman output which is very much the reason why it is soooo slow. In the previous parts of the code, I can just pacman -Ss foo and let that output just go straight out (therefore not having to mess with formatting and such). Unfortunately if you want to number and allow someone to come up later and type in numbers to install, you have to do something more than that.

Anyways, I have pushed something that just numbers. I will work on having a prompt allowing the user to type in the numbers later. As short as the code is to get it to do this. It took me a long time to figure it out. So if anyone is interested in seeing it, they should take a look. I think it is pretty interesting. Just very hackish, but intentionally so for speed purposes.

Offline

#77 2010-01-17 17:18:28

Sirsurthur
Member
Registered: 2009-02-02
Posts: 114

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Great work. It's really fast and promising. Will you also try to add the -Rs package option and maybe the -Qdt one too ?

Great work smile

Offline

#78 2010-01-18 00:48:08

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Ok I have added full support for: packer pkg1 pkg2 ... If you type that it will search for matches and prefix each match with a number, which you can then type and install. packer -S packer to get the latest.

Tell me if there are any problems.

I was testing against yaourt and I found this. Yaourt fails to find all of the matches. If you needed any other reason to switch, here it is. Yaourt is not only slow, but it simply does not even search correctly (missing 4 of 7 aur matches)

[bruenig ~]$ packer pacman wrapper
0 extra/srcpac 0.6-2
    The pacman from-source wrapper
1 community/aqpm 1.3.3.2-1
    Qt wrapper around pacman's libalpm
2 community/powerpill 17.0-3
    A wrapper for pacman that speeds up package retrieval by using aria2c for
    concurrent/segmented downloads.
3 aur/airpac 0.1.2-1
    aria2c wrapper for pacman
4 aur/yaourt-git 20091130-1
    A pacman wrapper with extended features and AUR support
5 aur/srcman 0.3-1
    A pacman wrapper which transparently handles source packages
6 aur/pacatatime-git 20090616-1
    A wrapper on pacman that install few packages at a time. This is good if you have little free space (like I do on my Eee)
7 aur/srcpac-git 20091125-1
    The pacman from-source wrapper
8 aur/pacmatic 20100114-1
    A pacman wrapper to avoid bricking your system and such other surprises.
9 aur/packer 20100107-1
    Bash wrapper for pacman and aur

Type numbers to install. Separate each number with a space.
Numbers: ^C
[bruenig ~]$ yaourt pacman wrapper
1 extra/srcpac 0.6-2
     The pacman from-source wrapper
2 community/aqpm 1.3.3.2-1
     Qt wrapper around pacman's libalpm
3 community/powerpill 17.0-3
     A wrapper for pacman that speeds up package retrieval by using aria2c for
     concurrent/segmented downloads.
4 aur/pacmatic 20100114-1 (33)
    A pacman wrapper to avoid bricking your system and such other surprises.
5 aur/srcman 0.3-1 (8)
    A pacman wrapper which transparently handles source packages
6 aur/yaourt-git 20091130-1 (174)
    A pacman wrapper with extended features and AUR support
==>  Enter n° (separated by blanks, or a range) of packages to be installed
==>   ----------------------------------------------
==>^C
[bruenig ~]$

Last edited by bruenig (2010-01-18 01:52:10)

Offline

#79 2010-01-18 04:12:16

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Added --auronly option. smile

Offline

#80 2010-01-18 06:15:50

olegchir
Member
From: Russian Federation,Novosibirsk
Registered: 2010-01-18
Posts: 7
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

bruenig, can you add support for --skipinteg? (or maybe it can be globally overriden somewhere?)

Offline

#81 2010-01-18 07:38:44

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

I added --devel. It only works when you are doing -Su or -Syu and is ignored if used with any other command.

It downloads the PKGBUILDs of all of the aur packages installed and then sees if they have any of the following variables in their pkgbuilds: _darcstrunk _cvsroot _gitroot _svntrunk _bzrtrunk _hgroot. If so, it puts in the queue to install. Note when you use --devel, the process for testing versions and such is ever so slightly slower because instead of using the json api, it uses PKGBUILD which are a little bigger than json output. It is actually almost unnoticable, the speed drop, which kind of suprised me.

Note: Unless someone tells me otherwise, I have no real way of figuring out whether the remote git/svn or whatnot has actually updated over the installed version, so it simply installs regardless. I believe yaourt had the same behavior, but it is something to know.

Last edited by bruenig (2010-01-18 07:40:05)

Offline

#82 2010-01-18 07:41:22

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

olegchir wrote:

bruenig, can you add support for --skipinteg? (or maybe it can be globally overriden somewhere?)

Adding support for it would be trivial, I just don't know why. Like, are you wanting to skip integrity checks for things you download off the aur?

Offline

#83 2010-01-18 10:03:48

hsa2
Member
From: Turkey
Registered: 2008-05-26
Posts: 46
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

[hsa2@businessboi ~]$ packer -S gnome
Package `gnome' does not exist.

Actually, it exist. Looks like packer is not able to install package groups, is this a bug?

Offline

#84 2010-01-18 16:40:03

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 3,475
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

You have added many new features to packer. Originally, packer only had "4 major functions". I wonder, what are your goals for packer?

It doesn't really matter what the goals for packer are to me, as long as it is still super fast. wink Packer is perfect for me with just the four major functions.

Offline

#85 2010-01-18 19:13:23

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

drcouzelis wrote:

You have added many new features to packer. Originally, packer only had "4 major functions". I wonder, what are your goals for packer?

It doesn't really matter what the goals for packer are to me, as long as it is still super fast. wink Packer is perfect for me with just the four major functions.

There are only four major functions. The rest are modifications on those functions. Like I mean to say, there is no removing of packages, or querying of local packages, or anything you can do with pacman. There is still only -Ss, -Syu, -Si, and -S. The --auronly, --noconfirm, --devel are just modifications on the behavior of each of those commands. I had always intended to put at least those in there, I just needed to get everything solid to do so.

Offline

#86 2010-01-18 20:59:09

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 3,475
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Offline

#87 2010-01-18 21:07:56

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Thanks bruenig. So far Im really liking packer.

Offline

#88 2010-01-18 23:39:09

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

hsa2 wrote:
[hsa2@businessboi ~]$ packer -S gnome
Package `gnome' does not exist.

Actually, it exist. Looks like packer is not able to install package groups, is this a bug?

You are right. I fixed it. Get the latest version of packer with packer -S packer. The fix now checks if supplied packages are pacman packages or pacman groups or aur packages, and if meets any one of those puts in the queue to install. I am not sure if there is a such thing as groups on aur, but if there are, it does not support that and I am really not sure how you would implement that without being really slow.

Offline

#89 2010-01-18 23:41:37

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Thanks a lot for all of this seriously. This should help a lot to get people to get people to see it exists and teach them how to use it (not that it is that hard if you know how to use pacman smile.

Offline

#90 2010-01-19 01:37:27

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Kudos comrade.  Keep up the good work.


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#91 2010-01-19 01:38:10

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Packer is not detecting updates to AUR packages for me. For example I have pybgsetter 0.3-1 installed but it doesn't offer me 0.3-2:

665699864201001181263865165579x372scrot.png

Offline

#92 2010-01-19 03:23:05

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

anonymous_user wrote:

Packer is not detecting updates to AUR packages for me. For example I have pybgsetter 0.3-1 installed but it doesn't offer me 0.3-2:

http://www.zwixy.com/images/66569986420 … 2scrot.png

Fixed. I was using vercmp and was testing if -gt 1 when it should have been -gt 0. Anyways, typo, fixed. packer -S packer and try again. In addition, I took out two sed's and a grep that were previously used in this function, so speed increase smile.

Last edited by bruenig (2010-01-19 03:27:29)

Offline

#93 2010-01-19 03:30:11

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,058

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Great, thanks.

Offline

#94 2010-01-19 05:40:47

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Many people have talked to me about pacdiffviewer from yaourt. Some saying they use it a lot and really like it and that they could not give up yaourt without it. To keep it short, I forked it, modifying it to work as a stand alone application called pacdiff.

Here are the links

github link
aur link
forum post about pacdiff

Hopefully those who mentioned it in this thread will read this and find what they need and finally free themselves from yaourt!

Last edited by bruenig (2010-01-19 06:00:17)

Offline

#95 2010-01-19 06:20:29

xduugu
Member
Registered: 2008-10-16
Posts: 289

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Just had a quick look at your code and these lines made me cry:

# Info (-Si) handling
if [[ $option = info ]]; then
# Pacman info check
sourcemakepkgconf
for package in "${packageargs[@]}"; do
<...>
else # Check to see if it is in the aur
wget -q "http://aur.archlinux.org/packages/$package/$package/PKGBUILD" -O "$tmpfile"
[[ $? -eq 0 ]] || err "No result found."
. "$tmpfile"

You _really_ should use rpc.php here; sourcing unknown code is more than reckless.

Offline

#96 2010-01-19 07:03:50

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

xduugu wrote:

Just had a quick look at your code and these lines made me cry:

# Info (-Si) handling
if [[ $option = info ]]; then
# Pacman info check
sourcemakepkgconf
for package in "${packageargs[@]}"; do
<...>
else # Check to see if it is in the aur
wget -q "http://aur.archlinux.org/packages/$package/$package/PKGBUILD" -O "$tmpfile"
[[ $? -eq 0 ]] || err "No result found."
. "$tmpfile"

You _really_ should use rpc.php here; sourcing unknown code is more than reckless.

rpc does not give any useful information for -Si.

It doesn't provide dependency information for instance. I would love if the aur developers would actually provide this relevant information in the rpc, but until they do, how else am I supposed to reliably find dependency information? I was told by one of them that their parser doesn't really work very well and that caused problems with their stuff.

Anyways, I will try to conceive of some way to parse it out of the pkgbuild without sourcing. If you can think of a way, that would be great too. By the way, that is also where I get dependency information when I am resolving aur package dependencies smile. Yaourt does the same.

When coming up with a reliable parser, take into consideration that this counts as a legitimate depends array and should parse correctly.

               depends=('hmm'                        'what'
      'wet' \
        'lolque')

Oh and recall again that some pkgbuild's have conditional dependencies. They test one's CARCH, then depending on whether that is i686 or x86_64, they define a different set of depends. Good luck smile. No but seriously, it is impossible. Unless you want to rewrite a  bash parser in bash.

Last edited by bruenig (2010-01-19 07:32:28)

Offline

#97 2010-01-19 07:45:36

res
Member
Registered: 2010-01-14
Posts: 55

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

Do you display pkgbuilds before sourcing? If not, switch the order. Problem solved.

Offline

#98 2010-01-19 07:49:45

bruenig
Member
Registered: 2007-05-20
Posts: 175

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

res wrote:

Do you display pkgbuilds before sourcing? If not, switch the order. Problem solved.

Let's say you do packer -S pkg1, and pkg1 has 3 dependencies on aur, all of which have 3 dependencies on aur. When the program is resolving all of those dependencies by downloading pkgbuild after pkgbuild and sourcing, you wish all 12 of those pkgbuild's to be shown to you as it resolves one by one? If this is the sort of thing you are interested in, you probably are looking for slurpy which just downloads the aur tarball and lets you figure out what to do with it.

Last edited by bruenig (2010-01-19 07:51:34)

Offline

#99 2010-01-19 08:09:20

res
Member
Registered: 2010-01-14
Posts: 55

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

bruenig wrote:

If this is the sort of thing you are interested in, you probably are looking for slurpy which just downloads the aur tarball and lets you figure out what to do with it.

True, but it's more like an option request than anything. No one, or at least few enough people, would realistically use it during large updates with plenty of dependencies, yet it's there for those that rightfully don't like blindly sourcing foreign code.

Offline

#100 2010-01-19 12:13:08

olegchir
Member
From: Russian Federation,Novosibirsk
Registered: 2010-01-18
Posts: 7
Website

Re: packer - New bash aur+pacman wrapper (replaces poorly written yaourt)

bruenig wrote:
olegchir wrote:

bruenig, can you add support for --skipinteg? (or maybe it can be globally overriden somewhere?)

Adding support for it would be trivial, I just don't know why. Like, are you wanting to skip integrity checks for things you download off the aur?

Exactly
There's a lot of packages with wrong md5 or without it at all... beginning from yaourt itself sad

Offline

Board footer

Powered by FluxBB