Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Unsupported Software
  • Search

pye - "pick your emerge" script

This forum covers all Gentoo-related software not officially supported by Gentoo. Ebuilds/software posted here might harm the health and stability of your system(s), and are not supported by Gentoo developers. Bugs/errors caused by ebuilds from overlays.gentoo.org are covered by this forum, too.
Post Reply
Advanced search
133 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
Author
Message
Monkeywrench
Apprentice
Apprentice
User avatar
Posts: 205
Joined: Tue Jun 22, 2004 3:50 am
Location: Florida

  • Quote

Post by Monkeywrench » Sun Jul 04, 2004 3:29 am

awesome script dr_shadow! I'm currently kind of learning python (my first language, actually) but I'd have no idea how to put this kind of thing together... really cool :D

The only things I would like to see would be colored output, specifically having the USE flags and package size in different colors, and having the options that the user invokes for pye extended to each emerge. What I mean is, for example, if I run "pye -upvD world" and emerge a few packages, one of the packages might say
" * Processed 347 info files: 1 errors; run with emerge --verbose to view errors."
even if I did pass "-v" to pye. But these are both small issues.

Thanks again for the script :D
Folding@home -Join the Linux team (163)!
Top
Pink
Veteran
Veteran
User avatar
Posts: 1062
Joined: Thu Jul 24, 2003 11:52 am

  • Quote

Post by Pink » Mon Jul 26, 2004 10:00 am

Great script, discovered it today and for what I've used it for so far it's been great.

Big thanks from me :D
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Mon Jul 26, 2004 1:16 pm

Thanks for the thanks:-)
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
zsoltika
l33t
l33t
User avatar
Posts: 634
Joined: Thu Nov 13, 2003 3:43 pm
Location: Budapest, Hungary
Contact:
Contact zsoltika
Website

  • Quote

Post by zsoltika » Wed Aug 18, 2004 6:53 pm

Some improvemnet suggestion:
  • - pye should have a "--version" param which displays pye's version.
    - If there are nothing to update like below it should exit except asking me to choose from nothing.

    Code: Select all

    #pye -uUDv system                                                  
    One moment...
    These are the packages that I would merge, in order:
    Calculating system dependencies  ...done!
    Total size of downloads: 0 kB
    Enter the numbers of packages you want to emerge or unmerge (in case of prune),comma-separated (you can also specify ranges, like 1,4-8,12 etc.). Alternatively, you can specify packages to be excluded from the list; for this, start your first item with an ! (e.g. !2,4,8). For all packages write 'a'. If you want to quit, press q:
Cheers from Budapest :D
Top
STEDevil
Apprentice
Apprentice
Posts: 156
Joined: Thu Apr 24, 2003 12:42 pm

  • Quote

Post by STEDevil » Sun Aug 29, 2004 7:39 am

dr_strange wrote:
stahlsau wrote:hi,
imho, if you call just "pye", the script calls "emerge -Up world", and when you agree it does "emerge -U world", right?

If that´s right, it´s maybe the wrong way, ´cause -U can really break some things. (for me, it did once - so i looked for this option in your script before running it ;-))
For me, i changed it to -uD, so i get the up- AND downgrades AND the dependencies.
No, pye anything just runs emerge -p anything; you should add any other flags yourself.
If that is the case, then perhaps the very first sentence in the very first post in this thread should be updated?
dr_strange wrote:The following script basically gives you a numbered list of emerge -pU world output, and you can choose what to emerge by typing in the numbers simply...
Also, it would probably also be a good idea to update the entry for pye in this thread http://forums.gentoo.org/viewtopic.php?t=67849
(but hopefully the ebuild for this little script will be added soon anyway =).

BTW, you haven't been thinking of adding a functionallity like ehush ( http://forums.gentoo.org/viewtopic.php?t=76161 ) to your script? Could be added as an option when proceding with the actual emerges, eg "sh" or "s hush". That would be really greate.

Visszlát :)
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Mon Aug 30, 2004 6:52 pm

zsoltika wrote:Some improvemnet suggestion:
  • - pye should have a "--version" param which displays pye's version.
    - If there are nothing to update like below it should exit except asking me to choose from nothing.

    Code: Select all

    #pye -uUDv system                                                  
    One moment...
    These are the packages that I would merge, in order:
    Calculating system dependencies  ...done!
    Total size of downloads: 0 kB
    Enter the numbers of packages you want to emerge or unmerge (in case of prune),comma-separated (you can also specify ranges, like 1,4-8,12 etc.). Alternatively, you can specify packages to be excluded from the list; for this, start your first item with an ! (e.g. !2,4,8). For all packages write 'a'. If you want to quit, press q:
Cheers from Budapest :D
Good ideas, thanks. I am back from vacation now, and will start thinking about implementing them and all the other suggestions in this thread.

Re-cheers from Budapest, see you on #gentoo-hu on freenode!
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Thu Sep 23, 2004 10:35 pm

Okay, I've decided to unleash version 0.8.4 onto the unsuspecting masses... There are quite a few changes:

- the script now uses the getopt.getopt() function for option parsing
- you have the following options now:
-v or --version: prints version
-h or --help
-s or --sync: makes emerge rsync before anything else
-e or --emergeopts: here you list the opts you would give to emerge: for instance pye -e uDv world would be equivalent with calling emerge -puDv world
-i or --info <package> will print all info about <package> that can be found in /var/db/pkg
-c or --category: will list all packages available in a portage category; e.g. pye -c games-fps will give you the list of all FPS games in portage, to choose from
-p or --prune: lists all installed packages, and the user can choose which nes to unmerge

When the packages are listed, you will have the following possibilities:

Code: Select all

             * you can simply enter the numbers comma-separated, e.g. 1,3,5,6,8
             * you can also specify ranges: 2,4-7,9,11-16
             * "a" or "all" merges all packages in the list
             * "!" excludes the specified packages (and merges the rest): !4,6-8,13
             * "x" excludes _and_ masks them in /etc/portage/package.mask or ~/.pye/pye.mask
             * "q" quits pye
- Pye now boasts of a config file! It would reside in ~/.pye/pye.conf (you should manually create the dir and file for the time being), and can contain the following variables:

Code: Select all

EMERGEOPTS = uDv
SILENT = no
MASKFILE_ETC_PORTAGE_PACKAGEMASK = no
With EMERGEOPTS you can specify your standard options for emerge (pye -e overrides this).
If SILENT is yes, pye will not print the list of choices as shown above.
The maskfile is a new feature. When you specify the packages to be excluded with an x (e.g. x3,6-9,23), pye will enter these packages either into /etc/portage/package.mask or ~/.pye/pye.mask, depending on the variable MASKFILE_ETC_PORTAGE_PACKAGEMASK (if yes, the former, if no, the latter). Those packages will not show up when you dp pye world the next time.
At the end, pye now gives emerge times for the individual packages.

The script is available from here. Please test extensively and suggest improvements.

TODO:

- --purge option to totally unmerge a package
- --sqlite backend
- HUSH variable to oppress emerge output

Enjoy,

dr_strange
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Fri Sep 24, 2004 6:41 am

further TODOs:

TODO:

- --purge option to totally unmerge a package
- --sqlite backend
- HUSH variable to oppress emerge output
- beautify output of --info
- provide some alternative output for --info if package is not installed
- colorize package listing if --v in emergeopts
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
nouse66
Apprentice
Apprentice
User avatar
Posts: 194
Joined: Thu Jan 09, 2003 10:11 pm

  • Quote

Post by nouse66 » Sun Sep 26, 2004 9:26 pm

i just grabbed your newest version and it's not running for me:

Code: Select all

aaron/ # pye world

Traceback (most recent call last):
  File "/usr/sbin/pye", line 179, in ?
    conf, defaultopts, silent, maskfile = parse_pyeconf(confpath)
  File "/usr/sbin/pye", line 48, in parse_pyeconf
    return confvar, optsvar, silentvar, maskfilevar
UnboundLocalError: local variable 'confvar' referenced before assignment
that's all i get, any idea what's wrong?

thanks,
aaron
Top
iverson0881
Apprentice
Apprentice
User avatar
Posts: 285
Joined: Thu Jan 08, 2004 3:22 am
Location: CA

  • Quote

Post by iverson0881 » Mon Sep 27, 2004 1:30 am

Code: Select all

bash-2.05b# ./pye
Traceback (most recent call last):
  File "./pye", line 179, in ?
    conf, defaultopts, silent, maskfile = parse_pyeconf(confpath)
  File "./pye", line 48, in parse_pyeconf
    return confvar, optsvar, silentvar, maskfilevar
UnboundLocalError: local variable 'confvar' referenced before assignment
Yup having problems here too :(

NEVERMIND it works perfectly just make sure you create your ~/.pye/pye.conf as told
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Mon Sep 27, 2004 8:31 am

OK, another TODO: make an ebuild that installs pye + creates the conf file and empty mask file for the user

thx guys
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
Chickpea
l33t
l33t
Posts: 846
Joined: Mon Jun 03, 2002 3:09 am
Location: Vancouver WA

  • Quote

Post by Chickpea » Tue Sep 28, 2004 2:47 pm

I just working with this today and I get a couple of errors. If I use pye alone i get this error message:

Code: Select all

These are the packages that I would merge, in order:

Calculating dependencies   
emerge: there are no masked or unmasked ebuilds to satisfy "w".

!!! Error calculating dependencies. Please correct.
No packages to emerge.
if I try to use this option:

Code: Select all

  -p or --prune will list all installed packages, from which you can pick the ones
                        to unmerge (proceed carefully!)

Code: Select all

emergeopts: 
Traceback (most recent call last):
  File "/usr/bin/pye", line 242, in ?
    print "emergeopts: ", green(emergeopts)
NameError: name 'emergeopts' is not defined
What is going on?
Top
asph
l33t
l33t
User avatar
Posts: 741
Joined: Mon Aug 25, 2003 8:52 am
Location: Barcelona, Spain

  • Quote

Post by asph » Tue Sep 28, 2004 3:29 pm

iverson0881 wrote:

Code: Select all

bash-2.05b# ./pye
Traceback (most recent call last):
  File "./pye", line 179, in ?
    conf, defaultopts, silent, maskfile = parse_pyeconf(confpath)
  File "./pye", line 48, in parse_pyeconf
    return confvar, optsvar, silentvar, maskfilevar
UnboundLocalError: local variable 'confvar' referenced before assignment
Yup having problems here too :(

NEVERMIND it works perfectly just make sure you create your ~/.pye/pye.conf as told
same error here.. do we have to create the config file?
a suggestion may be that pye creates the config file with default settings if it's not here, or ask you the values (showing defaults) the first time you run it
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Tue Sep 28, 2004 5:59 pm

yes, please, for the time being do create the conf file, I will amend the script and post a new version soon
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
asph
l33t
l33t
User avatar
Posts: 741
Joined: Mon Aug 25, 2003 8:52 am
Location: Barcelona, Spain

  • Quote

Post by asph » Tue Sep 28, 2004 6:26 pm

i created the config file, now i get another error:

emerge: there are no ebuilds to satisfy "w".
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Top
Keffin
Apprentice
Apprentice
Posts: 202
Joined: Sat Feb 14, 2004 9:44 pm
Location: England

  • Quote

Post by Keffin » Tue Sep 28, 2004 6:37 pm

nastassja wrote:i created the config file, now i get another error:

emerge: there are no ebuilds to satisfy "w".
I got that when I just ran "pye". I ran "pye world" and got past that, then got a ~/.pye/pye.mask doesn't exist error. I created that then it worked like a charm.
Always cut the deck if it ups your odds.
Top
stahlsau
Guru
Guru
User avatar
Posts: 584
Joined: Fri Jan 09, 2004 8:16 am
Location: WildWestwoods

  • Quote

Post by stahlsau » Wed Sep 29, 2004 6:27 am

hi,
just wanna say: nice script, dr_strange, thank you!
I´m using this for a long time embedded into my own update-script, works very well. Recently, i had to do a "emerge -e world", which in former times kept failing at the moment i went to bed. With "pye -e world" and "step-emerge" there are no problems, and i see the other day which packages failed overnight. Very nice!
(and please excuse my language, it´s early in the morning ;-))
Top
asph
l33t
l33t
User avatar
Posts: 741
Joined: Mon Aug 25, 2003 8:52 am
Location: Barcelona, Spain

  • Quote

Post by asph » Wed Sep 29, 2004 7:22 am

works fine now, steps i followed:

Code: Select all

# cd
# wget http://magenta.linuxforum.hu/downloads/pye
# chmod +x pye
# mkdir ~/.pye
# echo "EMERGEOPTS = uDv" > ~/.pye/pye.conf
# echo "SILENT = no" >> ~/.pye/pye.conf
# echo "MASKFILE_ETC_PORTAGE_PACKAGEMASK = no" >> ~/.pye/pye.conf
# touch ~/.pye/pye.mask
# ./pye world
thanks for pye, works fine :)
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Wed Sep 29, 2004 7:41 am

stahlsau wrote:hi,
just wanna say: nice script, dr_strange, thank you!
I´m using this for a long time embedded into my own update-script, works very well. Recently, i had to do a "emerge -e world", which in former times kept failing at the moment i went to bed. With "pye -e world" and "step-emerge" there are no problems, and i see the other day which packages failed overnight. Very nice!
(and please excuse my language, it´s early in the morning ;-))
glad you like it; please also test the new version, I'd like to catch as many bugs as possible
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
Chickpea
l33t
l33t
Posts: 846
Joined: Mon Jun 03, 2002 3:09 am
Location: Vancouver WA

  • Quote

Post by Chickpea » Wed Sep 29, 2004 4:53 pm

The only thing that I noticed and dont like with the current version (0.8.4) is that pye -p doesn't work and if you try pye prune, it lists the dups (much like it works now)

According to the help pye outputs pye -p or pye --prune should list all of the packages installed on your system giving you an opportunity to remove packages in the same numbering fashion.

It has worked like that in the past but the current script doesn't do that.
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Sun Oct 03, 2004 9:09 pm

Version 0.8.4.1 is up

Two bugfixes:

- pye --prune now works (I hope :-) )
- the script now creates a default ~/.pye directory and pye.conf and pye.mask files if they do not exist
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
Chickpea
l33t
l33t
Posts: 846
Joined: Mon Jun 03, 2002 3:09 am
Location: Vancouver WA

  • Quote

Post by Chickpea » Thu Oct 07, 2004 9:07 pm

dr_strange wrote:Version 0.8.4.1 is up

Two bugfixes:

- pye --prune now works (I hope :-) )
- the script now creates a default ~/.pye directory and pye.conf and pye.mask files if they do not exist
Just wanted to say that the bug fixes worked. I dont get the previous errors I received when running the script...especially the --prune option.

Great work!
Top
hepta_sean
Apprentice
Apprentice
User avatar
Posts: 246
Joined: Tue Apr 27, 2004 9:45 pm
Location: Berlin, Germany

  • Quote

Post by hepta_sean » Tue Nov 09, 2004 11:29 pm

dr_strange wrote:Version 0.8.4.1 is up
I already posted some problems a few months ago. They are still there with this version:

1.) You only record category and package, but not the version in the merge list. Therefore, you can only emerge the latest (unmasked) version with pye, not any previous version (this also happens in world updates, when an old slot is to be updated):

Code: Select all

sean@lois ~/bin $ pye-0.8.4.1 =gtk+-1.2.10-r11
One moment...

These are the packages that I would merge, in order:

Calculating dependencies  ...done!
0): [ebuild   R   ] x11-libs/gtk+-1.2.10-r11

You can now enter the numbers of packages you want to emerge/unmerge/exclude.
...
Enter your choices now: a

I'm about to emerge the following packages: x11-libs/gtk+
Is this correct? Choose an option: e(merge)/n(o)/q(uit): q

sean@lois ~/bin $ emerge -p x11-libs/gtk+

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] x11-libs/gtk+-2.4.13
2.) mergethis() gives false positives on remerges, because it only checks, if the latest version is installed:

Code: Select all

sean@lois ~/bin $ pye-0.8.4.1 gtk+
One moment...

These are the packages that I would merge, in order:

Calculating dependencies  ...done!
0): [ebuild   R   ] x11-libs/gtk+-2.4.13

You can now enter the numbers of packages you want to emerge/unmerge/exclude.
...
Enter your choices now: a

I'm about to emerge the following packages: x11-libs/gtk+
Is this correct? Choose an option: e(merge)/n(o)/q(uit): e

emerge: root access required.
This is digest of pye on Wed, 10 Nov 2004 00:05:47:

x11-libs/gtk+: Merged in 0.02 minutes
Check /var/log/emerge for details. Exiting.
3.) pye does not work with binary packages:

Code: Select all

sean@lois ~/bin $ pye-0.8.4.1 -e k gtk+
One moment...

These are the packages that I would merge, in order:

Calculating dependencies  ...done!
[binary   R   ] x11-libs/gtk+-2.4.13

No packages to emerge.
4.) Since you call emerge directly with each package, pye enters every package into the world file. Over time the world file will contain every single package of the system. Please use "--oneshot".

5.) With the changed way of giving options to emerge, I cannot give long options anymore (some options like "--oneshot" or "--newuse" do not have short variants, so this would be necessary).

Would be nice, if you could consider these issues.
Top
dr_strange
Guru
Guru
User avatar
Posts: 480
Joined: Tue Apr 16, 2002 7:19 pm
Location: Cambridge, UK

  • Quote

Post by dr_strange » Fri Nov 19, 2004 9:01 am

Thank you all for the input and suggestions. My Gentoo PC is currently suffering from a serious malaise, but as soon as it gets repaired I will return to my script.
shine on,

dr_strange

Set the Controls for the Heart of Gentoo
http://magenta.linuxforum.hu
Top
theDreamer
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 118
Joined: Mon Oct 20, 2003 9:51 am
Contact:
Contact theDreamer
Website

world file

  • Quote

Post by theDreamer » Fri Dec 31, 2004 2:35 pm

pye is a very nice tool - good work.

though, i have one problem with it:

the usage of the tool is manually emerging parts of the world/system list (mostly).
When emerging using -D you fill the world file with system sub packages you dont want manually add but that should be dependent on other packages.

for example:
the output of pye world results in both evolution and evolution-data-server.
when using pye without explicitly saying not emerging evolution-data-server (which is a sub-package of evolution) it will actually add it to the world file.
this is just a small example for expanding the world file to hold unnecessary packages.

This is standing against the logic of using the system dependencies and having minimal world file.
there's another nice tool that talks about what i've tried to explain:
http://forums.gentoo.org/viewtopic.php?t=142475

enough talking, i think that a small fix for this is required and also simple:
when emerging the packages you should add --oneshot.

what do you think?
Cheers,
Nir Dremer
www.dremer.org
Top
Post Reply

133 posts
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next

Return to “Unsupported Software”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy