From 1626259059a7b2da817fe6a32126c2eddd14406c Mon Sep 17 00:00:00 2001 From: Alexander Bersenev Date: Sun, 21 Aug 2011 15:59:46 +0000 Subject: documentation changes and args parsing fixed --- docs/build/doctrees/api.doctree | Bin 46746 -> 48389 bytes docs/build/doctrees/environment.pickle | Bin 971797 -> 971863 bytes docs/build/doctrees/intro.doctree | Bin 28313 -> 28343 bytes docs/build/doctrees/man.doctree | Bin 26064 -> 26037 bytes docs/build/html/_modules/index.html | 2 +- docs/build/html/_modules/logfs/fstracer.html | 2 +- .../_modules/package_utils/portage_log_parser.html | 2 +- .../package_utils/portage_misc_functions.html | 2 +- .../html/_modules/package_utils/portage_utils.html | 2 +- docs/build/html/_sources/intro.txt | 64 +++++++++----------- docs/build/html/_sources/man.txt | 2 +- docs/build/html/api.html | 11 +++- docs/build/html/genindex.html | 34 ++++------- docs/build/html/index.html | 2 +- docs/build/html/intro.html | 65 ++++++++++----------- docs/build/html/man.html | 4 +- docs/build/html/objects.inv | Bin 501 -> 507 bytes docs/build/html/py-modindex.html | 2 +- docs/build/html/search.html | 2 +- docs/build/html/searchindex.js | 2 +- docs/build/man/autodep.1 | 4 +- docs/source/intro.rst | 64 +++++++++----------- docs/source/man.rst | 2 +- src/autodep/autodep | 20 +++++-- 24 files changed, 139 insertions(+), 149 deletions(-) diff --git a/docs/build/doctrees/api.doctree b/docs/build/doctrees/api.doctree index 4821784..d8ae4bd 100644 Binary files a/docs/build/doctrees/api.doctree and b/docs/build/doctrees/api.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 8d02379..2a03b39 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/intro.doctree b/docs/build/doctrees/intro.doctree index 314b99e..e92be8f 100644 Binary files a/docs/build/doctrees/intro.doctree and b/docs/build/doctrees/intro.doctree differ diff --git a/docs/build/doctrees/man.doctree b/docs/build/doctrees/man.doctree index da00d7c..aea8941 100644 Binary files a/docs/build/doctrees/man.doctree and b/docs/build/doctrees/man.doctree differ diff --git a/docs/build/html/_modules/index.html b/docs/build/html/_modules/index.html index 8141709..4c87b23 100644 --- a/docs/build/html/_modules/index.html +++ b/docs/build/html/_modules/index.html @@ -86,7 +86,7 @@ diff --git a/docs/build/html/_modules/logfs/fstracer.html b/docs/build/html/_modules/logfs/fstracer.html index 83a2ef6..2958336 100644 --- a/docs/build/html/_modules/logfs/fstracer.html +++ b/docs/build/html/_modules/logfs/fstracer.html @@ -327,7 +327,7 @@ diff --git a/docs/build/html/_modules/package_utils/portage_log_parser.html b/docs/build/html/_modules/package_utils/portage_log_parser.html index 2c9e94b..3167f47 100644 --- a/docs/build/html/_modules/package_utils/portage_log_parser.html +++ b/docs/build/html/_modules/package_utils/portage_log_parser.html @@ -170,7 +170,7 @@ diff --git a/docs/build/html/_modules/package_utils/portage_misc_functions.html b/docs/build/html/_modules/package_utils/portage_misc_functions.html index 13fddfe..105dcaf 100644 --- a/docs/build/html/_modules/package_utils/portage_misc_functions.html +++ b/docs/build/html/_modules/package_utils/portage_misc_functions.html @@ -188,7 +188,7 @@ diff --git a/docs/build/html/_modules/package_utils/portage_utils.html b/docs/build/html/_modules/package_utils/portage_utils.html index b0e63db..62a8b06 100644 --- a/docs/build/html/_modules/package_utils/portage_utils.html +++ b/docs/build/html/_modules/package_utils/portage_utils.html @@ -158,7 +158,7 @@ diff --git a/docs/build/html/_sources/intro.txt b/docs/build/html/_sources/intro.txt index 82278ac..400a668 100644 --- a/docs/build/html/_sources/intro.txt +++ b/docs/build/html/_sources/intro.txt @@ -4,11 +4,10 @@ Introduction Overview =================================== -Auto dependency builder is a tool for analysis files accessed during -building a package. It also can be used for buildtime and runtime dependency -analysis. +Auto dependency (autodep) builder is a tool for the analysis of accessed files during +the build of a package. It also can be used for runtime dependencies analysis. -The tool can block an access to files of defined packages. +The tool can trace, log and block access to files of given packages. It is released under GNU GPL license. @@ -32,35 +31,31 @@ Running .. cmdoption:: --help, -h - show this help message and exit + Show this help message and exit. .. cmdoption:: -b, --block - strict mode: deny all access to non-dependency packages + strict mode: Deny all access to files from non-dependency packages. .. cmdoption:: --blockpkgs=PACKAGES - block an access to files from this packages + Block access to files from this packages. -.. cmdoption:: -f , --files +.. cmdoption:: -f, --files - show accessed files and not founded files + Show all files, accessed and missing (not found). +.. cmdoption:: -v, --verbose -.. cmdoption:: -v , --verbose - - show non-important packages, show unknown package and unknown stage - -.. cmdoption:: -C , --nocolor - - don't output color + Show non-important packages, unknown packages and unknown building stages. +.. cmdoption:: --nocolor, -C + Don't colorize output .. cmdoption:: --hooklib - use ld_preload logging approach(default) - + Use LD_PRELOAD logging approach (default). .. cmdoption:: --fusefs - use fuse logging approach(slow, but reliable) + Use FUSE logging approach (slow, but reliable). Example: showfsevents.py -b lsof,cowsay emerge bash @@ -68,56 +63,55 @@ Hooklib vs Fusefs =================================== +------------------------------------------------+-------------+---------------+ -| | Hooklib | Fusefs | +| | Hooklib | FuseFS | +================================================+=============+===============+ | Who can use this approach? | **Any user**| Only root | +------------------------------------------------+-------------+---------------+ -| Is approach allows blocking an access to files?| **YES** | **YES** | +| Does approach allows to block access to files? | **YES** | **YES** | +------------------------------------------------+-------------+---------------+ -| Is overhead in performance big? | **NO** | YES [#f1]_ | +| Is the overhead in performance noticeable? | **NO** | YES [#f1]_ | +------------------------------------------------+-------------+---------------+ | What events are logged? | Most [#f2]_| **ALL** | +------------------------------------------------+-------------+---------------+ -| When is it recomended to use an approach? | For analysis| For analysis | +| When is it recomended to use an approach? | Analysis | Analysis | | | of | of *runtime* | | | *buildtime* | dependencies | | | dependencies| | +------------------------------------------------+-------------+---------------+ -| Is any pre-requirements for using an approach? | **NO** | FUSE must be | -| | | enabled in | +| Are there any pre-requirements | **NO** | FUSE must be | +| for using an approach? | | enabled in | | | | kernel | +------------------------------------------------+-------------+---------------+ .. rubric:: Notes -.. [#f1] Fuse file system is slower than normal one. Program reads many files +.. [#f1] FUSE filesystems are slower than a normal one. A Program accesses many files while launching, so this will take more time than usual. -.. [#f2] Loading of dynamic libraries and direct syscalls will not be logged. +.. [#f2] Loading of Dynamic libraries and direct syscalls will not be logged. Examples =================================== -.. rubric:: 1. Get the potential dependencies of a xchat package: +.. rubric:: 1. Get the potential dependencies for net-irc/xchat: .. code-block:: none - autodep emerge xchat + autodep emerge net-irc/xchat -.. rubric:: 2. Get the potential dependencies of a xchat package, blocking +.. rubric:: 2. Get the potential dependencies for net-irc/xchat, blocking x11-misc/util-macros package: .. code-block:: none - autodep emerge --block x11-misc/util-macros emerge xchat + autodep emerge --blockpkgs x11-misc/util-macros emerge net-irc/xchat -.. rubric:: 3. Get the potential dependencies of a xchat package, and show files +.. rubric:: 3. Get the potential dependencies for net-irc/xchat, and show files accessed: .. code-block:: none - autodep --files emerge xchat + autodep --files emerge net-irc/xchat -.. rubric:: 4. Get the runtime dependencies of a xchat and show files - accessed: +.. rubric:: 4. Get the runtime dependencies of a xchat and show accessed files: .. code-block:: none diff --git a/docs/build/html/_sources/man.txt b/docs/build/html/_sources/man.txt index bf5ad86..fa97db6 100644 --- a/docs/build/html/_sources/man.txt +++ b/docs/build/html/_sources/man.txt @@ -87,7 +87,7 @@ autodep emerge net-irc/xchat Get the potential dependencies for net-irc/xchat, blocking files from x11-misc/util-macros package: --------------------------------------------------------------------------------------------------- -autodep emerge --block x11-misc/util-macros emerge net-irc/xchat +autodep emerge --blockpkgs x11-misc/util-macros emerge net-irc/xchat Get the potential dependencies for net-irc/xchat package, and show accessed files: ---------------------------------------------------------------------------------- diff --git a/docs/build/html/api.html b/docs/build/html/api.html index e485aa5..aa34b41 100644 --- a/docs/build/html/api.html +++ b/docs/build/html/api.html @@ -56,7 +56,7 @@ handling dependency logic.

It can be used to launch a program and get all file events

-logfs.fstracer.getfsevents(prog_name, arguments, approach='hooklib', filterproc=<function defaultfilter at 0x1dcb938>)[source]
+logfs.fstracer.getfsevents(prog_name, arguments, approach='hooklib', filterproc=<function defaultfilter at 0x1b129b0>)[source]

Launches a program and gets file access events

@@ -220,6 +220,13 @@ All dependencies must be installed

+
+
+get_deps_for_package_building(pkg)
+

returns buildtime dependencies of current package and +all runtime dependencies of that buildtime dependencies

+
+
get_merge_list(emergeargs)
@@ -329,7 +336,7 @@ list) diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index 1889b59..d845fc3 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -68,35 +68,23 @@
autodep command line option, [1]
+
+
--nocolor, -C
-
autodep command line option
+
autodep command line option, [1]
-b, --block
autodep command line option, [1]
-
-
-
-C , --nocolor
-
-
autodep command line option
-
-
-f , --files
-
-
autodep command line option
-
-f, --files
-
autodep command line option
-
-
-v , --verbose
-
-
autodep command line option
+
autodep command line option, [1]
-v, --verbose
-
autodep command line option
+
autodep command line option, [1]
@@ -110,13 +98,10 @@
--fusefs, [1]
--help, -h, [1]
--hooklib, [1]
-
--nocolor, -C
-
-C , --nocolor
+
--nocolor, -C, [1]
-b, --block, [1]
-
-f , --files
-
-f, --files
-
-v , --verbose
-
-v, --verbose
+
-f, --files, [1]
+
-v, --verbose, [1]
@@ -128,6 +113,7 @@
get_best_visible_pkg() (package_utils.portage_misc_functions.portage_api method)
get_dep() (package_utils.portage_misc_functions.portage_api method)
get_deps() (package_utils.portage_misc_functions.portage_api method)
+
get_deps_for_package_building() (package_utils.portage_misc_functions.portage_api method)
get_list_of_merged_packages() (in module package_utils.portage_log_parser)
@@ -200,7 +186,7 @@ diff --git a/docs/build/html/index.html b/docs/build/html/index.html index 85fe72a..2a05a75 100644 --- a/docs/build/html/index.html +++ b/docs/build/html/index.html @@ -136,7 +136,7 @@ diff --git a/docs/build/html/intro.html b/docs/build/html/intro.html index 18e7294..9c2790b 100644 --- a/docs/build/html/intro.html +++ b/docs/build/html/intro.html @@ -55,10 +55,9 @@

