Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 37344 Details for
Bug 60215
Installed ebuild query program
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Installed ebuild queryprogram.
see-instebuild (text/plain), 4.28 KB, created by
andutt
on 2004-08-13 04:52:25 UTC
(
hide
)
Description:
Installed ebuild queryprogram.
Filename:
MIME Type:
Creator:
andutt
Created:
2004-08-13 04:52:25 UTC
Size:
4.28 KB
patch
obsolete
>#!/usr/bin/perl -w ># ># Creator: Andreas Utterberg 2004 ># ># Licence:Freeware, add,modify,change,delete or remove code in this program as you like. ># ># Version-parameter shows the actual program version for the moment. >our $version="Version 1.0"; > ># Unchangeble parameters, leave thoose as they are. >our $chooise=0; >our $showgroups; >our $showebuilds; >our $installedgroup; >our $distfiles; >our $installedebuild; >our $delimiter; >our $custname; >our $oneline; >our @ARGV; >use strict; >use warnings; ># ># ># SUBFUNCTIONS AND PARAMETERS PARSING ># ># >for(@ARGV) { > if (/-g/) { > $showgroups=1; > $chooise=1; > } > if (/-p/) { > $showebuilds=1; > $chooise=1; > } > if(/-nv/) { > $custname=1; > $chooise=1; > } > if (/-df/) { > $distfiles=1; > $chooise=1; > } > if(/-oneline/) { > $oneline=1; > } > if(/-delimiter=/) { > my @tmpdelimiter=split("=", "$_"); > $delimiter=$tmpdelimiter[1]; > } >} >sub showgroup() { >our @data=`ls /var/db/pkg/`; >chop @data; > > for(@data) { > $installedgroup=$_; > if($delimiter) { > print "$delimiter$installedgroup \n"; > } else { > print "Group:$installedgroup \n"; > } > } > > > ># End subfunction >} >sub show_version() { >my $ebuild=$_[0]; >my @tmpversion=split("-",$ebuild); >my @version; >my $version; > > for(@tmpversion) { > if(/[1-9]/) { > push(@version,$_); > } > } > $version=join(" ",@version); > print "$version\n"; > > ># End of subfunction >} >sub show_name() { >my $ebuild=$_[0]; >my @tmpname=split("-",$ebuild); >my @name; >my $name; > > for(@tmpname) { > if(/[1-9]/) { > next; > } else { > push(@name,$_); > } > } > $name=join(" ",@name); > print "$name "; > ># End of subfunction >} >sub show_ebuilds() { >our @data=`ls /var/db/pkg/`; >chop @data; > > for(@data) { > $installedgroup=$_; > our @ebuilds=`ls /var/db/pkg/$installedgroup`; > chop @ebuilds; > > for(@ebuilds) { > $installedebuild=$_; > > if ($oneline && $showgroups) { > if($delimiter) { > if($custname) { > print "$installedgroup"; > print "$delimiter"; > &show_name($installedebuild); > print "$delimiter"; > &show_version($installedebuild); > } else { > print "$installedgroup$delimiter$installedebuild\n"; > } > } else { > if($custname) { > print "Group:$installedgroup Ebuild:"; > &show_name($installedebuild); > print " Version:"; > &show_version($installedebuild); > } else { > print "Group:$installedgroup Ebuild:$installedebuild\n"; > } > } > } else { > if($delimiter) { > if($custname) { > &show_name($installedebuild); > print "$delimiter"; > &show_version($installedebuild); > } else { > print "$delimiter$installedebuild\n"; > } > } else { > if($custname) { > &show_name($installedebuild); > &show_version($installedebuild); > } else { > print "Ebuild:$installedebuild\n"; > } > } > } > } > } > ># End of subfunction >} >sub program_info() { >print "\n"; >print "* $0 $version\n"; >print "\n"; >print "* This program is used for querys against the installed Gentoo ebuilds.\n"; >print "* It can be good to use for input to other programs or just to gather information\n"; >print "* on the commandline. Probably this will be included and supported in the main\n"; >print "* administraton program emerge in the future.\n"; >print "\n"; >print " -g \t:Shows installed ebuild groups\n"; >print " -p \t:Shows installed ebuild packages\n"; >print " -nv \t:Show name and version included but separated\n"; >print " -oneline \t:Shows the information on one line per hit.\n"; >print " -delimiter= \t:Here you can specifiy your own delimiter that shall divide the information. Can be good in batchmode\n"; >print "\n"; >print "Examples:\n"; >print "\n"; >print "$0 -g -p \t:Shows installed ebuild groups and packages\n"; >print "$0 -g -p -oneline \t:Shows installed ebuild groups and packages on one line per hit\n"; >print "$0 -g -p -oneline -delimiter=# \t:Shows installed ebuild groups and packages on one line per hit, divided by #\n"; >print "$0 -g -p -oneline -delimiter=# -nv\t:Shows installed groups and ebuilds,versions on one line per hit, divided by #\n"; >print "\n"; >exit 1; ># End of subfunction >} ># ># ># PROGRAM START ># ># >if(!$chooise) { > &program_info(); >} >if($showgroups) { > if(!$oneline) { > &showgroup(); > } >} >if($showebuilds) { > &show_ebuilds(); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 60215
: 37344