You are not logged in.

#1 2012-02-19 09:32:04

snoopcatt
Member
From: Russia
Registered: 2012-02-19
Posts: 8

Fix for yaourt

For fix this issue

In /usr/lib/yaourt/aur.sh:

#!/bin/bash
#
# aur.sh : deals with AUR
# This file is part of Yaourt (http://archlinux.fr/yaourt-en)

AUR_PKG_URL="$AURURL/packages.php?setlang=en&ID="

load_lib abs
load_lib pkgbuild

# Fix 
make_prefix() {
echo "$1" | grep -o ^..
}

# Get sources in current dir
aur_get_pkgbuild() {
        [[ $1 ]] || return 1
        local pkg=${1#*/}
        local prefix=$(make_prefix $pkg)
        #(( $# > 1 )) && local pkgurl=$2 || \
        #local pkgurl=$(pkgquery -Aif "%u" "$pkg")
        local pkgurl="$AURURL/packages/$prefix/$pkg/$pkg.tar.gz"
        if [[ ! "$pkgurl" ]] || ! curl_fetch -fs "$pkgurl" -o "$pkg.tar.gz"; then
                error $(_gettext '%s not found in AUR.' "$pkg");
                return 1;
        fi
        bsdtar --strip-components 1 -xvf "$pkg.tar.gz"
        rm "$pkg.tar.gz"
}
...
...

Last edited by snoopcatt (2012-02-19 09:33:24)

Offline

#2 2012-02-19 09:56:32

crab
Member
From: Brisbane, Australia
Registered: 2011-05-01
Posts: 34

Re: Fix for yaourt

thanks, works smile

Offline

#3 2012-02-19 10:21:51

PhotonX
Member
From: Munich
Registered: 2008-08-10
Posts: 605

Re: Fix for yaourt

Same here, thanks!


Desktop: http://www.sysprofile.de/id15562, Arch Linux    |    Notebook: Thinkpad L13 Yoga Gen2, Manjaro

The very worst thing you can do with free software is to download it, see that it doesn't work for some reason, leave it, and tell your friends that it doesn't work.  -  Tuomas Lukka

Offline

#4 2012-02-19 10:26:00

croma25td
Member
From: Italy
Registered: 2012-01-23
Posts: 4
Website

Re: Fix for yaourt

Thanks smile

Offline

#5 2012-02-19 10:45:37

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Fix for yaourt

Submit a patch to the yaourt devs.

Offline

#6 2012-02-19 10:46:43

snoopcatt
Member
From: Russia
Registered: 2012-02-19
Posts: 8

Re: Fix for yaourt

It's not a yaourt issue, it's AUR site issue smile

Offline

#7 2012-02-19 10:47:12

Axon
Member
From: Saint Petersburg
Registered: 2012-02-19
Posts: 22

Re: Fix for yaourt

Great, thank you. I'm curious how soon this will be fixed...

Offline

#8 2012-02-19 10:52:51

ethail
Member
From: Spain
Registered: 2011-02-10
Posts: 225

Re: Fix for yaourt

snoopcatt wrote:

It's not a yaourt issue, it's AUR site issue smile

It's a yaourt issue because of the way yaourt access to the AUR. Other AUR helpers work, so why would it be an AUR issue if others work?


My GitHub Page

Best Testing Repo Warning: [testing] means it can eat you hamster, catch fire and you should keep it away from children. And I'm serious here, it's not an April 1st joke.

Offline

#9 2012-02-19 10:55:43

snoopcatt
Member
From: Russia
Registered: 2012-02-19
Posts: 8

Re: Fix for yaourt

Seems that the url redirects for AUR packages were removed sometime in the last day or so, which seems to be breaking both pacman packer and yaourt.

For example, packer will try to resolve

https://aur.archlinux.org/packages/andr … ols.tar.gz

which previously redirected to

https://aur.archlinux.org/packages/an/a … ols.tar.gz

but does not anymore.

In addition, my way to fix this issue is very dirty smile

Last edited by snoopcatt (2012-02-19 10:56:52)

Offline

#10 2012-02-19 11:11:27

algorythm
Member
From: /usr/share/zoneinfo/Europe/FIN
Registered: 2009-07-17
Posts: 181

Re: Fix for yaourt

So why not just change the "local pkgurl" to include the "an"?:

local pkgurl="$AURURL/packages/an/$pkg/$pkg.tar.gz"


“Talent you can bloom. Instinct you can polish.”  — Haikyuu!! (adapted)
“If everybody thought alike, no one would be thinking very much.”  — Walter Lippmann (adapted)
“The important thing is to be able, at any moment, to sacrifice what we are for what we could become.”  — Charles Dubois

Offline

#11 2012-02-19 11:14:47

snoopcatt
Member
From: Russia
Registered: 2012-02-19
Posts: 8

Re: Fix for yaourt

because "an" is prefix for some package.
For "virtualbox_bit" local pkgurl is "$AURURL/packages/vi/$pkg/$pkg.tar.gz" smile

Offline

#12 2012-02-19 11:21:07

algorythm
Member
From: /usr/share/zoneinfo/Europe/FIN
Registered: 2009-07-17
Posts: 181

Re: Fix for yaourt

Oh right. That's stupid of me.


“Talent you can bloom. Instinct you can polish.”  — Haikyuu!! (adapted)
“If everybody thought alike, no one would be thinking very much.”  — Walter Lippmann (adapted)
“The important thing is to be able, at any moment, to sacrifice what we are for what we could become.”  — Charles Dubois

Offline

#13 2012-02-19 11:54:52

retsam
Member
Registered: 2011-05-03
Posts: 9

Re: Fix for yaourt

Why don't just change the code in way of making a new variable which holds first two charters.

example of code (packer fix, works for me)

one line 282

 short1=${1:0:2}

  # Prepare the installation directory
  # If there is an old directory and aurversion is not newer, use old directory
  if . "$dir/$1/PKGBUILD" &>/dev/null && ! aurversionisnewer "$1" "$pkgver-$pkgrel"; then
    cd "$dir/$1"
  else
    [[ -d $dir ]] && rm -rf $dir
    mkdir -p "$dir"
    cd "$dir"
    curl -Lfs "$PKGURL/$short1/$1/$1.tar.gz" > "$1.tar.gz"
    tar xf "$1.tar.gz"
    cd "$1"

and

on line 583

shortp=${package:0:2}

  for package in "${pkglist[@]}"; do
    curl -Lfs "$PKGURL/$shortp/$package/$package.tar.gz" > "$package.tar.gz"
    tar xf "$package.tar.gz" 
  done
fi

Last edited by retsam (2012-02-19 11:55:46)

Offline

#14 2012-02-19 11:55:11

jjacky
Member
Registered: 2011-11-09
Posts: 347
Website

Re: Fix for yaourt

a little simpler version (w/out echo/grep) might be:

local pkgurl="$AURURL/packages/${pkg:0:2}/$pkg/$pkg.tar.gz"

Offline

#15 2012-02-19 12:17:32

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Fix for yaourt

The old url style works again, so no ned for this fix anymore (see bug report).

Offline

#16 2012-02-19 14:48:32

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Fix for yaourt

snoopcatt wrote:

It's not a yaourt issue, it's AUR site issue smile

The redirects were a courtesy. package-query and packer really need to be updated to use the URLPath from the JSON-RPC reply and not just assume where packages are.

Offline

#17 2012-02-19 16:58:20

chimeracoder
Member
From: New York
Registered: 2010-10-24
Posts: 73

Re: Fix for yaourt

For the record packer, is fixed.

Before I mark this thread as solved, is there any plan to restore the compact urls, or is everyone expected to use the full urls from now on?

Offline

#18 2012-02-21 12:51:59

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: Fix for yaourt

Looks like package-query will be fixed with the next release as well.

http://bugs.archlinux.fr/task/268

Offline

#19 2014-05-15 12:59:47

mcpalls
Member
From: Roma - Italy
Registered: 2012-02-22
Posts: 23

Re: Fix for yaourt

hi at all, i have this problem
for example:
yaourt -S xampp

==> Download PKGBUILD xampp from AUR...
==> ERROR: xampp not found in AUR.
with  yajl-2.1.0-1  package-query-1.2-2  yaourt-1.3-1

i have try the solution from this post but don't work
i  installed package-query-git and your dependences but don't work:
yajl-2.1.0-1  package-query-git-1.2.6.g333d94a-1  yaourt-git-1.3.36.g64dac00-1

can i do?
tnk

edit:

with sudo yaourt -S xampp  i solved the problem, but why?
with yaourt i never used sudo because at the end is required pwd

Last edited by mcpalls (2014-05-15 13:44:01)

Offline

#20 2014-05-15 13:45:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,092

Re: Fix for yaourt

First thing to do is stop necrobumping.

https://wiki.archlinux.org/index.php/Fo … Bumping.22

Offline

#21 2014-05-15 14:50:02

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,209

Re: Fix for yaourt

mcpalls,
As Scimmia point out by linking to our policy, this thread is a bit old.  Much has changed in two years.
I am going to go ahead and close this thread.  I have not looked myself, but use the Bugs link on this site and check to see if anyone has made any suggestions there.
If you still have problems, go ahead and start a new thread that you will own smile   If you feel this thread is still applicable, go ahead and link back to this thread from your new thread.

Thanks.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB