Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107867 - app-backup/amanda is not binpkg safe
Summary: app-backup/amanda is not binpkg safe
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-02 04:12 UTC by Sven Wegener
Modified: 2005-12-11 18:56 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
copies ENVDFILE to /usr/share/amanada (amanda-2.4.5.patch,1.14 KB, patch)
2005-12-05 09:05 UTC, Rafael Ávila de Espíndola
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Wegener gentoo-dev 2005-10-02 04:12:11 UTC
Code like this, as seen in the amanda ebuilds, doesn't work for binpkgs.

MYTMPDIR="${WORKDIR}/tmp"
ENVDIR="/etc/env.d"
ENVDFILE="97amanda"
TMPENVFILE="${MYTMPDIR}/${ENVDFILE}"
[...]

src_unpack() {
        [...]
        # Now we store the settings we just created
        set | egrep "^AMANDA_" > "${TMPENVFILE}"
}

pkg_postinst() {
        [ ! -f "${TMPENVFILE}" ] && die "Variable setting file (${TMPENVFILE})
should exist!"
        source ${TMPENVFILE}
        [...]
}
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-11-30 17:22:02 UTC
come up with a solution that doesn't require putting the env capture in the
binpkg, and then we'll talk.
Comment 2 Sven Wegener gentoo-dev 2005-11-30 23:32:54 UTC
Allowing the user to change behaviour via environment variables is (currently)
bad. With new portage versions the environment will be re-used and you'll have
access to the stored environment without any special magic.

As a workaround you could dump the envfile to /usr/share/amanda instead of
WORKDIR, and source it from the merged package.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-12-01 00:11:25 UTC
Yes, with new portage versions it's less of a problem, but I've had the amanda
packages the way they are as I needed that functionality with old versions of
portage, and the only way around that would be to put a DEPEND on the portage
version just for the sake of the env vars.

It's significent functionality of Amanda that can only be controlled at build
time - AMANDA_PORTS* most importantly, to work with firewalls; AMANDA_DBMODE
secondly.

If I change TMPENVFILE to be in /usr/share/amanda for the pkg_postinst phase,
and copy it into ${D}/usr/share/amanda during src_install, I could then rm it at
the end of pkg_postinst. - Would this be an acceptable solution.
Comment 4 Rafael Ávila de Espíndola 2005-12-05 09:05:01 UTC
Created attachment 74103 [details, diff]
copies ENVDFILE to /usr/share/amanada

The patch implements the suggested fix: it copies 97amanda to /usr/share/amanda
during install and removes it in pkg_postinst.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-12-11 18:56:17 UTC
applied for 2.4.5_p1.
Not applying to older versions, I intend to remove them soon.