You are not logged in.

#1 2006-04-22 19:13:12

soloport
Member
Registered: 2005-03-01
Posts: 442

script to checkout a single arch package

Here are a couple of scripts that will help check out a single package.  You need to know where the path is in the repository (e.g. arch/build/kernels/kernel26), but that's it.

The 'cvsanon' script is useful to anonymously log into to other CVS repositories, so I keept it separate (and it requires 'expect').

cat > /usr/bin/cvsanon EOF
#!/usr/bin/expect -d -f
spawn cvs login
expect "Logging in to "
sleep 1
send "anonymousn"
expect {
    Overwrite {
        sleep 1
        send "yn"
        expect eof
    }
    eof {}
}
EOF
chmod 755 /usr/bin/cvsanon

(Convert first 'EOF' to '<<EOF' -- as phpBB gets knocked around by it within code blocks.  Very strange...)

cat > /usr/bin/cvsco EOF
#!/bin/bash
if [ $# -lt 1 ]; then
    echo "Check out a single Arch Linux package from CVS."
    echo "Usage: $0 <package>"
    echo "    If <package> is 'arch/build/kernels/kernel26'"
    echo "    $0 will check out into './kernel26'"
    exit 1
fi

if [ ! -x /usr/bin/cvs ]; then
    pacman -S --noconfirm cvs
fi
CVS=/usr/bin/cvs
if [ -x /usr/bin/cvsanon ]; then
    if [ ! -x /usr/bin/expect ]; then
        pacman -S --noconfirm expect
    fi
fi
CVSANON=/usr/bin/cvsanon
EXPECT=/usr/bin/expect
TOUCH=/bin/touch

# find 'kernel26' in 'arch/build/kernels/kernel26'
PKG=$1
declare -a ARY
declare -i NUM
ARY=( `echo $1 | sed 's/// /g'` )
NUM=${#ARY[*]}-1
DIR=${ARY[$NUM]}

$TOUCH ~/.cvspass

export CVSROOT=:pserver:anonymous@cvs.archlinux.org:/home/cvs-arch

if [ -x /usr/bin/cvsanon ]; then
    $EXPECT $CVSANON
else
    echo "Enter: anonymous"
    $CVS login
fi

$CVS -z3 co -d $DIR $PKG

$CVS logout # (optional)
EOF
chmod 755 /usr/bin/cvsco

Enjoy  big_smile

Offline

#2 2006-04-22 19:50:52

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: script to checkout a single arch package

nice soloport smile I can move this to user-contribuitons if you like.

Offline

#3 2006-04-22 20:55:30

soloport
Member
Registered: 2005-03-01
Posts: 442

Re: script to checkout a single arch package

Penguin wrote:

nice soloport smile I can move this to user-contribuitons if you like.

Please do.  Thanks.

Offline

#4 2006-04-22 21:04:24

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: script to checkout a single arch package

done. Feel free to edit the title to your likings.

Offline

Board footer

Powered by FluxBB