public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: intel-sdp.eclass - support for absolute location of rpms
@ 2013-07-22 12:04 justin
  0 siblings, 0 replies; only message in thread
From: justin @ 2013-07-22 12:04 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 3961 bytes --]

Hi,

this patch adds proper support for rpm location outside the main directory.

The old API only allowed defining the rpm basic name, which gets
combined with the possible subdirs containing rpms.

The new API only allows a single main directory where it expects rpms
in. If there are rpms outside this dir, you need to give the full path.

Thanks for comments,
Justin


--- /local/home/justin/tree/eclass/intel-sdp.eclass	2013-07-19
16:00:50.000000000 +0200
+++ intel-sdp.eclass	2013-07-22 14:02:16.686582103 +0200
@@ -65,11 +65,10 @@
 # Possibility to skip the mandatory check for licenses. Only set this
if there
 # is really no fix.

-# @ECLASS-VARIABLE: INTEL_RPMS_DIRS
+# @ECLASS-VARIABLE: INTEL_RPMS_DIR
 # @DESCRIPTION:
-# List of subdirectories in the main archive which contains the
-# rpms to extract.
-: ${INTEL_RPMS_DIRS:=rpm}
+# Main subdirectory which contains the rpms to extract.
+: ${INTEL_RPMS_DIR:=rpm}

 # @ECLASS-VARIABLE: INTEL_X86
 # @DESCRIPTION:
@@ -84,6 +83,11 @@
 # Functional name of rpm without any version/arch tag
 #
 # e.g. compilerprof
+#
+# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
+# specify the full path
+#
+# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli

 # @ECLASS-VARIABLE: INTEL_DAT_RPMS
 # @DEFAULT_UNSET
@@ -92,6 +96,11 @@
 # without any version tag
 #
 # e.g. openmp
+#
+# if the rpm is located in a directory different to INTEL_RPMS_DIR you can
+# specify the full path
+#
+# e.g. CLI_install/rpm/intel-vtune-amplifier-xe-cli-common

 # @ECLASS-VARIABLE: INTEL_SDP_DB
 # @DESCRIPTION:
@@ -328,14 +337,23 @@
 			INTEL_ARCH="intel64 ia32"
 		fi
 	fi
-	INTEL_RPMS=""
+	INTEL_RPMS=()
+	INTEL_RPMS_FULL=()
 	for p in ${INTEL_BIN_RPMS}; do
-		for a in ${arch}; do
-			INTEL_RPMS+="
intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm"
-		done
+		if [ ${p} == $(basename ${p}) ]; then
+			for a in ${arch}; do
+				INTEL_RPMS+=(
intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm
)
+			done
+		else
+			INTEL_RPMS_FULL+=(
${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.${a}.rpm )
+		fi
 	done
 	for p in ${INTEL_DAT_RPMS}; do
-		INTEL_RPMS+="
intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm"
+		if [ ${p} == $(basename ${p}) ]; then
+			INTEL_RPMS+=(
intel-${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm
)
+		else
+			INTEL_RPMS_FULL+=(
${p}-${_INTEL_PV4}-${_INTEL_PV1}.${_INTEL_PV2}-${_INTEL_PV3}.noarch.rpm )
+		fi
 	done

 	case "${EAPI:-0}" in
@@ -347,23 +365,31 @@
 # @DESCRIPTION:
 # Unpacking necessary rpms from tarball, extract them and rearrange the
output.
 intel-sdp_src_unpack() {
-	local l r subdir rb t list=()
+	local l r subdir rb t list=() debug_list

 	for t in ${A}; do
-		for r in ${INTEL_RPMS}; do
-			for subdir in ${INTEL_RPMS_DIRS}; do
-				rpmdir=${t%%.*}/${subdir}
-				debug-print "Adding to decompression list: ${rpmdir}/${r}"
-				list+=( ${rpmdir}/${r})
-			done
+		for r in ${INTEL_RPMS[@]}; do
+			rpmdir=${t%%.*}/${INTEL_RPMS_DIR}
+			list+=( ${rpmdir}/${r} )
+		done
+
+		for r in ${INTEL_RPMS_FULL[@]}; do
+			list+=( ${t%%.*}/${r} )
 		done
-		tar xvf "${DISTDIR}"/${t} ${list[@]} &> "${T}"/rpm-extraction.log || die
+
+		debug_list="$(IFS=$'\n'; echo ${list[@]} )"
+
+		debug-print "Adding to decompression list:"
+		debug-print ${debug_list}
+
+		tar xvf "${DISTDIR}"/${t} ${list[@]} &> "${T}"/rpm-extraction.log
+
 		for r in ${list[@]}; do
 			rb=$(basename ${r})
 			l=.${rb}_$(date +'%d%m%y_%H%M%S').log
 			einfo "Unpacking ${rb}"
 			rpm2tar -O ${r} | tar xvf - | sed -e \
-				"s:^\.:${EROOT#/}:g" > ${l} || die "unpacking ${r} failed"
+				"s:^\.:${EROOT#/}:g" > ${l}; assert "unpacking ${r} failed"
 			mv ${l} opt/intel/ || die "failed moving extract log file"
 		done
 	done



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-22 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-22 12:04 [gentoo-dev] RFC: intel-sdp.eclass - support for absolute location of rpms justin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox