pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

paste-bin - collaborative debugging tool View Help


Posted by Anonymous on Thu 17th May 21:57
download | new post

  1. #!/bin/bash
  2. #
  3. # This script will unmask any package masked by the actual profile.
  4. #
  5. # First we search for what is actually masked
  6. # in /usr/portage/profiles/package.mask then add a corresponding
  7. # line in /etc/portage/package.unmask
  8. #
  9. #
  10. # Original by [email protected]
  11.  
  12. source /sbin/functions.sh
  13.  
  14. [ "$UID" -ne "0" ] && eerror "You must be root to run this script." && exit
  15. [ -z "$1" ] && eerror "Please state a package name (eg. unmask kde-base/kode)" && exit
  16. [ ! -d /etc/portage ] && einfo "Creating /etc/portage directory" && mkdir /etc/portage
  17.  
  18. if [ "$(grep "$1"-[0-9] /etc/portage/package.unmask 2>/dev/null)" ]; then
  19.     ewarn "$1 already exists in package.unmask"
  20. else
  21.     PKG_LINE="$(grep "$1"-[0-9] /usr/portage/profiles/package.mask 2>/dev/null)"
  22.     if [ ! $PKG_LINE ]; then
  23.         PKG_LINE="$(grep "$1" /usr/portage/profiles/package.mask 2>/dev/null)"
  24.     fi
  25.     if [ ! $PKG_LINE ]; then
  26.       ewarn "Could not find $1 in /usr/portage/profiles/package.mask" && exit 1
  27.     else
  28.       ebegin "Adding $1 to package.unmask"
  29.       echo $PKG_LINE >> /etc/portage/package.unmask
  30.       eend $?
  31.     fi
  32. fi

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@
:
:
Remember my settings