* [gentoo-dev] Modular texlive eclasses up for review
@ 2007-10-08 21:47 Alexis Ballier
2007-10-08 23:03 ` Alexis Ballier
0 siblings, 1 reply; 8+ messages in thread
From: Alexis Ballier @ 2007-10-08 21:47 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 966 bytes --]
Hi list,
attached are two new eclasses I'm planning to commit soon.
I'm sending 'em as some reviewing never hurts, but I hope they're
perfectly fine ;)
texlive-common.eclass : helper eclass for handling the texmf
tree; it contains variable definitions used by texlive ebuilds and
two functions :
- one to move config files that might be modified by the
user to /etc and symlink them from the original location to not break
texmf stucture;
- the second function search for a file in the texmf tree in the
current directory (the usual tex distribution's way is to have ls-R
files and use kpsewhich but we must not assume the presence of such
programs/files as we'll be using it for installing texlive...)
texlive-module.eclass : generic installation eclass for all the
different parts of texlive's texmf tree, this is to avoid code
duplication in 80+ ebuilds.
If no objection, I'll commit them in a few days.
Regards,
Alexis.
[-- Attachment #1.2: texlive-module.eclass --]
[-- Type: application/octet-stream, Size: 2437 bytes --]
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will
# only have to inherit this eclass.
# Ebuilds have to provide TEXLIVE_MODULE_CONTENTS variable that contains the list
# of packages that it will install.
#
inherit texlive-common
HOMEPAGE="http://www.tug.org/texlive/"
for i in ${TEXLIVE_MODULE_CONTENTS}; do
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip"
done
COMMON_DEPEND=">=app-text/texlive-core-${PV}
${TEXLIVE_MODULES_DEPS}"
DEPEND="${COMMON_DEPEND}
app-arch/unzip"
RDEPEND="${COMMON_DEPEND}"
IUSE="doc"
S="${WORKDIR}"
texlive-module_src_compile() {
# Build format files
for i in texmf/fmtutil/format*.cnf; do
if test -f "${i}"; then
einfo "Building format ${i}"
TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
|| die "failed to build format ${i}"
fi
done
# Generate config files
for i in "${S}"/texmf/lists/*;
do
grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
done
for j in $(cat "${T}/jobs");
do
command=$(echo ${j} | sed 's/.\(.*\)=.*/\1/')
parameter=$(echo ${j} | sed 's/.*=\(.*\)/\1/')
case ${command} in
addMap)
echo "Map ${parameter}" >> "${S}/${PN}.cfg";;
addMixedMap)
echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";;
addDvipsMap)
echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
addDvipdfmMap)
echo "f ${parameter}" >> "${S}/${PN}-config";;
esac
done
}
texlive-module_src_install() {
insinto /usr/share
test -d texmf && doins -r texmf
test -d texmf-dist && doins -r texmf-dist
test -d texmf-var && doins -r texmf-var
use doc && test -d texmf-doc && doins -r texmf-doc
insinto /etc/texmf/updmap.d
test -f "${S}/${PN}.cfg" && doins "${S}/${PN}.cfg"
insinto /etc/texmf/dvips/config
test -f "${S}/${PN}-config.ps" && doins "${S}/${PN}-config.ps"
insinto /etc/texmf/dvipdfm/config
test -f "${S}/${PN}-config" && doins "${S}/${PN}-config"
texlive-common_handle_config_files
}
texlive-module_pkg_postinst() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
texlive-module_pkg_postrm() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
[-- Attachment #1.3: texlive-common.eclass --]
[-- Type: application/octet-stream, Size: 1452 bytes --]
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide various functions used by both texlive-core and texlive
# modules.
# Note that this eclass *must* not assume the presence of any standard tex tool
#
TEXMF_PATH=/usr/share/texmf
TEXMF_DIST_PATH=/usr/share/texmf-dist
TEXMF_VAR_PATH=/usr/share/texmf-var
# Has to be called in src_install after having installed the files in ${D}
# This function will move the relevant files to /etc/texmf and symling them
# from their original location. This is to allow easy update of texlive's
# configuration
texlive-common_handle_config_files() {
# Handle config files properly
cd "${D}${TEXMF_PATH}"
for f in $(find . -name '*.cnf' -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do
if [ "${f/config/}" != "${f}" ] ; then
continue
fi
dodir /etc/texmf/$(dirname ${f}).d
mv "${D}/${TEXMF_PATH}/${f}" "${D}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed."
dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f}
done
}
# Return if a file is present in the texmf tree
# Call it from the directory containing texmf and texmf-dist
texlive-common_is_file_present_in_texmf() {
local mark="${T}/$1.found"
find texmf -name $1 -exec touch "${mark}" \;
find texmf-dist -name $1 -exec touch "${mark}" \;
return $(test -f "${mark}")
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] Modular texlive eclasses up for review
2007-10-08 21:47 [gentoo-dev] Modular texlive eclasses up for review Alexis Ballier
@ 2007-10-08 23:03 ` Alexis Ballier
2007-10-09 0:08 ` Jeroen Roovers
2007-10-09 7:13 ` Roy Marples
0 siblings, 2 replies; 8+ messages in thread
From: Alexis Ballier @ 2007-10-08 23:03 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 207 bytes --]
On Mon, 8 Oct 2007 23:47:31 +0200
Alexis Ballier <aballier@gentoo.org> wrote:
> Hi list,
Try 2, after dberkholz comments on irc:
- replaced test by []
- removed useless use of cat
Alexis.
[-- Attachment #1.2: texlive-common.eclass --]
[-- Type: application/octet-stream, Size: 1451 bytes --]
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide various functions used by both texlive-core and texlive
# modules.
# Note that this eclass *must* not assume the presence of any standard tex tool
#
TEXMF_PATH=/usr/share/texmf
TEXMF_DIST_PATH=/usr/share/texmf-dist
TEXMF_VAR_PATH=/usr/share/texmf-var
# Has to be called in src_install after having installed the files in ${D}
# This function will move the relevant files to /etc/texmf and symling them
# from their original location. This is to allow easy update of texlive's
# configuration
texlive-common_handle_config_files() {
# Handle config files properly
cd "${D}${TEXMF_PATH}"
for f in $(find . -name '*.cnf' -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do
if [ "${f/config/}" != "${f}" ] ; then
continue
fi
dodir /etc/texmf/$(dirname ${f}).d
mv "${D}/${TEXMF_PATH}/${f}" "${D}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed."
dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f}
done
}
# Return if a file is present in the texmf tree
# Call it from the directory containing texmf and texmf-dist
texlive-common_is_file_present_in_texmf() {
local mark="${T}/$1.found"
find texmf -name $1 -exec touch "${mark}" \;
find texmf-dist -name $1 -exec touch "${mark}" \;
return $([ -f "${mark}" ])
}
[-- Attachment #1.3: texlive-module.eclass --]
[-- Type: application/octet-stream, Size: 2426 bytes --]
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will
# only have to inherit this eclass.
# Ebuilds have to provide TEXLIVE_MODULE_CONTENTS variable that contains the list
# of packages that it will install.
#
inherit texlive-common
HOMEPAGE="http://www.tug.org/texlive/"
for i in ${TEXLIVE_MODULE_CONTENTS}; do
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip"
done
COMMON_DEPEND=">=app-text/texlive-core-${PV}
${TEXLIVE_MODULES_DEPS}"
DEPEND="${COMMON_DEPEND}
app-arch/unzip"
RDEPEND="${COMMON_DEPEND}"
IUSE="doc"
S="${WORKDIR}"
texlive-module_src_compile() {
# Build format files
for i in texmf/fmtutil/format*.cnf; do
if [ -f "${i}" ]; then
einfo "Building format ${i}"
TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
|| die "failed to build format ${i}"
fi
done
# Generate config files
for i in "${S}"/texmf/lists/*;
do
grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
done
for j in $(<"${T}/jobs");
do
command=$(echo ${j} | sed 's/.\(.*\)=.*/\1/')
parameter=$(echo ${j} | sed 's/.*=\(.*\)/\1/')
case ${command} in
addMap)
echo "Map ${parameter}" >> "${S}/${PN}.cfg";;
addMixedMap)
echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";;
addDvipsMap)
echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
addDvipdfmMap)
echo "f ${parameter}" >> "${S}/${PN}-config";;
esac
done
}
texlive-module_src_install() {
insinto /usr/share
[ -d texmf ] && doins -r texmf
[ -d texmf-dist ] && doins -r texmf-dist
[ -d texmf-var ] && doins -r texmf-var
use doc && [ -d texmf-doc ] && doins -r texmf-doc
insinto /etc/texmf/updmap.d
[ -f "${S}/${PN}.cfg" ] && doins "${S}/${PN}.cfg"
insinto /etc/texmf/dvips/config
[ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps"
insinto /etc/texmf/dvipdfm/config
[ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config"
texlive-common_handle_config_files
}
texlive-module_pkg_postinst() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
texlive-module_pkg_postrm() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] Modular texlive eclasses up for review
2007-10-08 23:03 ` Alexis Ballier
@ 2007-10-09 0:08 ` Jeroen Roovers
2007-10-09 7:13 ` Roy Marples
1 sibling, 0 replies; 8+ messages in thread
From: Jeroen Roovers @ 2007-10-09 0:08 UTC (permalink / raw
To: gentoo-dev
On Tue, 9 Oct 2007 01:03:17 +0200
Alexis Ballier <aballier@gentoo.org> wrote:
> > Hi list,
A bit of documentation for the (exported) functions would be nice. And
maybe some "red tape" to show where the exported bits end/start. And
short bits of text explaining why some of the variables are needed and
what they do.
Kind regards,
JeR
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] Modular texlive eclasses up for review
2007-10-08 23:03 ` Alexis Ballier
2007-10-09 0:08 ` Jeroen Roovers
@ 2007-10-09 7:13 ` Roy Marples
2007-10-09 11:17 ` Alexis Ballier
1 sibling, 1 reply; 8+ messages in thread
From: Roy Marples @ 2007-10-09 7:13 UTC (permalink / raw
To: gentoo-dev
On Tue, 2007-10-09 at 01:03 +0200, Alexis Ballier wrote:
> On Mon, 8 Oct 2007 23:47:31 +0200
> Alexis Ballier <aballier@gentoo.org> wrote:
>
> > Hi list,
>
>
> Try 2, after dberkholz comments on irc:
> - replaced test by []
> - removed useless use of cat
>
>
> Alexis.
grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
Could be done with a 1 sed and 1 sort call, but whatever floats your
boat.
case ${command} in
Should quote command here
if [ "${f/config/}" != "${f}" ]
Should be
if [ "${f#*config*}" != "${f}" ]
return $([ -f "${mark}" ])
Could be written as
[ -f "${mark}" ]
Thanks
Roy
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] Modular texlive eclasses up for review
2007-10-09 7:13 ` Roy Marples
@ 2007-10-09 11:17 ` Alexis Ballier
2007-10-09 12:00 ` Roy Marples
0 siblings, 1 reply; 8+ messages in thread
From: Alexis Ballier @ 2007-10-09 11:17 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1.1: Type: text/plain, Size: 856 bytes --]
On Tue, 09 Oct 2007 08:13:31 +0100
Roy Marples <uberlord@gentoo.org> wrote:
> grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
> Could be done with a 1 sed and 1 sort call, but whatever floats your
> boat.
well as this is very inspired from texlive install-pkg.sh script, I'd
prefer not differing that much.
> if [ "${f/config/}" != "${f}" ]
> Should be
> if [ "${f#*config*}" != "${f}" ]
changed that one, the "semantics" looks better indeed; what is wanted
here is to exclude $f containing "config". Am I missing something when
I understand it as the exact same thing but more readable ?
> return $([ -f "${mark}" ])
> Could be written as
> [ -f "${mark}" ]
thanks, too much influence from other programming languages...
Attached try3, with some more comments on the functions of
texlive-module.eclass.
Alexis.
[-- Attachment #1.2: texlive-module.eclass --]
[-- Type: application/octet-stream, Size: 3346 bytes --]
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide generic install functions so that modular texlive's texmf ebuilds will
# only have to inherit this eclass.
# Ebuilds have to provide TEXLIVE_MODULE_CONTENTS variable that contains the list
# of packages that it will install.
# TEXLIVE_MODULE_CONTENTS will be expanded to SRC_URI :
# foo -> texlive-module-foo-${PV}.zip
# What is assumed is that it unpacks texmf and texmf-dist directories to
# ${WORKDIR}.
#
inherit texlive-common
HOMEPAGE="http://www.tug.org/texlive/"
for i in ${TEXLIVE_MODULE_CONTENTS}; do
SRC_URI="${SRC_URI} mirror://gentoo/texlive-module-${i}-${PV}.zip"
done
COMMON_DEPEND=">=app-text/texlive-core-${PV}
${TEXLIVE_MODULES_DEPS}"
DEPEND="${COMMON_DEPEND}
app-arch/unzip"
RDEPEND="${COMMON_DEPEND}"
IUSE="doc"
S="${WORKDIR}"
# src_compile, exported function:
# Will look for format.foo.cnf and build foo format files using fmtutil
# (provided by texlive-core). The compiled format files will be sent to
# texmf-var/web2c, like fmtutil defaults to but with some trick to stay in the
# sandbox
# The next step is to generate config files that are to be installed in
# /etc/texmf; texmf-update script will take care of merging the different config
# files for different packages in a single one used by the whole tex installation.
texlive-module_src_compile() {
# Build format files
for i in texmf/fmtutil/format*.cnf; do
if [ -f "${i}" ]; then
einfo "Building format ${i}"
TEXMFHOME="${S}/texmf:${S}/texmf-dist"\
fmtutil --cnffile "${i}" --fmtdir "${S}/texmf-var/web2c" --all\
|| die "failed to build format ${i}"
fi
done
# Generate config files
for i in "${S}"/texmf/lists/*;
do
grep '^!' "${i}" | tr ' ' '=' |sort|uniq >> "${T}/jobs"
done
for j in $(<"${T}/jobs");
do
command=$(echo ${j} | sed 's/.\(.*\)=.*/\1/')
parameter=$(echo ${j} | sed 's/.*=\(.*\)/\1/')
case "${command}" in
addMap)
echo "Map ${parameter}" >> "${S}/${PN}.cfg";;
addMixedMap)
echo "MixedMap ${parameter}" >> "${S}/${PN}.cfg";;
addDvipsMap)
echo "p +${parameter}" >> "${S}/${PN}-config.ps";;
addDvipdfmMap)
echo "f ${parameter}" >> "${S}/${PN}-config";;
esac
done
}
# src_install, exported function:
# Install texmf and config files to the system
texlive-module_src_install() {
insinto /usr/share
[ -d texmf ] && doins -r texmf
[ -d texmf-dist ] && doins -r texmf-dist
[ -d texmf-var ] && doins -r texmf-var
use doc && [ -d texmf-doc ] && doins -r texmf-doc
insinto /etc/texmf/updmap.d
[ -f "${S}/${PN}.cfg" ] && doins "${S}/${PN}.cfg"
insinto /etc/texmf/dvips/config
[ -f "${S}/${PN}-config.ps" ] && doins "${S}/${PN}-config.ps"
insinto /etc/texmf/dvipdfm/config
[ -f "${S}/${PN}-config" ] && doins "${S}/${PN}-config"
texlive-common_handle_config_files
}
# pkg_postinst and pkg_postrm, exported functions:
# run texmf-update to ensure the tex installation is consistent with the
# installed texmf trees.
texlive-module_pkg_postinst() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
texlive-module_pkg_postrm() {
if [ "$ROOT" = "/" ] ; then
/usr/sbin/texmf-update
fi
}
EXPORT_FUNCTIONS src_compile src_install pkg_postinst pkg_postrm
[-- Attachment #1.3: texlive-common.eclass --]
[-- Type: application/octet-stream, Size: 1442 bytes --]
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#
# Original Author: Alexis Ballier <aballier@gentoo.org>
# Purpose: Provide various functions used by both texlive-core and texlive
# modules.
# Note that this eclass *must* not assume the presence of any standard tex tool
#
TEXMF_PATH=/usr/share/texmf
TEXMF_DIST_PATH=/usr/share/texmf-dist
TEXMF_VAR_PATH=/usr/share/texmf-var
# Has to be called in src_install after having installed the files in ${D}
# This function will move the relevant files to /etc/texmf and symling them
# from their original location. This is to allow easy update of texlive's
# configuration
texlive-common_handle_config_files() {
# Handle config files properly
cd "${D}${TEXMF_PATH}"
for f in $(find . -name '*.cnf' -o -name '*.cfg' -type f | sed -e "s:\./::g") ; do
if [ "${f#*config*}" != "${f}" ] ; then
continue
fi
dodir /etc/texmf/$(dirname ${f}).d
mv "${D}/${TEXMF_PATH}/${f}" "${D}/etc/texmf/$(dirname ${f}).d" || die "mv ${f} failed."
dosym /etc/texmf/$(dirname ${f}).d/$(basename ${f}) ${TEXMF_PATH}/${f}
done
}
# Return if a file is present in the texmf tree
# Call it from the directory containing texmf and texmf-dist
texlive-common_is_file_present_in_texmf() {
local mark="${T}/$1.found"
find texmf -name $1 -exec touch "${mark}" \;
find texmf-dist -name $1 -exec touch "${mark}" \;
[ -f "${mark}" ]
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] Modular texlive eclasses up for review
2007-10-09 11:17 ` Alexis Ballier
@ 2007-10-09 12:00 ` Roy Marples
2007-10-09 12:49 ` Francesco Riosa
0 siblings, 1 reply; 8+ messages in thread
From: Roy Marples @ 2007-10-09 12:00 UTC (permalink / raw
To: gentoo-dev
On Tue, 2007-10-09 at 13:17 +0200, Alexis Ballier wrote:
> > if [ "${f/config/}" != "${f}" ]
> > Should be
> > if [ "${f#*config*}" != "${f}" ]
>
> changed that one, the "semantics" looks better indeed; what is wanted
> here is to exclude $f containing "config". Am I missing something when
> I understand it as the exact same thing but more readable ?
The former is bash specific, the later is POSIX. Both do different
things though.
Thanks
Roy
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] Modular texlive eclasses up for review
2007-10-09 12:00 ` Roy Marples
@ 2007-10-09 12:49 ` Francesco Riosa
2007-10-10 9:58 ` Alexis Ballier
0 siblings, 1 reply; 8+ messages in thread
From: Francesco Riosa @ 2007-10-09 12:49 UTC (permalink / raw
To: gentoo-dev
Roy Marples ha scritto:
> On Tue, 2007-10-09 at 13:17 +0200, Alexis Ballier wrote:
>
>>> if [ "${f/config/}" != "${f}" ]
>>> Should be
>>> if [ "${f#*config*}" != "${f}" ]
>>>
Should be
if [ "${f#*config}" != "${f}" ]
the 2nd asterisk is not needed, symmetry apart
>> changed that one, the "semantics" looks better indeed; what is wanted
>> here is to exclude $f containing "config". Am I missing something when
>> I understand it as the exact same thing but more readable ?
>>
>
> The former is bash specific, the later is POSIX. Both do different
> things though.
>
> Thanks
>
> Roy
>
>
--
gentoo-dev@gentoo.org mailing list
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-10-10 10:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-08 21:47 [gentoo-dev] Modular texlive eclasses up for review Alexis Ballier
2007-10-08 23:03 ` Alexis Ballier
2007-10-09 0:08 ` Jeroen Roovers
2007-10-09 7:13 ` Roy Marples
2007-10-09 11:17 ` Alexis Ballier
2007-10-09 12:00 ` Roy Marples
2007-10-09 12:49 ` Francesco Riosa
2007-10-10 9:58 ` Alexis Ballier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox