Skip to content

Instantly share code, notes, and snippets.

@grepwood
Last active August 29, 2015 14:12
Show Gist options
  • Save grepwood/c8cd6e01b84e32e7c5c8 to your computer and use it in GitHub Desktop.
Save grepwood/c8cd6e01b84e32e7c5c8 to your computer and use it in GitHub Desktop.

Revisions

  1. Michael Dec revised this gist Jan 7, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion properly_update_portage.sh
    Original file line number Diff line number Diff line change
    @@ -26,6 +26,6 @@ function stop_being_silly {
    }

    emerge --sync -q
    if command -v layman; then layman -Sq; fi
    if command -v layman >/dev/null; then layman -Sq; fi
    fix_qt4_ebuilds
    stop_being_silly
  2. Michael Dec revised this gist Jan 7, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions properly_update_portage.sh
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ function fix_qt4_ebuilds {
    ELEMENT=(core dbus gui script svg)
    JOB_PID=$$
    for((COUNTER=0, ARRAY_SIZE=${#ELEMENT[*]}; COUNTER < ARRAY_SIZE; ++COUNTER)) do
    CURRENT_ELEMENT=$ELEMENT[COUNTER]
    EBUILD=`ls qt$ELEMENT/qt$ELEMENT-4*.ebuild | tail -n1`
    CCURRENT_ELEMENT=${ELEMENT[COUNTER]}
    EBUILD=`ls qt$CURRENT_ELEMENT/qt$CURRENT_ELEMENT-4*.ebuild | tail -n1`
    if [ "`grep ^IUSE $EBUILD | grep c\+\+0x | wc -l`" -eq "0" ]; then
    cat $EBUILD | sed 's/^IUSE=\"/IUSE=\"c\+\+0x\ /' > ebuild.$JOB_PID
    mv ebuild.$JOB_PID $EBUILD
  3. Michael Dec created this gist Jan 6, 2015.
    31 changes: 31 additions & 0 deletions properly_update_portage.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/bin/bash
    function fix_qt4_ebuilds {
    pushd /usr/portage/dev-qt
    ELEMENT=(core dbus gui script svg)
    JOB_PID=$$
    for((COUNTER=0, ARRAY_SIZE=${#ELEMENT[*]}; COUNTER < ARRAY_SIZE; ++COUNTER)) do
    CURRENT_ELEMENT=$ELEMENT[COUNTER]
    EBUILD=`ls qt$ELEMENT/qt$ELEMENT-4*.ebuild | tail -n1`
    if [ "`grep ^IUSE $EBUILD | grep c\+\+0x | wc -l`" -eq "0" ]; then
    cat $EBUILD | sed 's/^IUSE=\"/IUSE=\"c\+\+0x\ /' > ebuild.$JOB_PID
    mv ebuild.$JOB_PID $EBUILD
    ebuild $EBUILD digest
    else
    echo "$EBUILD already contains c++0x"
    fi
    done
    popd
    }

    function stop_being_silly {
    pushd /usr/portage/profiles
    JOB_PID=$$
    sed 's/^qt5$//' base/use.mask > $JOB_PID
    mv $JOB_PID base/use.mask
    popd
    }

    emerge --sync -q
    if command -v layman; then layman -Sq; fi
    fix_qt4_ebuilds
    stop_being_silly