View previous topic :: View next topic |
Author |
Message |
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sat Aug 28, 2004 11:59 am Post subject: epo: Portage dopen |
|
|
[DISCLAIMER]
Dieser Beitrag enthält ein unzureichend getestetes Skript. Benutzung auf eigene Gefahr.
Das Skript habe ich bisher nur unter Portage-2.0.51 getestet. Falls es wider Erwarten auch mit 2.0.50 funktioniert, bitte hier posten. Alle weiteren Kommentare, Flames etc. ebenfalls hier rein.
[/DISCLAIMER]
Quote: | !!! All ebuilds that could satisfy "=xorg-x11-6.7.99.902" have been masked |
Manchmal wünscht man sich das alte "ACCEPT_KEYWORDS=~arch emerge <pkg>" zurück, da es auf die Dauer lästig ist, von Hand die Einträge in package.* vorzunehmen. Abhilfe schafft ein kleines Script, das den letzten emerge Befehl analysiert und alle notwendigen Einträge in package.* macht. Das ganze sieht dann so aus:
Quote: |
$ emerge =xorg-x11-6.7.99.902
Calculating dependencies
!!! All ebuilds that could satisfy "=xorg-x11-6.7.99.902" have been masked
!!! One of the following masked packages is required to complete your request:
- x11-base/xorg-x11-6.7.99.902 (masked by: package.mask, ~x86 keyword)
# <seemant@gentoo.org> (13 Aug 2004)
# Masked for TESTING by DEVS and ARCHES!
For more information, see MASKED PACKAGES section in the emerge man page or
section 2.2 "Software Availability" in the Gentoo Handbook.
$ epo
* Starting emerge in the background. Please wait a while...
$ emerge =xorg-x11-6.7.99.902 --pretend 2>&1 [ ok ]
* Looking for packages to add to package.{unmask,keywords}
* =x11-base/xorg-x11-6.7.99.902
* will be added to /etc/portage/package.unmask
* =x11-base/xorg-x11-6.7.99.902 ~x86
* will be added to /etc/portage/package.keywords
* Do you want me to apply these changes?
Please type "Yes" or "No" Yes
* Starting emerge in the background. Please wait a while...
$ emerge =xorg-x11-6.7.99.902 --pretend 2>&1 [ ok ]
* Looking for packages to add to package.{unmask,keywords}
* Nothing to do. The last emerge command was
* emerge =xorg-x11-6.7.99.902
* Do you want me to re-run it?
Please type "Yes" or "No" Yes
Calculating dependencies ...done!
>>> emerge (1 of 1) x11-base/xorg-x11-6.7.99.902 to /
...
|
Zur Installation des Skripts genügt folgendes:
Code: |
wget -P /sbin http://www.stud.uni-karlsruhe.de/~uxhz/gentoo/misc/epo
chmod +x /sbin/epo
|
Sobald beim emergen die "!!! All ebuilds that could satisfy ... have been masked" Fehlermeldung kommt, einfach "epo" starten.
Das funktioniert allerdings nicht mit "--pretend" (-p), da dieser Befehl nicht in emerge.log landet. Der Vollständigkeit halber hier das Skript:
Code: |
#!/bin/bash
###########################################################################
# Copyright (C) 2004 by Dennis Nienhüser #
# fragfred@gmx.de #
# http://www.stud.uni-karlsruhe.de/~uxhz/gentoo/misc/epo #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the #
# Free Software Foundation, Inc., #
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #
###########################################################################
source /sbin/functions.sh
PNAME="epo"
PVERSION="0.1"
PORTLOGFILE="/var/log/emerge.log"
function askUser() {
if [[ "$1" == "--yes" ]]
then
answer="Yes"
else
answer=""
fi
while [[ "${answer}" != "Yes" && "${answer}" != "No" ]]
do
read -p "Please type \"Yes\" or \"No\" " answer
done
echo ${answer}
}
function getLastEmergeCommand() {
tail -n 100 ${PORTLOGFILE} | grep "Started emerge on" -A 1 | tail -n 1 | cut -f 4 -d "[color=green]*[/color]"
}
mkdir -p /etc/portage
unmask="nothing"
while [ -n "${unmask}${keywords}" ]
do
echo
last="$(getLastEmergeCommand $@) --pretend 2>&1"
ebegin "Starting emerge in the background. Please wait a while"
echo "\$${last/--ask/}"
out="$(${last/--ask/})"
eend
einfo "Looking for packages to add to package.{unmask,keywords}"
# Sorting the output attempts to unmask/keyword the ebuild with the lowest version number
# that satisfies the dependency. foo-1.8 and foo-1.12 will be sorted 'wrong' though, resulting
# in foo-1.12 being unmasked/keyworded.
unmask="$(echo "$out" | grep "masked by: package.mask" | cut -d " " -f 2 | sort | head -n 1)"
keywords="$(echo "$out" | egrep "masked by: ~.[color=green]*[/color] keyword" | cut -d " " -f 2,5 | sort | head -n 1)"
if [ -z "${keywords}" ]
then
keywords="$(echo "$out" | egrep "masked by: .[color=green]*[/color] keyword" | cut -d " " -f 2,6 | sort | head -n 1)"
fi
if [ -n "${unmask}" ]
then
echo
einfo "=${unmask}"
einfo "will be added to /etc/portage/package.unmask"
fi
if [ -n "${keywords}" ]
then
echo
einfo "=${keywords}"
einfo "will be added to /etc/portage/package.keywords"
fi
if [ -n "${unmask}${keywords}" ]
then
echo
einfo "Do you want me to apply these changes?"
answer="$(askUser $1)"
if [[ ${answer} == "Yes" ]]
then
if [ -n "${unmask}" ]
then
echo >> /etc/portage/package.unmask
echo "# ${PNAME}-${PVERSION} added the next entry" >> /etc/portage/package.unmask
echo "# at $(date)" >> /etc/portage/package.unmask
echo "=${unmask}" >> /etc/portage/package.unmask
fi
if [ -n "${keywords}" ]
then
echo >> /etc/portage/package.keywords
echo "# ${PNAME}-${PVERSION} added the next entry" >> /etc/portage/package.keywords
echo "# at $(date)" >> /etc/portage/package.keywords
echo "=${keywords}" >> /etc/portage/package.keywords
fi
else
echo "Exiting."
exit 1
fi
fi
done
last="$(getLastEmergeCommand $@)"
echo
einfo "Nothing to do. The last emerge command was"
einfo "${last}"
einfo "Do you want me to re-run it?"
answer="$(askUser $1)"
if [[ "${answer}" == "Yes" ]]
then
${last}
else
echo "Exiting."
exit 2
fi
exit 0
|
|
|
Back to top |
|
|
Carlo Developer
Joined: 12 Aug 2002 Posts: 3356
|
Posted: Sat Aug 28, 2004 1:26 pm Post subject: |
|
|
Wie kommst Du auf epo? Im olympischen Dopingrausch!? _________________ Please make sure that you have searched for an answer to a question after reading all the relevant docs. |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sat Aug 28, 2004 1:54 pm Post subject: |
|
|
Carlo wrote: | Wie kommst Du auf epo? Im olympischen Dopingrausch!? |
Ja, so in der Art... /etc/portage sollte drinstecken, und das Wortspiel konnte ich mir dann nicht verkneifen |
|
Back to top |
|
|
Phlogiston Veteran
Joined: 27 Jan 2004 Posts: 1925 Location: Europe, Swizerland
|
Posted: Thu Apr 21, 2005 12:00 pm Post subject: |
|
|
wie siehts aus mit diesem Script? Hats jemand schon erfolgreich im Dauerbetrieb? _________________ Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor |
|
Back to top |
|
|
urias n00b
Joined: 18 Oct 2005 Posts: 7
|
Posted: Tue Oct 18, 2005 10:27 pm Post subject: |
|
|
ja, und bisher keine Probleme |
|
Back to top |
|
|
Phlogiston Veteran
Joined: 27 Jan 2004 Posts: 1925 Location: Europe, Swizerland
|
Posted: Tue Oct 18, 2005 10:42 pm Post subject: |
|
|
ja hier läufts nun auch, wirklich praktisch. Schön wäre noch, wänn ein Y für Yes auch reichen würde
Greets
Phlogiston _________________ Workstation: 5.1 SurroundSound, LIRC remote control; Laptop [IBM-T43]: patched sources, s2disk/ram, fingerprint sensor |
|
Back to top |
|
|
gentop l33t
Joined: 29 Nov 2004 Posts: 639
|
Posted: Wed Oct 19, 2005 10:05 am Post subject: |
|
|
Ist echt ein super hilfreiches Skript! Danke
//gentop |
|
Back to top |
|
|
Finswimmer Bodhisattva
Joined: 02 Sep 2004 Posts: 5467 Location: Langen (Hessen), Germany
|
Posted: Sun Oct 23, 2005 7:54 pm Post subject: |
|
|
Irgendwie habe ich das Prinzip noch nicht durchschaut...
Ich hab folgenden Update Befehl:
LINGUAS="de" emerge -u -D --newuse world
Wenn ich den starte, kommt:
Code: |
tobi-rechner filme # emerge --update --deep --newuse world
Calculating world dependencies -
!!! All ebuilds that could satisfy ">=x11-libs/cairo-0.9.2" have been masked.
!!! One of the following masked packages is required to complete your request:
- x11-libs/cairo-1.0.2 (masked by: ~x86 keyword)
For more information, see MASKED PACKAGES section in the emerge man page or
section 2.2 "Software Availability" in the Gentoo Handbook.
!!! (dependency required by "x11-libs/gtk+-2.8.6" [ebuild])
!!! Problem with ebuild app-office/dia-0.94-r3
!!! Possibly a DEPEND/*DEPEND problem.
!!! Depgraph creation failed.
|
Soweit so gut.
Dann epo:
Code: | tobi-rechner filme # epo
* Starting emerge in the background. Please wait a while ...
$ emerge --update --deep --newuse world --pretend 2>&1 [ ok ]
* Looking for packages to add to package.{unmask,keywords}
* Nothing to do. The last emerge command was
* emerge --update --deep --newuse world
* Do you want me to re-run it?
Please type "Yes" or "No" Yes
|
Und nun? Hm.....
Danke |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sun Oct 23, 2005 9:12 pm Post subject: |
|
|
In was für einem Terminal lässt du das laufen? Screen vielleicht? _________________ KDE |
|
Back to top |
|
|
Finswimmer Bodhisattva
Joined: 02 Sep 2004 Posts: 5467 Location: Langen (Hessen), Germany
|
Posted: Sun Oct 23, 2005 9:32 pm Post subject: |
|
|
Nee. Normal im Terminal.
Ich glaube, er hat das Problem, dass in emerge.log kein Fehler abgespeichert wird...
Soll heißen: Er sagt nicht, dass dieses und jenes Programm masked ist.
Tobi |
|
Back to top |
|
|
Earthwings Bodhisattva
Joined: 14 Apr 2003 Posts: 7753 Location: Germany
|
Posted: Sun Oct 23, 2005 10:03 pm Post subject: |
|
|
Die Fehlermeldung wird von der Ausgabe von emerge übernommen. Dort fängt er die Zeile - x11-libs/cairo-1.0.2 (masked by: ~x86 keyword) ab. Ist in der Ausgabe das ~x86 grün? _________________ KDE |
|
Back to top |
|
|
Finswimmer Bodhisattva
Joined: 02 Sep 2004 Posts: 5467 Location: Langen (Hessen), Germany
|
Posted: Mon Oct 24, 2005 6:35 am Post subject: |
|
|
Quote: | !!! All ebuilds that could satisfy "=gcc-4.0.2-r1" have been masked.
!!! One of the following masked packages is required to complete your request:
- sys-devel/gcc-4.0.2-r1 (masked by: -* keyword)
For more information, see MASKED PACKAGES section in the emerge man page or
section 2.2 "Software Availability" in the Gentoo Handbook.
|
!!! All ebuilds that could satisfy "=gcc-4.0.2-r1" have been masked.
Das ist rot.
=gcc-4.0.2-r1 <-- Das ist grün.
Der Rest ist schwarz.
Auch masked by: -* keyword ist schwarz.
Danke
Tobi |
|
Back to top |
|
|
Qubit Tux's lil' helper
Joined: 23 Sep 2002 Posts: 136 Location: /dev/urandom
|
Posted: Wed Jan 18, 2006 9:52 am Post subject: |
|
|
Hi Earthwings,
Erstmal Lob für dein Tool! Gerade bei xorg-7 ect. sehr hilfreich!
Allerdings greift dein Suchmuster wohl nicht bei z.B
Code: | emerge -pv e KEYWORD=-* |
Etwa so könnte man die egrep-Zeile im epo-script bei Zeile 74 erweitern.
Code: |
egrep "masked by: [-~].* keyword" | cut -d " " -f 2,5 | sort | head -n 1
|
Gruß Qubit. _________________ ©Qubit |
|
Back to top |
|
|
|