You are not logged in.

#1 2009-02-13 07:36:26

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

pbget: ABS and AUR PKGBUILD etc retriever

Info page: http://xyne.archlinux.ca/projects/pbget

edit: updated post with current information

pbget is a command-line tool for downloading PKGBUILDs and local source files from the Arch Linux Git interface, the AUR, and the ABS tree

Last edited by Xyne (2012-03-08 23:25:21)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#2 2009-03-22 11:16:23

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

*bump*
Added the "--upgradable" option which will retrieve taurballs for all upgradable core/extra/community/testing/aur pkgs.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2009-03-22 11:27:34

bluewind
Administrator
From: Austria
Registered: 2008-07-13
Posts: 172
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

If you have ShowSize enabled in pacman.conf pbget --upgradable tries to download the size of the packages.

--> including upgradable packages
-->   ntp
-->   [0.55
-->   MB]
--> searching for ntp in core/extra

pacman -Qu

Targets (1): ntp-4.2.4p6-2 [0.55 MB]

Offline

#4 2009-03-22 12:11:19

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

*bangs head on desk*
I really wish I could just
a) use alpm directly
b) find some magical pacman option to spit out what I want
Until I learn how, I'm stuck hacking through pacman output.

Thanks for letting me know, bluewind. I'll see what I can do.

*edit*
It should be fixed now. Please update pbget and let me know if it works.

Last edited by Xyne (2009-03-22 13:01:49)


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2009-03-22 15:33:45

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: pbget: ABS and AUR PKGBUILD etc retriever

I just tested 'pbget --upgradable --aur' and it works great. It may be helpful to have a "check only" option just to take a quick glance at what's out of date also.

Great work Xyne.

Offline

#6 2009-03-30 19:57:34

Mo
Member
Registered: 2007-01-18
Posts: 92

Re: pbget: ABS and AUR PKGBUILD etc retriever

skottish wrote:

I just tested 'pbget --upgradable --aur' and it works great. It may be helpful to have a "check only" option just to take a quick glance at what's out of date also.

Great work Xyne.

dto.

Anyway: very very nice smile. Was looking for this for months...

Offline

#7 2009-08-22 05:37:27

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: pbget: ABS and AUR PKGBUILD etc retriever

Hey Xyne,

Could you please look into the bug mentioned on the AUR page for your package? http://aur.archlinux.org/packages.php?ID=23848 (not downloading *.sh files)

I experience it when grabbing Eclipse. Thanks smile

Offline

#8 2009-08-22 08:16:47

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

@Ranguvar
It should work now. I have no idea why I haven't been receiving comment notifications for pbget. Hopefully "UnNotify" -> "Notify" will fix that.

Just for reference, until the SVN web interface is extended to community packages, you need to use "--abs" for them.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#9 2009-09-13 01:31:58

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: pbget: ABS and AUR PKGBUILD etc retriever

Thanks for that.

And since the SVN interface now exists for [community], can you modify pbget to work with that (without ABS)?
`pbget ncmpcpp` fails, even though the SVN ViewVC for that package can be found here: http://repos.archlinux.org/viewvc.cgi/n … =community

Offline

#10 2009-09-13 02:54:12

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

done, thanks


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#11 2009-09-13 02:58:59

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: pbget: ABS and AUR PKGBUILD etc retriever

awesome

aurget pbget
rm -f ~/bin/aurget

edit: crap, it needs bash-xyne-common_functions and I just deleted my aurget tongue

Last edited by iphitus (2009-09-13 02:59:36)

Offline

#12 2009-09-13 03:24:40

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: pbget: ABS and AUR PKGBUILD etc retriever

Wow, that was fast. Thanks!

Offline

#13 2009-09-13 03:40:15

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