Introduction

Overview

-

Auto dependency builder is a tool for analysis files accessed during -building a package. It also can be used for buildtime and runtime dependency -analysis.

-

The tool can block an access to files of defined packages.

+

Auto dependency (autodep) builder is a tool for the analysis of accessed files during +the build of a package. It also can be used for runtime dependencies analysis.

+

The tool can trace, log and block access to files of given packages.

It is released under GNU GPL license.

@@ -80,49 +79,49 @@ analysis.

--help, -h
-

show this help message and exit

+

Show this help message and exit.

-b, --block
-

strict mode: deny all access to non-dependency packages

+

strict mode: Deny all access to files from non-dependency packages.

--blockpkgs=PACKAGES
-

block an access to files from this packages

+

Block access to files from this packages.

--f , --files
-

show accessed files and not founded files

+-f, --files +

Show all files, accessed and missing (not found).

--v , --verbose
-

show non-important packages, show unknown package and unknown stage

+-v, --verbose +

Show non-important packages, unknown packages and unknown building stages.

-
--C , --nocolor
-

don’t output color

+
+--nocolor, -C
+

Don’t colorize output

--hooklib
-

use ld_preload logging approach(default)

+

Use LD_PRELOAD logging approach (default).

--fusefs
-

use fuse logging approach(slow, but reliable)

+

Use FUSE logging approach (slow, but reliable).

Example: showfsevents.py -b lsof,cowsay emerge bash

@@ -138,7 +137,7 @@ analysis.

  Hooklib -Fusefs +FuseFS @@ -146,11 +145,11 @@ analysis.

Any user Only root -Is approach allows blocking an access to files? +Does approach allows to block access to files? YES YES -Is overhead in performance big? +Is the overhead in performance noticeable? NO YES [1] @@ -159,15 +158,16 @@ analysis.

ALL When is it recomended to use an approach? -For analysis +Analysis of buildtime dependencies -For analysis +Analysis of runtime dependencies -Is any pre-requirements for using an approach? +Are there any pre-requirements +for using an approach? NO FUSE must be enabled in @@ -179,35 +179,34 @@ kernel -
[1]Fuse file system is slower than normal one. Program reads many files +
[1]FUSE filesystems are slower than a normal one. A Program accesses many files while launching, so this will take more time than usual.
- +
[2]Loading of dynamic libraries and direct syscalls will not be logged.
[2]Loading of Dynamic libraries and direct syscalls will not be logged.

Examples

-

1. Get the potential dependencies of a xchat package:

-
autodep emerge xchat
+

1. Get the potential dependencies for net-irc/xchat:

+
autodep emerge net-irc/xchat
 
-

2. Get the potential dependencies of a xchat package, blocking +

2. Get the potential dependencies for net-irc/xchat, blocking x11-misc/util-macros package:

-
autodep emerge --block x11-misc/util-macros emerge xchat
+
autodep emerge --blockpkgs x11-misc/util-macros emerge net-irc/xchat
 
-

3. Get the potential dependencies of a xchat package, and show files +

3. Get the potential dependencies for net-irc/xchat, and show files accessed:

-
autodep --files emerge xchat
+
autodep --files emerge net-irc/xchat
 
-

4. Get the runtime dependencies of a xchat and show files -accessed:

+

4. Get the runtime dependencies of a xchat and show accessed files:

autodep --fusefs --files xchat
 
@@ -290,7 +289,7 @@ accessed:

diff --git a/docs/build/html/man.html b/docs/build/html/man.html index 2560335..50f5051 100644 --- a/docs/build/html/man.html +++ b/docs/build/html/man.html @@ -178,7 +178,7 @@ while launching, so this will take more time than usual.

Get the potential dependencies for net-irc/xchat, blocking files from x11-misc/util-macros package:

-

autodep emerge –block x11-misc/util-macros emerge net-irc/xchat

+

autodep emerge –blockpkgs x11-misc/util-macros emerge net-irc/xchat

Get the potential dependencies for net-irc/xchat package, and show accessed files:

@@ -251,7 +251,7 @@ while launching, so this will take more time than usual.
diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index a96802c..1f36ab3 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/py-modindex.html b/docs/build/html/py-modindex.html index e6d78e4..a63c982 100644 --- a/docs/build/html/py-modindex.html +++ b/docs/build/html/py-modindex.html @@ -132,7 +132,7 @@
diff --git a/docs/build/html/search.html b/docs/build/html/search.html index 5ecd73c..980d989 100644 --- a/docs/build/html/search.html +++ b/docs/build/html/search.html @@ -96,7 +96,7 @@
diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index a593094..28db011 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{"":{"-v":[4,0,1],"-f":[4,0,1],"-C":[2,0,1],"-b":[4,0,1],"--hooklib":[4,0,1],"--fusefs":[4,0,1],"--blockpkgs":[4,0,1],"--nocolor":[4,0,1],"--help":[4,0,1]},"logfs.fstracer":{getfsevents:[1,3,1]},"package_utils.portage_log_parser":{get_list_of_merged_packages:[1,3,1]},logfs:{fstracer:[1,1,1]},"package_utils.portage_utils":{getfilesbypackage:[1,3,1],getpackagesbyfiles:[1,3,1],get_all_packages_files:[1,3,1]},"package_utils.portage_misc_functions":{portage_api:[1,4,1]},"package_utils.portage_misc_functions.portage_api":{get_dep:[1,2,1],get_system_packages_list:[1,2,1],get_best_visible_pkg:[1,2,1],get_deps:[1,2,1],get_merge_list:[1,2,1],parse_emerge_args:[1,2,1]},package_utils:{portage_misc_functions:[1,1,1],portage_utils:[1,1,1],portage_log_parser:[1,1,1]}},terms:{all:[1,2,3,4],code:[],chain:1,queri:3,mnt:3,follow:3,prog_nam:1,showfsev:2,depend:[1,2,3,4],send:3,ebuild:2,program:[1,2,3,4],under:[2,3],sourc:1,string:1,fals:1,util:[2,3,4],candid:1,veri:1,hooker:[],tri:3,level:1,list:[1,3],mount:3,defaultfilt:1,slower:[2,4],direct:[2,4],second:1,cost:3,pass:1,further:3,index:2,what:[2,4],compar:3,access:[0,1,2,3,4],version:1,"new":3,net:4,intercept:3,modifi:3,sinc:[1,3],search:[1,2],action:1,chang:3,via:3,packagenam:1,modul:[1,2,3],filenam:1,unix:3,api:[0,1],heurist:3,instal:[0,1,2,3],get_dep:1,from:[1,2,3,4],would:3,memori:1,regist:3,two:1,call:[1,3],usr:3,type:[1,3],more:[2,4],ld_preload:[2,3,4],notic:4,endtim:1,getfilesbypackag:1,must:[1,2,4],lib32:3,err:3,package_util:[0,1],prepar:3,registar:3,dev:3,can:[1,2,3,4],"0x1dbdb90":[],root:[2,4],process:3,registr:[],share:3,indic:[0,2],high:1,unreli:1,portage_log_pars:1,chroot:3,end:[1,3],anoth:3,write:[1,3],how:[0,3],answer:3,instead:[1,3],simpl:3,map:3,alwai:1,after:3,befor:3,blockpkg:[2,4],mai:1,man:3,syscal:[2,4],bind:3,element:1,inform:1,environ:3,allow:[1,2,3,4],rdepend:1,origin:3,help:[2,4],over:3,rootf:3,dynam:[2,3,4],paramet:1,get_best_visible_pkg:1,cowsai:2,main:3,them:3,"return":[1,3],thei:1,handl:1,auto:[2,4],"0x19e7b18":[],introduct:[0,2],name:[1,3],"0x1dcb938":1,mode:[2,4],each:1,found:[1,2,3,4],domain:3,idea:3,logf:[0,1],connect:3,todo:2,event:[0,1,2,3,4],variabl:3,network:3,miss:4,content:0,got:3,lib64:3,insid:3,believ:3,dictionari:1,ask:3,bash:[1,2],thread:3,launch:[1,2,3,4],get_list_of_merged_packag:1,filter:1,registrar:3,getfsev:1,first:1,oper:1,misc:[2,4],hook:3,open:[1,3],gpl:2,given:4,start:1,unknown:[1,2,3,4],licens:2,system:[1,2,3],messag:[2,3,4],scheme:3,low:1,option:[1,2,4],tool:[2,4],copi:3,postrm:3,pars:1,than:[2,4],portage_util:1,get_merge_list:1,charact:3,bridg:1,pre:[2,4],"function":[1,3],linker:3,argument:1,raw:1,tabl:[0,2],packag:[1,2,3,4],accuraci:3,note:[2,3,4],also:[1,2,3,4],build:[2,3,4],which:1,jail:3,analysi:[0,2,3,4],loggabl:3,trace:4,normal:[2,4],who:[2,4],most:[2,4],buildtim:[2,4],hooklib:[0,1,2,3,4],phase:3,"class":1,don:[2,4],portage_misc_funct:1,doe:[0,3,4],deni:[2,3,4],runtim:[2,3,4],hungri:1,show:[2,4],verbos:[2,4],pkg:1,permiss:3,find:1,xml:3,current:1,onli:[2,4],slow:[2,4],activ:2,dep_typ:1,should:1,parse_emerge_arg:1,analys:3,unus:3,variou:1,get:[1,2,4],increas:3,requir:[2,4],enabl:[2,4],"default":[1,2,4],contain:1,userspac:3,shm:3,respond:3,kernel:[2,4],set:1,packet:3,see:3,sec:3,result:3,arg:1,fail:1,best:1,statu:[0,2],behind:3,between:1,"import":[2,4],irc:4,approach:[0,1,2,3,4],kei:1,get_all_packages_fil:1,xchat:[2,4],both:1,protect:3,delimit:3,logic:1,futher:[0,3],mani:[2,4],lsof:2,load:[2,3,4],color:[2,4],overview:[0,2],linux:3,reciev:3,fusef:[0,1,2,3,4],empti:1,implicit:[1,3],much:[],recomend:[2,4],fstracer:[0,1],ani:[1,2,3,4],look:1,stagenam:3,gnu:2,servic:1,defin:2,"while":[2,3,4],behavior:3,error:3,non:[2,4],sock_seqpacket:3,synopsi:4,develop:2,perform:[2,3,4],make:2,belong:1,same:3,read:[1,2,3],document:0,fuse:[2,3,4],user:[2,4],extern:3,portag:[1,3],macro:[2,4],builder:[2,4],exampl:[0,1,2,4],command:[2,4],thi:[1,2,3,4],filesystem:[3,4],usual:[2,3,4],execut:3,cut:3,"0x1b2bc80":[],desktop:3,els:[],take:[1,2,3,4],filterproc:1,format:3,libc:3,big:2,recurs:1,success:1,nocolor:[2,4],output:[2,4],page:2,often:3,intern:[0,1,3],successfulli:1,librari:[2,3,4],tmp:3,autodep:[0,2,4],exit:[2,4],overlai:2,proc:3,previou:3,run:[0,2,3],step:3,starttim:1,x11:[2,4],portage_api:1,stage:[1,2,3,4],about:3,socket:3,block:[1,2,3,4],merg:1,log:[1,2,4],wai:3,errno:3,strict:[2,4],includ:3,lot:3,"var":3,overhead:[2,4],fork:3,unexpect:3,tupl:1,atom:1,"true":1,whether:3,otherwis:3,creat:3,dure:[2,4],parser:1,doesn:1,file:[0,1,2,3,4],work:[0,1,3],check:3,emergearg:1,acloc:3,when:[2,3,4],detail:3,field:3,other:3,getpackagesbyfil:1,get_system_packages_list:1,releas:2,directori:3,reliabl:[2,4],descript:4,rule:3,depth:1,emerg:[1,2,4],potenti:[2,4],time:[1,2,3,4],profil:3},objtypes:{"0":"std:option","1":"py:module","2":"py:method","3":"py:function","4":"py:class"},titles:["Autodep’s documentation","API","Introduction","Internals","USER COMMANDS"],objnames:{"0":"option","1":"Python module","2":"Python method","3":"Python function","4":"Python class"},filenames:["index","api","intro","architecture","man"]}) \ No newline at end of file +Search.setIndex({objects:{"":{"-v":[4,0,1],"-f":[4,0,1],"-b":[4,0,1],"--hooklib":[4,0,1],"--fusefs":[4,0,1],"--blockpkgs":[4,0,1],"--nocolor":[4,0,1],"--help":[4,0,1]},"package_utils.portage_misc_functions":{portage_api:[1,4,1]},"package_utils.portage_log_parser":{get_list_of_merged_packages:[1,3,1]},logfs:{fstracer:[1,1,1]},"package_utils.portage_utils":{getfilesbypackage:[1,3,1],getpackagesbyfiles:[1,3,1],get_all_packages_files:[1,3,1]},"logfs.fstracer":{getfsevents:[1,3,1]},"package_utils.portage_misc_functions.portage_api":{get_dep:[1,2,1],get_system_packages_list:[1,2,1],get_best_visible_pkg:[1,2,1],get_deps:[1,2,1],get_merge_list:[1,2,1],get_deps_for_package_building:[1,2,1],parse_emerge_args:[1,2,1]},package_utils:{portage_misc_functions:[1,1,1],portage_utils:[1,1,1],portage_log_parser:[1,1,1]}},terms:{all:[1,2,3,4],code:[],chain:1,queri:3,mnt:3,follow:3,prog_nam:1,showfsev:2,depend:[1,2,3,4],send:3,ebuild:2,program:[1,2,3,4],under:[2,3],sourc:1,string:1,fals:1,util:[2,3,4],candid:1,veri:1,lib64:3,tri:3,level:1,list:[1,3],mount:3,defaultfilt:1,slower:[2,4],direct:[2,4],second:1,cost:3,pass:1,further:3,index:2,what:[2,4],compar:3,access:[0,1,2,3,4],version:1,"new":3,net:[2,4],"0x1b129b0":1,intercept:3,modifi:3,sinc:[1,3],search:[1,2],action:1,chang:3,via:3,packagenam:1,modul:[1,2,3],filenam:1,unix:3,api:[0,1],heurist:3,instal:[0,1,2,3],get_dep:1,from:[1,2,3,4],would:3,memori:1,regist:3,two:1,call:[1,3],usr:3,type:[1,3],more:[2,4],ld_preload:[2,3,4],notic:[2,4],endtim:1,getfilesbypackag:1,must:[1,2,4],lib32:3,err:3,package_util:[0,1],prepar:3,launch:[1,2,3,4],dev:3,can:[1,2,3,4],"0x1dbdb90":[],root:[2,4],process:3,registr:[],share:3,indic:[0,2],high:1,unreli:1,filter:1,chroot:3,end:[1,3],anoth:3,write:[1,3],how:[0,3],answer:3,instead:[1,3],simpl:3,map:3,alwai:1,after:3,befor:3,blockpkg:[2,4],mai:1,man:3,syscal:[2,4],bind:3,element:1,inform:1,jail:3,allow:[1,2,3,4],rdepend:1,origin:3,help:[2,4],over:3,rootf:3,dynam:[2,3,4],paramet:1,get_best_visible_pkg:1,cowsai:2,main:3,them:3,"return":[1,3],thei:1,handl:1,auto:[2,4],"0x19e7b18":[],introduct:[0,2],name:[1,3],"0x1dcb938":[],mode:[2,4],each:1,found:[1,2,3,4],domain:3,idea:3,logf:[0,1],connect:3,todo:2,event:[0,1,2,3,4],variabl:3,network:3,miss:[2,4],content:0,got:3,hooker:[],insid:3,believ:3,dictionari:1,ask:3,bash:[1,2],thread:3,registar:3,get_list_of_merged_packag:1,portage_log_pars:1,registrar:3,getfsev:1,first:1,oper:1,misc:[2,4],hook:3,open:[1,3],gpl:2,given:[2,4],strict:[2,4],unknown:[1,2,3,4],licens:2,system:[1,3],messag:[2,3,4],scheme:3,low:1,option:[1,2,4],tool:[2,4],copi:3,postrm:3,pars:1,portag:[1,3],than:[2,4],portage_util:1,get_merge_list:1,charact:3,bridg:1,pre:[2,4],"function":[1,3],linker:3,argument:1,raw:1,tabl:[0,2],packag:[1,2,3,4],accuraci:3,note:[2,3,4],also:[1,2,3,4],build:[2,3,4],which:1,environ:3,analysi:[0,2,3,4],loggabl:3,trace:[2,4],normal:[2,4],previou:3,most:[2,4],buildtim:[1,2,4],hooklib:[0,1,2,3,4],phase:3,"class":1,don:[2,4],portage_misc_funct:1,doe:[0,2,3,4],deni:[2,3,4],runtim:[1,2,3,4],hungri:1,show:[2,4],verbos:[2,4],pkg:1,permiss:3,find:1,xml:3,current:1,onli:[2,4],slow:[2,4],activ:2,dep_typ:1,should:1,parse_emerge_arg:1,analys:3,unus:3,variou:1,get:[1,2,4],increas:3,requir:[2,4],enabl:[2,4],whether:3,contain:1,userspac:3,shm:3,respond:3,kernel:[2,4],set:1,packet:3,see:3,sec:3,result:3,arg:1,fail:1,best:1,statu:[0,2],behind:3,between:1,"import":[2,4],irc:[2,4],approach:[0,1,2,3,4],kei:1,get_all_packages_fil:1,xchat:[2,4],both:1,protect:3,delimit:3,logic:1,futher:[0,3],mani:[2,4],lsof:2,load:[2,3,4],color:[2,4],overview:[0,2],linux:3,reciev:3,fusef:[0,1,2,3,4],empti:1,implicit:[1,3],much:[],recomend:[2,4],fstracer:[0,1],ani:[1,2,3,4],look:1,stagenam:3,gnu:2,servic:1,defin:[],"while":[2,3,4],behavior:3,error:3,non:[2,4],sock_seqpacket:3,synopsi:4,develop:2,perform:[2,3,4],make:2,belong:1,same:3,read:[1,3],document:0,fuse:[2,3,4],user:[2,4],extern:3,get_deps_for_package_build:1,macro:[2,4],builder:[2,4],exampl:[0,1,2,4],command:[2,4],thi:[1,2,3,4],filesystem:[2,3,4],usual:[2,3,4],execut:3,cut:3,"0x1b2bc80":[],desktop:3,els:[],take:[1,2,3,4],filterproc:1,format:3,libc:3,big:[],recurs:1,success:1,nocolor:[2,4],output:[2,4],page:2,often:3,intern:[0,1,3],successfulli:1,librari:[2,3,4],tmp:3,autodep:[0,2,4],exit:[2,4],overlai:2,proc:3,who:[2,4],run:[0,2,3],step:3,starttim:1,x11:[2,4],portage_api:1,stage:[1,2,3,4],about:3,socket:3,block:[1,2,3,4],merg:1,log:[1,2,4],wai:3,errno:3,start:1,includ:3,lot:3,"var":3,overhead:[2,4],fork:3,unexpect:3,tupl:1,atom:1,"true":1,"default":[1,2,4],otherwis:3,creat:3,dure:[2,4],parser:1,doesn:1,file:[0,1,2,3,4],work:[0,1,3],check:3,emergearg:1,acloc:3,when:[2,3,4],detail:3,field:3,other:3,getpackagesbyfil:1,get_system_packages_list:1,releas:2,directori:3,reliabl:[2,4],descript:4,rule:3,depth:1,emerg:[1,2,4],potenti:[2,4],time:[1,2,3,4],profil:3},objtypes:{"0":"std:option","1":"py:module","2":"py:method","3":"py:function","4":"py:class"},titles:["Autodep’s documentation","API","Introduction","Internals","USER COMMANDS"],objnames:{"0":"option","1":"Python module","2":"Python method","3":"Python function","4":"Python class"},filenames:["index","api","intro","architecture","man"]}) \ No newline at end of file diff --git a/docs/build/man/autodep.1 b/docs/build/man/autodep.1 index 202dd11..78df98a 100644 --- a/docs/build/man/autodep.1 +++ b/docs/build/man/autodep.1 @@ -1,4 +1,4 @@ -.TH "AUTODEP" "1" "August 20, 2011" "0.1" "Autodep" +.TH "AUTODEP" "1" "August 21, 2011" "0.1" "Autodep" .SH NAME autodep \- auto dependency builder for Gentoo . @@ -161,7 +161,7 @@ Loading of Dynamic libraries and direct syscalls will not be logged. autodep emerge net\-irc/xchat .SS Get the potential dependencies for net\-irc/xchat, blocking files from x11\-misc/util\-macros package: .sp -autodep emerge \-\-block x11\-misc/util\-macros emerge net\-irc/xchat +autodep emerge \-\-blockpkgs x11\-misc/util\-macros emerge net\-irc/xchat .SS Get the potential dependencies for net\-irc/xchat package, and show accessed files: .sp autodep \-\-files emerge net\-irc/xchat diff --git a/docs/source/intro.rst b/docs/source/intro.rst index 82278ac..400a668 100644 --- a/docs/source/intro.rst +++ b/docs/source/intro.rst @@ -4,11 +4,10 @@ Introduction Overview =================================== -Auto dependency builder is a tool for analysis files accessed during -building a package. It also can be used for buildtime and runtime dependency -analysis. +Auto dependency (autodep) builder is a tool for the analysis of accessed files during +the build of a package. It also can be used for runtime dependencies analysis. -The tool can block an access to files of defined packages. +The tool can trace, log and block access to files of given packages. It is released under GNU GPL license. @@ -32,35 +31,31 @@ Running .. cmdoption:: --help, -h - show this help message and exit + Show this help message and exit. .. cmdoption:: -b, --block - strict mode: deny all access to non-dependency packages + strict mode: Deny all access to files from non-dependency packages. .. cmdoption:: --blockpkgs=PACKAGES - block an access to files from this packages + Block access to files from this packages. -.. cmdoption:: -f , --files +.. cmdoption:: -f, --files - show accessed files and not founded files + Show all files, accessed and missing (not found). +.. cmdoption:: -v, --verbose -.. cmdoption:: -v , --verbose - - show non-important packages, show unknown package and unknown stage - -.. cmdoption:: -C , --nocolor - - don't output color + Show non-important packages, unknown packages and unknown building stages. +.. cmdoption:: --nocolor, -C + Don't colorize output .. cmdoption:: --hooklib - use ld_preload logging approach(default) - + Use LD_PRELOAD logging approach (default). .. cmdoption:: --fusefs - use fuse logging approach(slow, but reliable) + Use FUSE logging approach (slow, but reliable). Example: showfsevents.py -b lsof,cowsay emerge bash @@ -68,56 +63,55 @@ Hooklib vs Fusefs =================================== +------------------------------------------------+-------------+---------------+ -| | Hooklib | Fusefs | +| | Hooklib | FuseFS | +================================================+=============+===============+ | Who can use this approach? | **Any user**| Only root | +------------------------------------------------+-------------+---------------+ -| Is approach allows blocking an access to files?| **YES** | **YES** | +| Does approach allows to block access to files? | **YES** | **YES** | +------------------------------------------------+-------------+---------------+ -| Is overhead in performance big? | **NO** | YES [#f1]_ | +| Is the overhead in performance noticeable? | **NO** | YES [#f1]_ | +------------------------------------------------+-------------+---------------+ | What events are logged? | Most [#f2]_| **ALL** | +------------------------------------------------+-------------+---------------+ -| When is it recomended to use an approach? | For analysis| For analysis | +| When is it recomended to use an approach? | Analysis | Analysis | | | of | of *runtime* | | | *buildtime* | dependencies | | | dependencies| | +------------------------------------------------+-------------+---------------+ -| Is any pre-requirements for using an approach? | **NO** | FUSE must be | -| | | enabled in | +| Are there any pre-requirements | **NO** | FUSE must be | +| for using an approach? | | enabled in | | | | kernel | +------------------------------------------------+-------------+---------------+ .. rubric:: Notes -.. [#f1] Fuse file system is slower than normal one. Program reads many files +.. [#f1] FUSE filesystems are slower than a normal one. A Program accesses many files while launching, so this will take more time than usual. -.. [#f2] Loading of dynamic libraries and direct syscalls will not be logged. +.. [#f2] Loading of Dynamic libraries and direct syscalls will not be logged. Examples =================================== -.. rubric:: 1. Get the potential dependencies of a xchat package: +.. rubric:: 1. Get the potential dependencies for net-irc/xchat: .. code-block:: none - autodep emerge xchat + autodep emerge net-irc/xchat -.. rubric:: 2. Get the potential dependencies of a xchat package, blocking +.. rubric:: 2. Get the potential dependencies for net-irc/xchat, blocking x11-misc/util-macros package: .. code-block:: none - autodep emerge --block x11-misc/util-macros emerge xchat + autodep emerge --blockpkgs x11-misc/util-macros emerge net-irc/xchat -.. rubric:: 3. Get the potential dependencies of a xchat package, and show files +.. rubric:: 3. Get the potential dependencies for net-irc/xchat, and show files accessed: .. code-block:: none - autodep --files emerge xchat + autodep --files emerge net-irc/xchat -.. rubric:: 4. Get the runtime dependencies of a xchat and show files - accessed: +.. rubric:: 4. Get the runtime dependencies of a xchat and show accessed files: .. code-block:: none diff --git a/docs/source/man.rst b/docs/source/man.rst index bf5ad86..fa97db6 100644 --- a/docs/source/man.rst +++ b/docs/source/man.rst @@ -87,7 +87,7 @@ autodep emerge net-irc/xchat Get the potential dependencies for net-irc/xchat, blocking files from x11-misc/util-macros package: --------------------------------------------------------------------------------------------------- -autodep emerge --block x11-misc/util-macros emerge net-irc/xchat +autodep emerge --blockpkgs x11-misc/util-macros emerge net-irc/xchat Get the potential dependencies for net-irc/xchat package, and show accessed files: ---------------------------------------------------------------------------------- diff --git a/src/autodep/autodep b/src/autodep/autodep index 034c47a..d607ed6 100755 --- a/src/autodep/autodep +++ b/src/autodep/autodep @@ -28,7 +28,7 @@ def parse_args(): args_parser.add_option("-v","--verbose", action="store_true", dest="verbose", default=False, help="Show non-important packages, " "unknown package and unknown stage") - args_parser.add_option("-n","--numfiles",action="store", type="string", + args_parser.add_option("-n","--numfiles",action="store", type="int", dest="numfiles", default=10, help="Maximum number of files from each package to show (default is 10)") @@ -160,7 +160,7 @@ def get_filter_function(options,args,system_packages,portage_api): depslist=list(portage_api.get_deps_for_package_building(pkg)) allowedpkgs+=depslist # manually add all python interpreters to this list - allowedpkgs+=["python"] + allowedpkgs+=["dev-lang/python"] else: program_path=runtime_vars["full_path"] file_to_package=portage_utils.getpackagesbyfiles([program_path]) @@ -172,7 +172,7 @@ def get_filter_function(options,args,system_packages,portage_api): portage_api.get_deps(file_to_package[program_path],["RDEPEND"])) allowedpkgs+=depslist - print allowedpkgs + #print allowedpkgs # remember the allowedpkgs in deps_all. It is bad to do it here. runtime_vars["deps_all"]=allowedpkgs @@ -217,7 +217,17 @@ if runtime_vars["is_emerge"]: portage_api.get_dep(pkg,["DEPEND"])) runtime_vars["deps_portage"]=portage_api.get_dep('portage',["RDEPEND"]) - +else: + if runtime_vars["deps_all"]==[]: + # we mostly repeating block logic here + program_path=runtime_vars["full_path"] + file_to_package=portage_utils.getpackagesbyfiles([program_path]) + if program_path not in file_to_package: + print "Failed to find a package for %s" % program_path + else: + depslist=[file_to_package[program_path]]+list( + portage_api.get_deps(file_to_package[program_path],["RDEPEND"])) + runtime_vars["deps_all"]=depslist #pkgs=portage_log_parser.get_list_of_merged_packages( # runtime_vars["starttime"],runtime_vars["endtime"] @@ -379,7 +389,7 @@ for package in sorted(packagesinfo): if options.show_files: continue elif filescounter>options.numfiles: - print " ... and %d more ...\n" % (len(filenames)-10) + print " ... and %d more ...\n" % (len(filenames)-options.numfiles) break # print not founded files with stages -- cgit v1.2.3-65-gdbad