diff options
| author | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2008-10-05 21:14:30 +0000 |
|---|---|---|
| committer | Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@gentoo.org> | 2008-10-05 21:29:33 +0000 |
| commit | cb73e051a00f092a2514d702ba8c336729ba30fa (patch) | |
| tree | d78d2754f47e1a3f3f6f296ea601b76d0b89d90f | |
| parent | a0d2db59f21fa29195b1f1e2de31ee2d9859049f (diff) | |
| download | kde-cb73e051a00f092a2514d702ba8c336729ba30fa.tar.gz kde-cb73e051a00f092a2514d702ba8c336729ba30fa.tar.bz2 kde-cb73e051a00f092a2514d702ba8c336729ba30fa.zip | |
Added full-working script.
| -rwxr-xr-x | Documentation/change_slot | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Documentation/change_slot b/Documentation/change_slot index e76342273ec..dbbfd343572 100755 --- a/Documentation/change_slot +++ b/Documentation/change_slot @@ -23,6 +23,7 @@ show_options () { echo "repo - The repo name as specified in ${repo}/profiles/repo_name" echo "old_slot - The slot to be replaced" echo "new_slot - The new slot to use" + echo "inst_version - Installed package version to update the slot" exit } @@ -60,11 +61,16 @@ change_slot () { if [[ ${files} != "" ]]; then # for each file (there might be more than one ebuild for file in ${files[@]}; do - version=$(basename ${file}) - version=${version%.ebuild} - version=${version%-r*} -# echo "version: ${version}" - sed "s/${OLD_SLOT}/${NEW_SLOT}/" ${VDBDIR}/${category}/${version}/SLOT + + if [[ "${INST_VERSION}" == "" ]]; then + version=$(basename ${file}) + version=${version%.ebuild} + version=${version%-r*} + else + version=${package}-${INST_VERSION} + fi + + sed -i -e "s/^${OLD_SLOT}$/${NEW_SLOT}/" "${VDBDIR}/${category}/${version}/SLOT" done fi done @@ -81,6 +87,7 @@ SCRIPT_ARGS="$*" REPO="${1}" OLD_SLOT="${2}" NEW_SLOT="${3}" +INST_VERSION="${4}" if ([[ -z "${REPO}" ]] || [[ -z "${OLD_SLOT}" ]] || [[ -z "${NEW_SLOT}" ]]); then show_options |