I only had to tweak the code for core/extra to get community working (not sure why they didn't make the interface options identical). smile

I've also made bash-xyne-common_functions an optdepend.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#14 2009-09-13 03:55:12

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: pbget: ABS and AUR PKGBUILD etc retriever

Works well, I badly needed something to replace my little script. Nice to have a uniform interface for both aur/repos.

though...

iphitus(~/src)$ pbget --aur chromium-snapshot
--> searching for chromium-snapshot in core/extra
--> searching for chromium-snapshot in community

Should that be trying to get chromium snapshot off AUR? The --aur-only option works as expected.

Offline

#15 2009-09-13 04:15:52

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

I removed that code by mistake when ripping out the old [community] code. It should work as expected again.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#16 2009-09-13 19:35:18

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: pbget: ABS and AUR PKGBUILD etc retriever

Xyne wrote:

I've also made bash-xyne-common_functions an optdepend.

Actually, you made it an optdepend in addition to a depend. You might want to fix that tongue

Offline

#17 2009-09-13 19:49:57

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: pbget: ABS and AUR PKGBUILD etc retriever

ataraxia wrote:
Xyne wrote:

I've also made bash-xyne-common_functions an optdepend.

Actually, you made it an optdepend in addition to a depend. You might want to fix that tongue

Xyne, you will be docked 10% of your Arch T.U. pay over this effective immediately.

Offline

#18 2009-09-13 20:45:40

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

skottish wrote:
ataraxia wrote:
Xyne wrote:

I've also made bash-xyne-common_functions an optdepend.

Actually, you made it an optdepend in addition to a depend. You might want to fix that tongue

Xyne, you will be docked 10% of your Arch T.U. pay over this effective immediately.

al·so
  adv.
    1. In addition; besides.
    2. Likewise; too: If you will stay, I will also.
  conj.
    And in addition: It's a pretty cat, also friendly.

tongue

Oh look, a tree!
*removes the dependency and begins to whistle casually, hoping he won't lose 10% of his monthly taco ration*


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#19 2009-10-19 22:06:55

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,544

Re: pbget: ABS and AUR PKGBUILD etc retriever

With the recent changes to the SVN interface, it appears that all repos have broken (AUR still works fine), if you have time to fix it smile
It now lets you download a .tar.gz of all files, that'd probably be the way to go..?

Offline

#20 2009-10-20 00:06:09

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

Re: pbget: ABS and AUR PKGBUILD etc retriever

I now use a bash function as replacement for pbget. Probably, you are intereseted...

pbget() {
    local extract

    [[ "$1" = "-x" ]] && extract=1 && shift

    local pkgname="${1##*/}"

    if [[ "$pkgname" = "$1" ]]; then
        local repos=(testing core extra community-testing community aur)
    else
        local repos=(${1%%/*})
    fi

    for repo in ${repos[@]}; do
        local url
        case "$repo" in
            aur)
                url="http://aur.archlinux.org/packages/$pkgname/$pkgname.tar.gz"
                ;;
            community-testing|community)
                url="http://repos.archlinux.org/wsvn/community/$pkgname/repos/$repo-$(uname -m)/?op=dl&rev=0&isdir=1"
                ;;
            testing|core|extra)
                url="http://repos.archlinux.org/wsvn/packages/$pkgname/repos/$repo-$(uname -m)/?op=dl&rev=0&isdir=1"
                ;;
            *)
                echo "Unknown repository. Exiting..."
                return 1
                ;;
                
        esac
        
        wget -O "$pkgname.tar.gz" "$url"
        
        if [[ ! -s "$pkgname.tar.gz" || "$(file -bp --mime-type "$pkgname.tar.gz")" = "text/plain" ]]; then
            rm -f -- "$pkgname.tar.gz"
        else
            break
        fi
    done

    if [[ ! -f "$pkgname.tar.gz" ]]; then
        echo "Package \`$pkgname' does not exist in the repositories. Exiting..."
        return 1
    fi

    # extract downloaded file
    if [[ -n "$extract" ]]; then
        mkdir "$pkgname"
        bsdtar xkf "$pkgname.tar.gz" --strip-components 1 -C "$pkgname"
        rm -f -- "$pkgname.tar.gz"
        cd "$pkgname"
    fi
}

edit: I should probably give some examples how to use it:

$ pbget pacman

Will search for pacman in the following repos (testing core extra community-testing community aur) and takes the first pacman it finds. So, if there is a pacman package in testing, it would use this one.

$ pbget core/pacman

Get the PKGBUILD of the pacman package in core.

$ pbget -x core/pacman

Get the PKGBUILD of the pacman package in core, extract the tarball (and delete it) and change into the directory which contains the extracted PKGBUILD.

Last edited by xduugu (2009-10-20 00:17:24)

Offline

#21 2010-05-15 00:51:53

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

Re: pbget: ABS and AUR PKGBUILD etc retriever

I assume the functionality of pbget is just broken currently? About the only thing it does properly for me is pbget --aur-only


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

#22 2010-05-15 02:40:35

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

[core] and [extra] still worked. Everything else was falsely detected in one of those without the "--aur-only" option.

It should be fixed now.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#23 2010-05-15 04:52:42

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

Re: pbget: ABS and AUR PKGBUILD etc retriever

Thanks, it works now with community/AUR packages.


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

#24 2010-12-16 15:56:50

TryA
Member
Registered: 2010-01-01
Posts: 23

Re: pbget: ABS and AUR PKGBUILD etc retriever

pbget can no longer retrieve PKGBUILDs from SVN. I think it's related to this.

Offline

#25 2010-12-16 18:25:04

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: pbget: ABS and AUR PKGBUILD etc retriever

TryA wrote:

pbget can no longer retrieve PKGBUILDs from SVN. I think it's related to this.

I'm not sure. The website links haven't changed. It seems to be a server problem. Go to a package page and click on the download link, e.g.:
pacman -> download
All it displays is "Unable to create a temporary directory.".


I have filed a bug report. Once I know more I will update pbget if necessary.


In the meantime, use the "--abs" option to retrieve files via rsync.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB