summaryrefslogtreecommitdiffstats
path: root/gentoo/Documentation/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'gentoo/Documentation/scripts')
-rwxr-xr-xgentoo/Documentation/scripts/test_separate_compilation.sh85
-rwxr-xr-xgentoo/Documentation/scripts/update-keywords-lists32
-rw-r--r--gentoo/Documentation/scripts/usefull_commands15
-rwxr-xr-xgentoo/Documentation/scripts/write-ebuild.sh60
4 files changed, 192 insertions, 0 deletions
diff --git a/gentoo/Documentation/scripts/test_separate_compilation.sh b/gentoo/Documentation/scripts/test_separate_compilation.sh
new file mode 100755
index 000000000..75b980f18
--- /dev/null
+++ b/gentoo/Documentation/scripts/test_separate_compilation.sh
@@ -0,0 +1,85 @@
+#!/bin/bash
+# !!!WARNING!!! use with caution
+#
+# This script suppose the kdelibs to be installed
+# how to use :
+# dependecies_test_compilation <package![use[,use]...] [...]
+
+die() {
+ echo '!!! $@'
+ exit -100500
+}
+
+
+RESULT_DIR="/tmp/test-build-$(date +%Y-%m-%d_%H-%M)"
+SUCCESS_LIST="${RESULT_DIR}/success_list"
+FAIL_LIST="${RESULT_DIR}/fail_list"
+LOGS_DIR="${RESULT_DIR}/logs/"
+CONFIG_BAK="${RESULT_DIR}/portage_bak.tar.gz"
+PORTAGE_CONFIG="/etc/portage"
+EMERGE_AUTOUNMASK_OPTS="--autounmask y --autounmask-keep-masks y --autounmask-write y"
+mkdir -p "${RESULT_DIR}" "${LOGS_DIR}";
+
+for pkguse in "$@"; do
+done
+
+# backup config
+tar -cf "${CONFIG_BAK}" -C / "${PORTAGE_CONFIG#/}" || die "backup config failed"
+
+# initial cleanup
+( emerge -NuD world &&
+ emerge --depclean &&
+ emerge -NuD world &&
+ revdep-rebuild &&
+ rm -rf /var/tmp/portage ) || die "initial cleaning failed"
+
+for pkguse in "$@"; do
+ pkg="${pkguse%!*}"
+ use="${pkguse#*!}"
+ use="${use/,// }"
+ pkg_use_file="${PORTAGE_CONFIG}/package.use"
+ [ -d ${pkg_use_file} ] && pkg_use_file="${pkg_use_file}/test.use"
+ echo "$pkg $use" >>"$pkg_use_file"
+ pkg_failed=no
+ # check for it can be emerged due to depenencies uses
+ emerge -p "$pkg"
+ if [ "$?" != 0 ]; then
+ #try unmask uses
+ CONFIG_PROTECT_MASK="/etc/portage" emerge ${EMERGE_AUTOUNMASK_OPTS} "$pkg"
+ emerge -p "$pkg"
+ if [ "$?" != 0 ]; then
+ # we can't emerge the package
+ mkdir -p "${LOGS_DIR}/${pkg}"
+ emerge -p "$pkg" >"${LOGS_DIR}/${pkg}/emerge_failed" 2>&1
+ pkg_failed=yes
+ fi
+ fi
+
+ if [ "$pkg_failed" == no ]; then
+ emerge -1 "$pkg"
+ if [ "$?" != 0 ]; then
+ mkdir -p "${LOGS_DIR}/${pkg}"
+ for f_pkg in $(cd /var/tmp/portage/ && ls -d */*); do
+ cp "/var/tmp/portage/${f_pkg}/temp/build.log" "${LOGS_DIR}/${pkg}/${f_pkg/\//_}.build"
+ done
+ pkg_failed=yes
+ fi
+ fi
+
+ if [ "$pkg_failed" == no ]; then
+ echo "$pkg" >>"${SUCCESS_LIST}"
+ else
+ echo "$pkg" >>"${FAIL_LIST}"
+ fi
+
+ # restoring config
+ rm -rf ${PORTAGE_CONFIG}
+ tar -xf "${CONFIG_BAK}" -C /
+
+ # let's clean system
+ ( emerge -NuD world &&
+ emerge --depclean &&
+ emerge -NuD world &&
+ revdep-rebuild &&
+ rm -rf /var/tmp/portage ) || die "cleaning failed"
+done
diff --git a/gentoo/Documentation/scripts/update-keywords-lists b/gentoo/Documentation/scripts/update-keywords-lists
new file mode 100755
index 000000000..9390cdfb0
--- /dev/null
+++ b/gentoo/Documentation/scripts/update-keywords-lists
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+DOC="Documentation"
+KEYWORDS_LIVE="$DOC/trinity.live.keywords"
+KEYWORDS_3_5_13_2="$DOC/trinity.3.5.13.2.keywords"
+
+resort() {
+ cp "${1}" "${1}.bak"
+ cat "${1}.bak" | sort -u >"$1" && rm "${1}.bak"
+}
+
+find trinity-base/ trinity-apps/ -iname '*9999.ebuild' | while read eb; do
+ PN="$(basename $(dirname ${eb}))"
+ C="$(basename $(dirname $(dirname ${eb})))"
+ P="$(basename ${eb%%.ebuild})"
+ if ! grep "^~$C/$P " "${KEYWORDS_LIVE}" >/dev/null 2>&1; then
+ echo "~$C/$P **" | tee -a "${KEYWORDS_LIVE}"
+ fi
+done
+
+resort "${KEYWORDS_LIVE}"
+
+
+find trinity-base/ trinity-apps -iname '*3.5.13.2.ebuild' | while read eb; do
+ PN="$(basename $(dirname ${eb}))"
+ C="$(basename $(dirname $(dirname ${eb})))"
+ P="$(basename ${eb%%.ebuild})"
+ if ! grep "^~$C/$P" "${KEYWORDS_3_5_13_2}" >/dev/null 2>&1; then
+ echo "~$C/$P" | tee -a "${KEYWORDS_3_5_13_2}"
+ fi
+done
+resort "${KEYWORDS_3_5_13_2}"
diff --git a/gentoo/Documentation/scripts/usefull_commands b/gentoo/Documentation/scripts/usefull_commands
new file mode 100644
index 000000000..8ecaa9888
--- /dev/null
+++ b/gentoo/Documentation/scripts/usefull_commands
@@ -0,0 +1,15 @@
+# Per ebuild check and commit
+for I in <packages> ; do cp kate/metadata.xml $I; ebuild $I/$I-3.9999.ebuild digest; git add $I; git commit -m $I; done
+for I in kstart ksystraycmd ksysguard nsplugin kate kxkb ; do cp kate/metadata.xml $I; ebuild $I/$I-3.9999.ebuild digest; git add $I; git commit -m $I; done
+
+# update trinity live lists
+find trinity-base/ -iname '*9999.ebuild' | while read eb; do PN="$(basename $(dirname ${eb}))"; C="$(basename $(dirname $(dirname ${eb})))"; P="$(basename ${eb%%.ebuild})"; echo "~$C/$P"' **'; done | tee Documentation/trinity.live.keywords
+
+# update all manifests
+find . -iname *.ebuild | while read eb; do ebuild $eb digest; done
+
+# run ./test_separate_compilation.sh
+cat Documentation/derived-lists/<LIST> | sed 's/#.*//;s/^\s*//;s/\s*$//;/^\s*$/d' |xargs bash ./test_separate_compilation.sh
+
+# update manifests which older thatn ebuilds
+find . -iname *.ebuild | while read eb; do ma="$(dirname $eb)/Manifest"; find $(dirname $eb) -type f | while read f; do [ $f -nt $ma ] && ebuild $eb digest && touch $ma; done; done
diff --git a/gentoo/Documentation/scripts/write-ebuild.sh b/gentoo/Documentation/scripts/write-ebuild.sh
new file mode 100755
index 000000000..c567bd6fe
--- /dev/null
+++ b/gentoo/Documentation/scripts/write-ebuild.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+# Usage ; write-ebuild.sh <TRINITY_MODULE_NAME> [<CATEGORY/]><PN> [DESCRIPTION]
+export LC_ALL=C
+
+EAPI="5"
+
+TRINITY_MODULE_NAME=$1
+PN=$(basename ${2})
+CATEGORY=$(dirname ${2})
+CATEGORY=${CATEGORY:-trinity-base}
+DESCRIPTION="$3"
+
+PV=${PV:=9999}
+KEYWORDS="amd64 x86"
+case "${PV}" in
+ *3.5.13.2) KEYWORDS="~amd64 ~x86" ;;
+ *9999*) KEYWORDS="" ;;
+esac
+
+if [ -z "$DESCRIPTION" ]; then
+ DESCRIPTION_SOURCES=( ${CATEGORY/trinity/kde}/${PN} ${CATEGORY/trinity/kde}/${PN/k/t} kde-base/${PN} kde-base/${PN/k/t} )
+ for descsrc in ${DESCRIPTION_SOURCES[@]}; do
+ DESCRIPTION="$(eix -C $(dirname ${descsrc}) -s $(basename "${descsrc}") | sed -n '/^\s*Description:\s*/{s///;s/\(\<KDE\|\kde\)\>/Trinity/g;p}')"
+ [ -n "$DESCRIPTION" ] && break
+ done
+fi
+
+echo "==> Creating ebuild for ${PN}-${PV}"
+
+mkdir -p "${CATEGORY}/$PN"
+
+cat <<EOF >${CATEGORY}/$PN/$PN-${PV}.ebuild
+# Copyright 1999-$(date +%Y) Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# \$Id\$
+EAPI="$EAPI"
+TRINITY_MODULE_NAME="$TRINITY_MODULE_NAME"
+
+inherit trinity-meta
+
+DESCRIPTION="$DESCRIPTION"
+KEYWORDS="$KEYWORDS"
+IUSE+=""
+EOF
+
+cat <<EOF >"${CATEGORY}/$PN"/metadata.xml
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>fatzer2@gmail.com</email>
+ <name>Alexander Golubev</name>
+ </maintainer>
+</pkgmetadata>
+EOF
+
+if [ -d eclass/trinity-shared-files/${TRINITY_MODULE_NAME}-${PV} ]; then
+ mkdir -p "${CATEGORY}/$PN/files/"
+ ln -s "../../../eclass/trinity-shared-files/" "trinity-base/$PN/files/shared"
+fi