From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1G6Szl-0003Zq-Ke for garchives@archives.gentoo.org; Fri, 28 Jul 2006 14:07:18 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6SE6QiS026265; Fri, 28 Jul 2006 14:06:26 GMT Received: from slimak.dkm.cz (slimak.dkm.cz [62.24.64.34]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6SE6P39026665 for ; Fri, 28 Jul 2006 14:06:25 GMT Received: (qmail 36935 invoked by uid 0); 28 Jul 2006 14:06:24 -0000 Received: from r141.chello.upc.cz (HELO ?192.168.1.1?) (62.24.83.141) by slimak.dkm.cz with SMTP; 28 Jul 2006 14:06:24 -0000 Message-ID: <44CA19DF.708@seznam.cz> Date: Fri, 28 Jul 2006 16:06:23 +0200 From: Caster User-Agent: Thunderbird 1.5.0.4 (X11/20060605) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-java@gentoo.org MIME-Version: 1.0 To: gentoo-java@lists.gentoo.org Subject: Re: [gentoo-java] Falling to the lowest jdk available References: <44C9D438.80502@startnet.cz> <44C9D7BC.4020900@gentoo.org> <44C9E7F4.7080308@startnet.cz> <44C9EA3C.6060905@gentoo.org> <44C9EE76.9030101@seznam.cz> <44C9FC29.70606@seznam.cz> <44CA02A5.8050708@startnet.cz> In-Reply-To: <44CA02A5.8050708@startnet.cz> Content-Type: multipart/mixed; boundary="------------070406010209010005000003" X-Archives-Salt: c41ccbfe-8985-41d8-a5e7-a0711aaa683b X-Archives-Hash: d071b173a159ef5eb91baf55debc1f67 This is a multi-part message in MIME format. --------------070406010209010005000003 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by robin.gentoo.org id k6SE6Qis026265 Miroslav =C5=A0ulc wrote: > BTW, maybe a stupid question, but why the jaxme and aspectwerkz appeare= d > in the emerge command several times? Because the fixer is one dirty hack :D Well for some reason, sed -e 's/ /\n/' doesn't correctly replace all characters but only the first? Changed it to 'y/ /\n/' which seems to work better (I'm sure there's more elegant solution anyway). Attached patch that works as the previous one, and also changes the sed line. You need to revert my previous patch to apply this (or remerge java-config-wrapper before). Caster --------------070406010209010005000003 Content-Type: text/x-patch; name="java-1.5-fixer.patch" Content-Disposition: inline; filename="java-1.5-fixer.patch" Content-Transfer-Encoding: 7bit --- java-1.5-fixer 2006-07-18 12:43:03.000000000 +0200 +++ java-1.5-fixer 2006-07-28 15:52:22.000000000 +0200 @@ -60,29 +60,68 @@ fi } +# $1 - package.env file +# $2 - name of VAR=foo variable +get_value_from_package_env() { + # get the VAR line from package.env + local line="$(grep ${2} ${1})" + + # strip VAR= + local value="${line#${2}=}" + + # strip quotes + value="${value//\"/}" + + echo ${value} +} + get_jars_from_package_env() { local package_env=${1} # keep track of the original classpath local save_classpath=${CLASSPATH} - local classpath_line=$(grep CLASSPATH ${package_env}) - # strip CLASSPATH= - local package_classpath=${classpath_line#CLASSPATH=} - # strip quotes - package_classpath=${package_classpath//\"/} - #local package_classpath=$(source ${package_env} >/dev/null 2>&1; echo ${CLASSPATH}) + # get classpath from package.env + package_classpath=$(get_value_from_package_env ${package_env} CLASSPATH) echo ${package_classpath//:/ } } +check_package_env_valid_gen2_target_15() { + local generation=$(get_value_from_package_env ${1} GENERATION) + + debug_print "${1} generation: ${generation}" + + # packages with generation 1 or without generation won't have TARGET and shouldn't be 1.5 + if [[ "${generation}" != "2" ]]; then + return 1 + fi + + local target=$(get_value_from_package_env ${1} TARGET) + + debug_print "${1} target: $target" + + # packages with target 1.5 or 1.6 are valid to have 1.5+ bytecode, skip them + if [[ "${target}" = "1.5" || "${target}" = "1.6" ]]; then + return 0 + fi + + # bytecode should be under 1.5, check it + return 1 +} + get_jars() { local package_envs=$@ local package_env local all_jars # for each package.env file for package_env in ${package_envs}; do - if [[ -f ${package_env} ]]; then + if [[ -f ${package_env} ]]; then + #check if package is valid gen2 with 1.5+ target + if $(check_package_env_valid_gen2_target_15 ${package_env}); then + debug_print "skipping ${package_env}" + continue + fi debug_print "parsing ${package_env}" # figure out what jars are in it local jars=$(get_jars_from_package_env ${package_env}) @@ -116,7 +155,7 @@ fi done - sed -e 's/ /\n/' <<< ${broken_packages} | sort | uniq + sed -e 'y/ /\n/' <<< ${broken_packages} | sort | uniq } fix_packages() { --------------070406010209010005000003-- -- gentoo-java@gentoo.org mailing list