Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 302937 - filter-bash-environment.py is deficient, misses ``declare -r VARNAME''-style declarations
Summary: filter-bash-environment.py is deficient, misses ``declare -r VARNAME''-style ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 307597
  Show dependency tree
 
Reported: 2010-01-31 04:59 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2023-06-16 01:18 UTC (History)
1 user (show)

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


Attachments
handle declare -r without assignment (declare_readonly.patch,2.30 KB, patch)
2010-01-31 20:39 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-01-31 04:59:02 UTC
The bash environment filtering script is not catching all variables. It appears to miss the ones that have declare statements without a value. See below:

 $ echo declare -r PORTAGE_BINPKG_DIR="blah" | /usr/lib64/portage/bin/filter-bash-environment.py PORTAGE_BINPKG_DIR
 $ echo declare -r PORTAGE_BINPKG_DIR | /usr/lib64/portage/bin/filter-bash-environment.py PORTAGE_BINPKG_DIR
declare -r PORTAGE_BINPKG_DIR
 $ emerge --version 2>/dev/null
Portage 2.2_rc33-r4 (unavailable, gcc-4.3.2, glibc-2.9_p20081201-r2, 2.6.31-gentoo-r6athlon64x2_2009.05.31 x86_64)

I am using tommy's portage-multilib branch of portage (but filter-bash-environment.py seems to be faithful to mainline portage).

This bug causes the following error to be printed in my modification to portage-multilib. I had used filter_readonly_variables to try to avoid the following error/warning message:
``/var/tmp/portage/dev-lang/perl-5.10.1/temp/environment.amd64: line 117: declare: PORTAGE_BINPKG_FILE: readonly variable''
Comment 1 Zac Medico gentoo-dev 2010-01-31 20:39:34 UTC
Created attachment 218029 [details, diff]
handle declare -r without assignment
Comment 2 Zac Medico gentoo-dev 2010-09-22 04:33:19 UTC
(In reply to comment #1)
> Created an attachment (id=218029) [details]
> handle declare -r without assignment

Via gitweb:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3a4a9cad036abf3f011b223fd6fb2fdf9649e213

This should have been released between 2.1.8 and 2.1.8.3.