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 1G6R16-0007RG-Kg for garchives@archives.gentoo.org; Fri, 28 Jul 2006 12:00:33 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6SBxdPf018675; Fri, 28 Jul 2006 11:59:39 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 k6SBxc1c014514 for ; Fri, 28 Jul 2006 11:59:39 GMT Received: (qmail 25791 invoked by uid 0); 28 Jul 2006 11:59:38 -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 11:59:38 -0000 Message-ID: <44C9FC29.70606@seznam.cz> Date: Fri, 28 Jul 2006 13:59:37 +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> In-Reply-To: <44C9EE76.9030101@seznam.cz> Content-Type: multipart/mixed; boundary="------------050703060601060401090907" X-Archives-Salt: 5a26805b-af01-4768-8fb3-0ba6f931ebf7 X-Archives-Hash: 31dca5284c497bc983c2e295741047f6 This is a multi-part message in MIME format. --------------050703060601060401090907 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Caster wrote: > and for aspectwerkz, maybe the fixer script should check if the "broken" > jar belongs to package that actually is supposed to be (requires) 1.5... > Tried to alter the fixer script to do that, by checking the package.env for GENERATION="2" and TARGET="1.5" or "1.6" and skip such packages as they are valid to have 1.5+ bytecode. Patch attached. Caster --------------050703060601060401090907 Content-Type: text/x-patch; name="java-1.5-fixer.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="java-1.5-fixer.patch" --- java-1.5-fixer 2006-07-18 12:43:03.000000000 +0200 +++ java-1.5-fixer 2006-07-28 13:55:15.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}) --------------050703060601060401090907-- -- gentoo-java@gentoo.org mailing list