axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Active arch branches listed somewhere?


From: David MENTRE
Subject: Re: [Axiom-developer] Active arch branches listed somewhere?
Date: Sun, 07 Nov 2004 15:04:12 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hello,

"Bill Page" <address@hidden> writes:

> There seems to be a common misconception about how GNU arch
> "installs" on a server. In fact from the docs that I found
> one does not need to install the tla program on the server
> at all. Instead all that is needed is a way for the tla that
> is installed on your workstation to talk to the server via
> webdav or sftp etc.

Exactly. You do not need to install arch on server. You just need an
access to the public repository.

The turorial explains this quite well:
http://www.gnu.org/software/gnu-arch/tutorial/shared-and-public-archives.html#Shared_and_Public_Archives
See "Mirroring a Local Archive Remotely".

And it is overly simple with an ssh account, just use sftp URL.

For example, I have:

# My arch repository on my local disk:
address@hidden
    /home/david/{archives}/2004-code

# the copy of this repository on linux-france.org:
address@hidden
    sftp://linux-france.org/home/lf/dmentre/html/arch-ive

Each time you do a local commit, update your public mirror with "tla
archive-mirror".

I do this automatically, as well as sending an email on a list and
making available a tarball of the sources, for my own project with
following "~/.arch-params/hook" file:

#!/bin/sh

# Original script from: Sascha Silbe <address@hidden>

# ARCH_ARCHIVE: always
#   represents the archive on which the action is being performed
# 
# ARCH_LOCATION: make-archive
#   gives the location of the archive being prepared by tla
# 
# ARCH_REVISION: import, tag, commit
#   gives the exact revision being (import|tagg|commit)ed
# 
# ARCH_CATEGORY: make-category
#   gives the category being prepared (format: category)
# 
# ARCH_BRANCH: make-branch
#   gives the branch being prepared (format: category--branch)
# 
# ARCH_VERSION: make-version
#   gives the version being prepared (format: category--branch--version)
# 
# ARCH_TREE_ROOT: commit, import
#   gives the location of the working tree from which tla is performing
#   the action
# 
# ARCH_TAGGED_ARCHIVE: tag
#   gives the archive of the revision from which tla will create the tag
# 
# ARCH_TAGGED_REVISION
#   gives the revision from which tla will create the tagged version

ARCH_ACTION="$1"

doPrepLog() {
    tla cat-archive-log "${ARCH_ARCHIVE}/${ARCH_REVISION}"
}

doMirror() {
    echo "* update mirror"
    tla push-mirror "${ARCH_ARCHIVE}" "`tla parse-package-name 
--package-version $ARCH_REVISION`"
}

doSendMail() {
    local recipients="${1}"

    echo "* send email to ${recipients}"
    cat "${logfile}" | mailx -s "arch ${ARCH_ACTION}: ${ARCH_REVISION}" 
${recipients}
#  mutt -s "arch ${ARCH_ACTION}: ${ARCH_REVISION}" -i "${logfile}" -e 'unset 
signature' ${recipients}
}

doTagTarball() {
# works without being in the source tree
    local current_dir=`pwd`
    local targetdir="${1}"
    local tarball_name="`tla parse-package-name --package-version 
$ARCH_REVISION`"
    local temp_dir="`mktemp -d`"
    local tarball_dir=${temp_dir}/${tarball_name}

    echo "* updating tarball on ${targetdir}"
    echo "** making archive tree"
    cd ${temp_dir}
    tla get $ARCH_REVISION $tarball_name

    echo "** making ${tarball_name} tarball"
    cd ${temp_dir}
    tar --exclude '*{arch}*' --exclude '*.arch-ids*' -zcf 
${tarball_name}.tar.gz ${tarball_name}
    echo "** copying ${tarball_name} to ${targetdir}"
    scp ${temp_dir}/${tarball_name}.tar.gz ${targetdir}

    cd $current_dir
    rm -rf ${temp_dir}/
}

doUpdateTarball() {
# we need to be in the source tree for this function to work
    local current_dir=`pwd`
    local targetdir="${1}"
    local tarball_name="`tla parse-package-name --package-version 
$ARCH_REVISION`"
    local temp_dir="`mktemp -d`"
    local tarball_dir=${temp_dir}/${tarball_name}
    local files="`tla inventory -s`"

    echo "* updating tarball on ${targetdir}"
    echo "** making archive tree"
    mkdir ${tarball_dir}
    tar c ${files} | (cd ${tarball_dir}; tar xf -)
     
    echo "** making ${tarball_name} tarball"
    cd ${temp_dir}
    tar -zcf ${tarball_name}.tar.gz ${tarball_name}
    echo "** copying ${tarball_name} to ${targetdir}"
    scp ${temp_dir}/${tarball_name}.tar.gz ${targetdir}

    cd $current_dir
    rm -rf ${temp_dir}/
}

echo "* hook called for: ${ARCH_ACTION}"
# echo "ARCH_REVISION: ${ARCH_REVISION}"
# echo
# echo " pwd: `pwd`"

case "${ARCH_ACTION}" in
    tag)
        ARCH_CATEGORY="`tla parse-package-name --category $ARCH_REVISION`"
        ARCH_BRANCH="`tla parse-package-name --branch $ARCH_REVISION`"
        logfile="`tempfile`"
        doPrepLog > "${logfile}"
        case "${ARCH_REVISION}" in
            test--*)
                doSendMail david
                doTagTarball lfo:html/tmp/
                ;;
            demexp--*)
                doMirror
                doTagTarball lfo:html/demexp/latest-src/
                doSendMail address@hidden
                ;;                
        esac
        rm "${logfile}"
        ;;
    commit | import)
        ARCH_CATEGORY="`tla parse-package-name --category $ARCH_REVISION`"
        ARCH_BRANCH="`tla parse-package-name --branch $ARCH_REVISION`"
        logfile="`tempfile`"
        doPrepLog > "${logfile}"
        case "${ARCH_REVISION}" in
            test--*)
                doSendMail david
                doUpdateTarball lfo:html/tmp/
                ;;
            demexp--*)
                doMirror
                doUpdateTarball lfo:html/demexp/latest-src/
                doSendMail address@hidden
                ;;                
        esac
        rm "${logfile}"
        ;;
    *)
        ;;
esac
Yours,
d.
-- 
David MENTRE <address@hidden> -- http://www.nongnu.org/axiom/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]