diff options
| author | Michael Palimaka <kensington@gentoo.org> | 2015-10-14 00:20:50 +1100 |
|---|---|---|
| committer | Michael Palimaka <kensington@gentoo.org> | 2015-10-14 00:21:46 +1100 |
| commit | e23d7a9f14e2efb0007ce40d3b015a3fe97505d8 (patch) | |
| tree | 5614b818b34b34760c0645ce72ccf3a7f9504620 | |
| parent | f9a8625ee6a17fd85118225b594447a8d45cd175 (diff) | |
| download | kde-e23d7a9f14e2efb0007ce40d3b015a3fe97505d8.tar.gz kde-e23d7a9f14e2efb0007ce40d3b015a3fe97505d8.tar.bz2 kde-e23d7a9f14e2efb0007ce40d3b015a3fe97505d8.zip | |
Documentation: start reorganising new maintainer scripts
| -rwxr-xr-x | Documentation/maintainers/new/copy-to-main-tree.sh | 56 | ||||
| -rwxr-xr-x | Documentation/maintainers/new/diff-between-versions.sh | 48 | ||||
| -rwxr-xr-x | Documentation/maintainers/new/lib.sh | 21 | ||||
| -rwxr-xr-x | Documentation/maintainers/new/set-based-remove.sh (renamed from Documentation/maintainers/drop-from-set.sh) | 25 |
4 files changed, 133 insertions, 17 deletions
diff --git a/Documentation/maintainers/new/copy-to-main-tree.sh b/Documentation/maintainers/new/copy-to-main-tree.sh new file mode 100755 index 00000000000..9b93379b5bc --- /dev/null +++ b/Documentation/maintainers/new/copy-to-main-tree.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +. $(dirname "$0")/lib.sh + +: ${SOURCE_REPO:="$(realpath $(dirname $0)/../../../)"} +: ${TARGET_REPO:="$(pwd)"} + +help() { + echo Simple set-based ebuild copier. + echo + echo Given a set in the source repository, copies all ebuilds with the specified + echo version into the target repository. + echo + echo Reads TARGET_REPO from your enviroment, defaulting to the current directory. + echo + echo Usage: copy-to-main-tree.sh SETNAME TARGETVERSION + echo Example: copy-to-main-tree.sh kde-frameworks-5.15 5.15.0 + exit 0 +} + + +SETNAME="$1" +TARGETVERSION="$2" + +if [[ $1 == "--help" ]] ; then + help +fi + +if [[ -z "${SETNAME}" || -z "${TARGETVERSION}" ]] ; then + echo ERROR: Not enough arguments + echo + help +fi + +packages=$(get_package_list_from_set ${SETNAME}) + +for cp in ${packages} ; do + trap "echo Exited without finishing!; exit;" SIGINT SIGTERM + + target_dir="${TARGET_REPO}/${cp}" + + if [[ ! -d "${target_dir}" ]] ; then + mkdir "${target_dir}" + fi + + pushd "${target_dir}" > /dev/null + + pn=$(basename $(pwd)) + ebuild="${pn}-${TARGETVERSION}.ebuild" + + cp "${SOURCE_REPO}/${cp}/${ebuild}" . + repoman manifest + + popd > /dev/null + +done diff --git a/Documentation/maintainers/new/diff-between-versions.sh b/Documentation/maintainers/new/diff-between-versions.sh new file mode 100755 index 00000000000..00c4a4ba510 --- /dev/null +++ b/Documentation/maintainers/new/diff-between-versions.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +. $(dirname "$0")/lib.sh + +: ${SOURCE_REPO:="$(realpath $(dirname $0)/../../../)"} +: ${TARGET_REPO:="$(pwd)"} + +help() { + echo Simple set-based ebuild differ. + echo + echo Given a set in the source repository, prints the diff between two versions + echo of ebuilds in the target repository. + echo + echo Reads TARGET_REPO from your enviroment, defaulting to the current directory. + echo + echo Usage: diff-between-versions.sh SETNAME VERSION1 VERSION2 + echo Example: diff-between-versions.sh kde-frameworks-5.15 5.14.0 5.15.0 + exit 0 +} + + +SETNAME="$1" +VERSION1="$2" +VERSION2="$3" + +if [[ $1 == "--help" ]] ; then + help +fi + +if [[ -z "${SETNAME}" || -z "${VERSION1}" || -z "${VERSION2}" ]] ; then + echo ERROR: Not enough arguments + echo + help +fi + +packages=$(get_package_list_from_set ${SETNAME}) + +for cp in ${packages} ; do + trap "echo Exited without finishing!; exit;" SIGINT SIGTERM + + target_dir="${TARGET_REPO}/${cp}" + + pushd "${TARGET_REPO}/${cp}" > /dev/null + pn=$(basename $(pwd)) + diff -u "${pn}-${VERSION1}.ebuild" "${pn}-${VERSION2}.ebuild" + + popd > /dev/null +done diff --git a/Documentation/maintainers/new/lib.sh b/Documentation/maintainers/new/lib.sh new file mode 100755 index 00000000000..b336399e9ab --- /dev/null +++ b/Documentation/maintainers/new/lib.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# requires app-portage/portage-utils and app-portage/gentoolkit-dev + +: ${SOURCE_REPO:="$(realpath $(dirname $0)/../../../)"} +: ${TARGET_REPO:="$(pwd)"} + +get_package_list_from_set() { + local set="${1}" + + for entry in $(grep -v ^[#@] "${SOURCE_REPO}/sets/${set}") ; do + echo $(qatom ${entry} | cut -d " " -f 1-2 | tr " " "/") + done +} + +get_main_tree_keyword() { + local portdir="$(portageq get_repo_path / gentoo)" + local cp="${1}" + + echo $(sed -ne 's/^KEYWORDS="\(.*\)"/\1/p' "$(ls ${portdir}/${cp}/*.ebuild | sort | tail -n 1)") +} diff --git a/Documentation/maintainers/drop-from-set.sh b/Documentation/maintainers/new/set-based-remove.sh index 3267811ff24..de485e19794 100755 --- a/Documentation/maintainers/drop-from-set.sh +++ b/Documentation/maintainers/new/set-based-remove.sh @@ -1,28 +1,18 @@ #!/bin/sh -# requires app-portage/portage-utils and app-portage/gentoolkit-dev +. $(dirname "$0")/lib.sh -: ${PORTDIR:="$(pwd)"} - -get_package_list_from_set() { - - local SET="${1}" - - for entry in $(grep -v ^[#@] "${PORTDIR}/sets/${SET}") ; do - echo $(qatom ${entry} | cut -d " " -f 1-2 | tr " " "/") - done - -} +: ${TARGET_REPO:="$(pwd)"} help() { echo Simple set-based version removed. echo echo Given a set file, removes all packages of a specified version. echo - echo Reads PORTDIR from your environment, defaulting to the current directory. + echo Reads TARGET_REPO from your environment, defaulting to the current directory. echo - echo Usage: drop-from-set.sh SETNAME VERSION - echo Example: drop-from-set.sh kde-plasma-5.0 5.0.1 + echo Usage: set-based-remove.sh SETNAME VERSION + echo Example: set-based-remove.sh kde-plasma-5.0 5.0.1 exit 0 } @@ -43,7 +33,8 @@ fi packages=$(get_package_list_from_set ${SETNAME}) for package in ${packages} ; do - pushd "${PORTDIR}/${package}" > /dev/null + trap "echo Exited without finishing!; exit;" SIGINT SIGTERM + pushd "${TARGET_REPO}/${package}" > /dev/null pn=$(basename $(pwd)) @@ -51,5 +42,5 @@ for package in ${packages} ; do rm -f ${pn}-${VERSION}-r*.ebuild repoman manifest - + popd > /dev/null done |
