From: Michael Schroeder Date: Wed, 5 Jun 2013 16:44:30 +0000 (+0200) Subject: adapt to modern perl and use barewords for hash keys X-Git-Tag: upstream/0.4.0~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65fc23b007331aa3c2634c549b70ac2ba2cdb4da;p=platform%2Fupstream%2Flibsolv.git adapt to modern perl and use barewords for hash keys --- diff --git a/doc/filters/xcode.pl b/doc/filters/xcode.pl index ab17c7f..420db75 100755 --- a/doc/filters/xcode.pl +++ b/doc/filters/xcode.pl @@ -36,6 +36,8 @@ while() { $_ = " $_"; $_ = "$_ "; s/(?<=[^a-zA-Z_\&:\.\'\";])(?!solv\W|Solv\W|Pool\W)([\$\@[a-zA-Z_][a-zA-Z0-9_]*)(?=[^a-zA-Z0-9_\(;\[])(?!::)(?! [^=])/<-S>$1<-I>/g; + # small fixup for perl bare words + s/{<-S>([a-zA-Z_][a-zA-Z0-9]*)<-I>}/{$1}/g; # small fixup for callbackfunctions s/\\(&[a-zA-Z_]+)/\\<-S>$1<-I>/; # small fixup for stringification diff --git a/doc/libsolv-bindings.3 b/doc/libsolv-bindings.3 index cac2a7f..9e0fea1 100644 --- a/doc/libsolv-bindings.3 +++ b/doc/libsolv-bindings.3 @@ -2,12 +2,12 @@ .\" Title: libsolv-bindings .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 06/04/2013 +.\" Date: 06/05/2013 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-BINDINGS" "3" "06/04/2013" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-BINDINGS" "3" "06/05/2013" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -58,7 +58,7 @@ Create a new pool instance\&. In most cases you just need one pool\&. .\} .nf \fBvoid *appdata;\fR /* read/write */ -\fI$pool\fR\fB\->{\*(Aqappdata\*(Aq}\fR +\fI$pool\fR\fB\->{appdata}\fR \fIpool\fR\fB\&.appdata\fR \fIpool\fR\fB\&.appdata\fR .fi @@ -73,7 +73,7 @@ Application specific data that may be used in any way by the code using the pool .\} .nf \fBSolvable solvables[];\fR /* read only */ -my \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->{\*(Aqsolvables\*(Aq}\->[\fR\fI$solvid\fR\fB]\fR; +my \fI$solvable\fR \fB=\fR \fI$pool\fR\fB\->{solvables}\->[\fR\fI$solvid\fR\fB]\fR; \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR \fIsolvable\fR \fB=\fR \fIpool\fR\fB\&.solvables[\fR\fIsolvid\fR\fB]\fR .fi @@ -88,7 +88,7 @@ Look up a Solvable by its id\&. .\} .nf \fBRepo repos[];\fR /* read only */ -my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->{\*(Aqrepos\*(Aq}\->[\fR\fI$repoid\fR\fB]\fR; +my \fI$repo\fR \fB=\fR \fI$pool\fR\fB\->{repos}\->[\fR\fI$repoid\fR\fB]\fR; \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR \fIrepo\fR \fB=\fR \fIpool\fR\fB\&.repos[\fR\fIrepoid\fR\fB]\fR .fi @@ -103,7 +103,7 @@ Look up a Repository by its id\&. .\} .nf \fBRepo *installed;\fR /* read/write */ -\fI$pool\fR\fB\->{\*(Aqinstalled\*(Aq} =\fR \fI$repo\fR; +\fI$pool\fR\fB\->{installed} =\fR \fI$repo\fR; \fIpool\fR\fB\&.installed =\fR \fIrepo\fR \fIpool\fR\fB\&.installed =\fR \fIrepo\fR .fi @@ -815,7 +815,7 @@ The dependency class is an object orientated way to work with strings and depend .\} .nf \fBPool *pool;\fR /* read only */ -\fI$dep\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$dep\fR\fB\->{pool}\fR \fIdep\fR\fB\&.pool\fR \fIdep\fR\fB\&.pool\fR .fi @@ -830,7 +830,7 @@ Back reference to the pool this dependency belongs to\&. .\} .nf \fBId id;\fR /* read only */ -\fI$dep\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$dep\fR\fB\->{id}\fR \fIdep\fR\fB\&.id\fR \fIdep\fR\fB\&.id\fR .fi @@ -906,7 +906,7 @@ Return a string describing the dependency\&. .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$dep\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$dep\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fIdep\fR\fB)\fR \fIstr\fR \fB=\fR \fIdep\fR\fB\&.to_s\fR .fi @@ -940,7 +940,7 @@ A Repository describes a group of packages, normally comming from the same sourc .\} .nf \fBPool *pool;\fR /* read only */ -\fI$repo\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$repo\fR\fB\->{pool}\fR \fIrepo\fR\fB\&.pool\fR \fIrepo\fR\fB\&.pool\fR .fi @@ -955,7 +955,7 @@ Back reference to the pool this dependency belongs to\&. .\} .nf \fBId id;\fR /* read only */ -\fI$repo\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$repo\fR\fB\->{id}\fR \fIrepo\fR\fB\&.id\fR \fIrepo\fR\fB\&.id\fR .fi @@ -970,7 +970,7 @@ The id of the repository\&. .\} .nf \fBconst char *name;\fR /* read/write */ -\fI$repo\fR\fB\->{\*(Aqname\*(Aq}\fR +\fI$repo\fR\fB\->{name}\fR \fIrepo\fR\fB\&.name\fR \fIrepo\fR\fB\&.name\fR .fi @@ -985,7 +985,7 @@ The repositories name\&. To libsolv, the name is just a string with no specific .\} .nf \fBint prioprity;\fR /* read/write */ -\fI$repo\fR\fB\->{\*(Aqpriority\*(Aq}\fR +\fI$repo\fR\fB\->{priority}\fR \fIrepo\fR\fB\&.priority\fR \fIrepo\fR\fB\&.priority\fR .fi @@ -1000,7 +1000,7 @@ The priority of the repository\&. A higher number means that packages of this re .\} .nf \fBint subprioprity;\fR /* read/write */ -\fI$repo\fR\fB\->{\*(Aqsubpriority\*(Aq}\fR +\fI$repo\fR\fB\->{subpriority}\fR \fIrepo\fR\fB\&.subpriority\fR \fIrepo\fR\fB\&.subpriority\fR .fi @@ -1015,7 +1015,7 @@ The sub\-priority of the repository\&. This value is compared when the prioritie .\} .nf \fBint nsolvables;\fR /* read only */ -\fI$repo\fR\fB\->{\*(Aqnsolvables\*(Aq}\fR +\fI$repo\fR\fB\->{nsolvables}\fR \fIrepo\fR\fB\&.nsolvables\fR \fIrepo\fR\fB\&.nsolvables\fR .fi @@ -1030,7 +1030,7 @@ The number of solvables in this repository\&. .\} .nf \fBvoid *appdata;\fR /* read/write */ -\fI$repo\fR\fB\->{\*(Aqappdata\*(Aq}\fR +\fI$repo\fR\fB\->{appdata}\fR \fIrepo\fR\fB\&.appdata\fR \fIrepo\fR\fB\&.appdata\fR .fi @@ -1045,7 +1045,7 @@ Application specific data that may be used in any way by the code using the repo .\} .nf \fBDatapos *meta;\fR /* read only */ -\fI$repo\fR\fB\->{\*(Aqmeta\*(Aq}\fR +\fI$repo\fR\fB\->{meta}\fR \fIrepo\fR\fB\&.meta\fR \fIrepo\fR\fB\&.meta\fR .fi @@ -1299,7 +1299,7 @@ Iterate over the matching data elements in this repository\&. See the Dataiterat .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$repo\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$repo\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fIrepo\fR\fB)\fR \fIstr\fR \fB=\fR \fIrepo\fR\fB\&.to_s\fR .fi @@ -1660,7 +1660,7 @@ A solvable describes all the information of one package\&. Each solvable belongs .\} .nf \fBRepo *repo;\fR /* read only */ -\fI$solvable\fR\fB\->{\*(Aqrepo\*(Aq}\fR +\fI$solvable\fR\fB\->{repo}\fR \fIsolvable\fR\fB\&.repo\fR \fIsolvable\fR\fB\&.repo\fR .fi @@ -1675,7 +1675,7 @@ The repository this solvable belongs to\&. .\} .nf \fBPool *pool;\fR /* read only */ -\fI$solvable\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$solvable\fR\fB\->{pool}\fR \fIsolvable\fR\fB\&.pool\fR \fIsolvable\fR\fB\&.pool\fR .fi @@ -1690,7 +1690,7 @@ The pool this solvable belongs to, same as the pool of the repo\&. .\} .nf \fBId id;\fR /* read only */ -\fI$solvable\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$solvable\fR\fB\->{id}\fR \fIsolvable\fR\fB\&.id\fR \fIsolvable\fR\fB\&.id\fR .fi @@ -1705,7 +1705,7 @@ The specific id of the solvable\&. .\} .nf \fBchar *name;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqname\*(Aq}\fR +\fI$solvable\fR\fB\->{name}\fR \fIsolvable\fR\fB\&.name\fR \fIsolvable\fR\fB\&.name\fR .fi @@ -1718,7 +1718,7 @@ The specific id of the solvable\&. .\} .nf \fBchar *evr;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqevr\*(Aq}\fR +\fI$solvable\fR\fB\->{evr}\fR \fIsolvable\fR\fB\&.evr\fR \fIsolvable\fR\fB\&.evr\fR .fi @@ -1731,7 +1731,7 @@ The specific id of the solvable\&. .\} .nf \fBchar *arch;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqarch\*(Aq}\fR +\fI$solvable\fR\fB\->{arch}\fR \fIsolvable\fR\fB\&.arch\fR \fIsolvable\fR\fB\&.arch\fR .fi @@ -1744,7 +1744,7 @@ The specific id of the solvable\&. .\} .nf \fBchar *vendor;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqvendor\*(Aq}\fR +\fI$solvable\fR\fB\->{vendor}\fR \fIsolvable\fR\fB\&.vendor\fR \fIsolvable\fR\fB\&.vendor\fR .fi @@ -1759,7 +1759,7 @@ Easy access to often used attributes of solvables\&. They are internally stored .\} .nf \fBId nameid;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqnameid\*(Aq}\fR +\fI$solvable\fR\fB\->{nameid}\fR \fIsolvable\fR\fB\&.nameid\fR \fIsolvable\fR\fB\&.nameid\fR .fi @@ -1772,7 +1772,7 @@ Easy access to often used attributes of solvables\&. They are internally stored .\} .nf \fBId evrid;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqevrid\*(Aq}\fR +\fI$solvable\fR\fB\->{evrid}\fR \fIsolvable\fR\fB\&.evrid\fR \fIsolvable\fR\fB\&.evrid\fR .fi @@ -1785,7 +1785,7 @@ Easy access to often used attributes of solvables\&. They are internally stored .\} .nf \fBId archid;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqarchid\*(Aq}\fR +\fI$solvable\fR\fB\->{archid}\fR \fIsolvable\fR\fB\&.archid\fR \fIsolvable\fR\fB\&.archid\fR .fi @@ -1798,7 +1798,7 @@ Easy access to often used attributes of solvables\&. They are internally stored .\} .nf \fBId vendorid;\fR /* read/write */ -\fI$solvable\fR\fB\->{\*(Aqvendorid\*(Aq}\fR +\fI$solvable\fR\fB\->{vendorid}\fR \fIsolvable\fR\fB\&.vendorid\fR \fIsolvable\fR\fB\&.vendorid\fR .fi @@ -1997,7 +1997,7 @@ Return a string describing the solvable\&. The string consists of the name, vers .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$solvable\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$solvable\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fIsolvable\fR\fB)\fR \fIstr\fR \fB=\fR \fIsolvable\fR\fB\&.to_s\fR .fi @@ -2131,7 +2131,7 @@ Objects of this type will be created for every value matched by a dataiterator\& .\} .nf \fBPool *pool;\fR /* read only */ -\fI$d\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$d\fR\fB\->{pool}\fR \fId\fR\fB\&.pool\fR \fId\fR\fB\&.pool\fR .fi @@ -2146,7 +2146,7 @@ Back pointer to pool\&. .\} .nf \fBRepo *repo;\fR /* read only */ -\fI$d\fR\fB\->{\*(Aqrepo\*(Aq}\fR +\fI$d\fR\fB\->{repo}\fR \fId\fR\fB\&.repo\fR \fId\fR\fB\&.repo\fR .fi @@ -2161,7 +2161,7 @@ The repository containing the matched object\&. .\} .nf \fBSolvable *solvable;\fR /* read only */ -\fI$d\fR\fB\->{\*(Aqsolvable\*(Aq}\fR +\fI$d\fR\fB\->{solvable}\fR \fId\fR\fB\&.solvable\fR \fId\fR\fB\&.solvable\fR .fi @@ -2176,7 +2176,7 @@ The solvable containing the value that was matched\&. .\} .nf \fBId solvid;\fR /* read only */ -\fI$d\fR\fB\->{\*(Aqsolvid\*(Aq}\fR +\fI$d\fR\fB\->{solvid}\fR \fId\fR\fB\&.solvid\fR \fId\fR\fB\&.solvid\fR .fi @@ -2351,7 +2351,7 @@ The position object of the array containing the current match\&. It can be used .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$d\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$d\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fId\fR\fB)\fR \fIstr\fR \fB=\fR \fId\fR\fB\&.to_s\fR .fi @@ -2431,7 +2431,7 @@ Return only one selection element describing the selected packages\&. The defaul .\} .nf \fBPool *pool;\fR /* read only */ -\fI$d\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$d\fR\fB\->{pool}\fR \fId\fR\fB\&.pool\fR \fId\fR\fB\&.pool\fR .fi @@ -2552,7 +2552,7 @@ Convert a selection into an array of Solvable objects\&. .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$sel\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$sel\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fIsel\fR\fB)\fR \fIstr\fR \fB=\fR \fIsel\fR\fB\&.to_s\fR .fi @@ -2742,7 +2742,7 @@ See the section about set bits for more information\&. .\} .nf \fBPool *pool;\fR /* read only */ -\fI$job\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$job\fR\fB\->{pool}\fR \fId\fR\fB\&.pool\fR \fId\fR\fB\&.pool\fR .fi @@ -2757,7 +2757,7 @@ Back pointer to pool\&. .\} .nf \fBId how;\fR /* read/write */ -\fI$job\fR\fB\->{\*(Aqhow\*(Aq}\fR +\fI$job\fR\fB\->{how}\fR \fId\fR\fB\&.how\fR \fId\fR\fB\&.how\fR .fi @@ -2772,7 +2772,7 @@ Union of the selection, action, action modifier, and set flags\&. The selection .\} .nf \fBId what;\fR /* read/write */ -\fI$job\fR\fB\->{\*(Aqwhat\*(Aq}\fR +\fI$job\fR\fB\->{what}\fR \fId\fR\fB\&.what\fR \fId\fR\fB\&.what\fR .fi @@ -2818,7 +2818,7 @@ Convenience function to find out if the job describes an update job with no matc .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$job\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$job\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fIjob\fR\fB)\fR \fIstr\fR \fB=\fR \fIjob\fR\fB\&.to_s\fR .fi @@ -3130,7 +3130,7 @@ The problem can be solved by allowing to replace the package with some other pac .\} .nf \fBPool *pool;\fR /* read only */ -\fI$job\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$job\fR\fB\->{pool}\fR \fId\fR\fB\&.pool\fR \fId\fR\fB\&.pool\fR .fi @@ -3208,7 +3208,7 @@ Problems are the way of the solver to interact with the user\&. You can simply l .\} .nf \fBSolver *solv;\fR /* read only */ -\fI$problem\fR\fB\->{\*(Aqsolv\*(Aq}\fR +\fI$problem\fR\fB\->{solv}\fR \fIproblem\fR\fB\&.solv\fR \fIproblem\fR\fB\&.solv\fR .fi @@ -3223,7 +3223,7 @@ Back pointer to solver object\&. .\} .nf \fBId id;\fR /* read only */ -\fI$problem\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$problem\fR\fB\->{id}\fR \fIproblem\fR\fB\&.id\fR \fIproblem\fR\fB\&.id\fR .fi @@ -3303,7 +3303,7 @@ Rules are the basic block of sat solving\&. Each package dependency gets transla .\} .nf \fBSolver *solv;\fR /* read only */ -\fI$rule\fR\fB\->{\*(Aqsolv\*(Aq}\fR +\fI$rule\fR\fB\->{solv}\fR \fIrule\fR\fB\&.solv\fR \fIrule\fR\fB\&.solv\fR .fi @@ -3318,7 +3318,7 @@ Back pointer to solver object\&. .\} .nf \fBId id;\fR /* read only */ -\fI$rule\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$rule\fR\fB\->{id}\fR \fIrule\fR\fB\&.id\fR \fIrule\fR\fB\&.id\fR .fi @@ -3333,7 +3333,7 @@ The id of the rule\&. .\} .nf \fBint type;\fR /* read only */ -\fI$rule\fR\fB\->{\*(Aqtype\*(Aq}\fR +\fI$rule\fR\fB\->{type}\fR \fIrule\fR\fB\&.type\fR \fIrule\fR\fB\&.type\fR .fi @@ -3398,7 +3398,7 @@ A Ruleinfo describes one reason why a rule was created\&. .\} .nf \fBSolver *solv;\fR /* read only */ -\fI$ruleinfo\fR\fB\->{\*(Aqsolv\*(Aq}\fR +\fI$ruleinfo\fR\fB\->{solv}\fR \fIruleinfo\fR\fB\&.solv\fR \fIruleinfo\fR\fB\&.solv\fR .fi @@ -3413,7 +3413,7 @@ Back pointer to solver object\&. .\} .nf \fBint type;\fR /* read only */ -\fI$ruleinfo\fR\fB\->{\*(Aqtype\*(Aq}\fR +\fI$ruleinfo\fR\fB\->{type}\fR \fIruleinfo\fR\fB\&.type\fR \fIruleinfo\fR\fB\&.type\fR .fi @@ -3428,7 +3428,7 @@ The type of the ruleinfo\&. See the constant section of the solver class for the .\} .nf \fBDep *dep;\fR /* read only */ -\fI$ruleinfo\fR\fB\->{\*(Aqdep\*(Aq}\fR +\fI$ruleinfo\fR\fB\->{dep}\fR \fIruleinfo\fR\fB\&.dep\fR \fIruleinfo\fR\fB\&.dep\fR .fi @@ -3458,7 +3458,7 @@ The Id of the dependency leading to the creation of the rule, or zero\&. .\} .nf \fBSolvable *solvable;\fR /* read only */ -\fI$ruleinfo\fR\fB\->{\*(Aqsolvable\*(Aq}\fR +\fI$ruleinfo\fR\fB\->{solvable}\fR \fIruleinfo\fR\fB\&.solvable\fR \fIruleinfo\fR\fB\&.solvable\fR .fi @@ -3473,7 +3473,7 @@ The involved Solvable, e\&.g\&. the one containing the dependency\&. .\} .nf \fBSolvable *othersolvable;\fR /* read only */ -\fI$ruleinfo\fR\fB\->{\*(Aqothersolvable\*(Aq}\fR +\fI$ruleinfo\fR\fB\->{othersolvable}\fR \fIruleinfo\fR\fB\&.othersolvable\fR \fIruleinfo\fR\fB\&.othersolvable\fR .fi @@ -3507,7 +3507,7 @@ A solution solves one specific problem\&. It consists of multiple solution eleme .\} .nf \fBSolver *solv;\fR /* read only */ -\fI$solution\fR\fB\->{\*(Aqsolv\*(Aq}\fR +\fI$solution\fR\fB\->{solv}\fR \fIsolution\fR\fB\&.solv\fR \fIsolution\fR\fB\&.solv\fR .fi @@ -3522,7 +3522,7 @@ Back pointer to solver object\&. .\} .nf \fBId problemid;\fR /* read only */ -\fI$solution\fR\fB\->{\*(Aqproblemid\*(Aq}\fR +\fI$solution\fR\fB\->{problemid}\fR \fIsolution\fR\fB\&.problemid\fR \fIsolution\fR\fB\&.problemid\fR .fi @@ -3537,7 +3537,7 @@ Id of the problem the solution solves\&. .\} .nf \fBId id;\fR /* read only */ -\fI$solution\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$solution\fR\fB\->{id}\fR \fIsolution\fR\fB\&.id\fR \fIsolution\fR\fB\&.id\fR .fi @@ -3587,7 +3587,7 @@ A solution element describes a single action of a solution\&. The action is alwa .\} .nf \fBSolver *solv;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqsolv\*(Aq}\fR +\fI$solutionelement\fR\fB\->{solv}\fR \fIsolutionelement\fR\fB\&.solv\fR \fIsolutionelement\fR\fB\&.solv\fR .fi @@ -3602,7 +3602,7 @@ Back pointer to solver object\&. .\} .nf \fBId problemid;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqproblemid\*(Aq}\fR +\fI$solutionelement\fR\fB\->{problemid}\fR \fIsolutionelement\fR\fB\&.problemid\fR \fIsolutionelement\fR\fB\&.problemid\fR .fi @@ -3617,7 +3617,7 @@ Id of the problem the element (partly) solves\&. .\} .nf \fBId solutionid;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqsolutionid\*(Aq}\fR +\fI$solutionelement\fR\fB\->{solutionid}\fR \fIsolutionelement\fR\fB\&.solutionid\fR \fIsolutionelement\fR\fB\&.solutionid\fR .fi @@ -3632,7 +3632,7 @@ Id of the solution the element is a part of\&. .\} .nf \fBId id;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$solutionelement\fR\fB\->{id}\fR \fIsolutionelement\fR\fB\&.id\fR \fIsolutionelement\fR\fB\&.id\fR .fi @@ -3647,7 +3647,7 @@ Id of the solution element\&. The first element has Id 1, they are numbered cons .\} .nf \fBId type;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqtype\*(Aq}\fR +\fI$solutionelement\fR\fB\->{type}\fR \fIsolutionelement\fR\fB\&.type\fR \fIsolutionelement\fR\fB\&.type\fR .fi @@ -3662,7 +3662,7 @@ Type of the solution element\&. See the constant section of the solver class for .\} .nf \fBSolvable *solvable;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqsolvable\*(Aq}\fR +\fI$solutionelement\fR\fB\->{solvable}\fR \fIsolutionelement\fR\fB\&.solvable\fR \fIsolutionelement\fR\fB\&.solvable\fR .fi @@ -3677,7 +3677,7 @@ The installed solvable that needs to be replaced for replacement elements\&. .\} .nf \fBSolvable *replacement;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqreplacement\*(Aq}\fR +\fI$solutionelement\fR\fB\->{replacement}\fR \fIsolutionelement\fR\fB\&.replacement\fR \fIsolutionelement\fR\fB\&.replacement\fR .fi @@ -3692,7 +3692,7 @@ The solvable that needs to be installed to fix the problem\&. .\} .nf \fBint jobidx;\fR /* read only */ -\fI$solutionelement\fR\fB\->{\*(Aqjobidx\*(Aq}\fR +\fI$solutionelement\fR\fB\->{jobidx}\fR \fIsolutionelement\fR\fB\&.jobidx\fR \fIsolutionelement\fR\fB\&.jobidx\fR .fi @@ -3918,7 +3918,7 @@ Do not throw away the dependency graph used for ordering the transaction\&. This .\} .nf \fBPool *pool;\fR /* read only */ -\fI$trans\fR\fB\->{\*(Aqpool\*(Aq}\fR +\fI$trans\fR\fB\->{pool}\fR \fItrans\fR\fB\&.pool\fR \fItrans\fR\fB\&.pool\fR .fi @@ -4121,7 +4121,7 @@ Objects of this type are returned by the classify() Transaction method\&. .\} .nf \fBTransaction *transaction;\fR /* read only */ -\fI$class\fR\fB\->{\*(Aqtransaction\*(Aq}\fR +\fI$class\fR\fB\->{transaction}\fR \fIclass\fR\fB\&.transaction\fR \fIclass\fR\fB\&.transaction\fR .fi @@ -4136,7 +4136,7 @@ Back pointer to transaction object\&. .\} .nf \fBint type;\fR /* read only */ -\fI$class\fR\fB\->{\*(Aqtype\*(Aq}\fR +\fI$class\fR\fB\->{type}\fR \fIclass\fR\fB\&.type\fR \fIclass\fR\fB\&.type\fR .fi @@ -4151,7 +4151,7 @@ The type of the transaction elements in the class\&. .\} .nf \fBint count;\fR /* read only */ -\fI$class\fR\fB\->{\*(Aqcount\*(Aq}\fR +\fI$class\fR\fB\->{count}\fR \fIclass\fR\fB\&.count\fR \fIclass\fR\fB\&.count\fR .fi @@ -4166,7 +4166,7 @@ The number of elements in the class\&. .\} .nf \fBconst char *\fR\fIfromstr\fR; -\fI$class\fR\fB\->{\*(Aqfromstr\*(Aq}\fR +\fI$class\fR\fB\->{fromstr}\fR \fIclass\fR\fB\&.fromstr\fR \fIclass\fR\fB\&.fromstr\fR .fi @@ -4181,7 +4181,7 @@ The old vendor or architecture\&. .\} .nf \fBconst char *\fR\fItostr\fR; -\fI$class\fR\fB\->{\*(Aqtostr\*(Aq}\fR +\fI$class\fR\fB\->{tostr}\fR \fIclass\fR\fB\&.tostr\fR \fIclass\fR\fB\&.tostr\fR .fi @@ -4196,7 +4196,7 @@ The new vendor or architecture\&. .\} .nf \fBId\fR \fIfromid\fR; -\fI$class\fR\fB\->{\*(Aqfromid\*(Aq}\fR +\fI$class\fR\fB\->{fromid}\fR \fIclass\fR\fB\&.fromid\fR \fIclass\fR\fB\&.fromid\fR .fi @@ -4211,7 +4211,7 @@ The id of the old vendor or architecture\&. .\} .nf \fBId\fR \fItoid\fR; -\fI$class\fR\fB\->{\*(Aqtoid\*(Aq}\fR +\fI$class\fR\fB\->{toid}\fR \fIclass\fR\fB\&.toid\fR \fIclass\fR\fB\&.toid\fR .fi @@ -4291,7 +4291,7 @@ Create an already finalized checksum object\&. .\} .nf \fBId type;\fR /* read only */ -\fI$chksum\fR\fB\->{\*(Aqtype\*(Aq}\fR +\fI$chksum\fR\fB\->{type}\fR \fIchksum\fR\fB\&.type\fR \fIchksum\fR\fB\&.type\fR .fi @@ -4412,7 +4412,7 @@ Checksums are equal if they are of the same type and the finalized results are t .\} .nf \fB\fR -my \fI$str\fR \fB= "\fR\fI$chksum\fR\fB"\fR; +my \fI$str\fR \fB=\fR \fI$chksum\fR\fB\->str\fR; \fIstr\fR \fB= str(\fR\fIchksum\fR\fB)\fR \fIstr\fR \fB=\fR \fIchksum\fR\fB\&.to_s\fR .fi @@ -4525,7 +4525,7 @@ The Repodata stores attrinbutes for packages and the repository itself, each rep .\} .nf \fBRepo *repo;\fR /* read only */ -\fI$data\fR\fB\->{\*(Aqrepo\*(Aq}\fR +\fI$data\fR\fB\->{repo}\fR \fIdata\fR\fB\&.repo\fR \fIdata\fR\fB\&.repo\fR .fi @@ -4540,7 +4540,7 @@ Back pointer to repository object\&. .\} .nf \fBId id;\fR /* read only */ -\fI$data\fR\fB\->{\*(Aqid\*(Aq}\fR +\fI$data\fR\fB\->{id}\fR \fIdata\fR\fB\&.id\fR \fIdata\fR\fB\&.id\fR .fi @@ -4786,7 +4786,7 @@ Datapos objects describe a specific position in the repository data area\&. Thus .\} .nf \fBRepo *repo;\fR /* read only */ -\fI$data\fR\fB\->{\*(Aqrepo\*(Aq}\fR +\fI$data\fR\fB\->{repo}\fR \fIdata\fR\fB\&.repo\fR \fIdata\fR\fB\&.repo\fR .fi diff --git a/doc/libsolv-bindings.txt b/doc/libsolv-bindings.txt index fb44220..a5e0a23 100644 --- a/doc/libsolv-bindings.txt +++ b/doc/libsolv-bindings.txt @@ -31,7 +31,7 @@ one pool. === ATTRIBUTES === void *appdata; /* read/write */ - $pool->{'appdata'} + $pool->{appdata} pool.appdata pool.appdata @@ -39,21 +39,21 @@ Application specific data that may be used in any way by the code using the pool. Solvable solvables[]; /* read only */ - my $solvable = $pool->{'solvables'}->[$solvid]; + my $solvable = $pool->{solvables}->[$solvid]; solvable = pool.solvables[solvid] solvable = pool.solvables[solvid] Look up a Solvable by its id. Repo repos[]; /* read only */ - my $repo = $pool->{'repos'}->[$repoid]; + my $repo = $pool->{repos}->[$repoid]; repo = pool.repos[repoid] repo = pool.repos[repoid] Look up a Repository by its id. Repo *installed; /* read/write */ - $pool->{'installed'} = $repo; + $pool->{installed} = $repo; pool.installed = repo pool.installed = repo @@ -481,14 +481,14 @@ method. === ATTRIBUTES === Pool *pool; /* read only */ - $dep->{'pool'} + $dep->{pool} dep.pool dep.pool Back reference to the pool this dependency belongs to. Id id; /* read only */ - $dep->{'id'} + $dep->{id} dep.id dep.id @@ -551,21 +551,21 @@ source. Repositories are created by the Pool's add_repo() method. === ATTRIBUTES === Pool *pool; /* read only */ - $repo->{'pool'} + $repo->{pool} repo.pool repo.pool Back reference to the pool this dependency belongs to. Id id; /* read only */ - $repo->{'id'} + $repo->{id} repo.id repo.id The id of the repository. const char *name; /* read/write */ - $repo->{'name'} + $repo->{name} repo.name repo.name @@ -573,7 +573,7 @@ The repositories name. To libsolv, the name is just a string with no specific meaning. int prioprity; /* read/write */ - $repo->{'priority'} + $repo->{priority} repo.priority repo.priority @@ -582,7 +582,7 @@ repository will be chosen over other repositories, even if they have a greater package version. int subprioprity; /* read/write */ - $repo->{'subpriority'} + $repo->{subpriority} repo.subpriority repo.subpriority @@ -591,14 +591,14 @@ of two repositories are the same. It is useful to make the library prefer on-disk repositories to remote ones. int nsolvables; /* read only */ - $repo->{'nsolvables'} + $repo->{nsolvables} repo.nsolvables repo.nsolvables The number of solvables in this repository. void *appdata; /* read/write */ - $repo->{'appdata'} + $repo->{appdata} repo.appdata repo.appdata @@ -606,7 +606,7 @@ Application specific data that may be used in any way by the code using the repository. Datapos *meta; /* read only */ - $repo->{'meta'} + $repo->{meta} repo.meta repo.meta @@ -969,43 +969,43 @@ will get created by the repo_add methods. === ATTRIBUTES === Repo *repo; /* read only */ - $solvable->{'repo'} + $solvable->{repo} solvable.repo solvable.repo The repository this solvable belongs to. Pool *pool; /* read only */ - $solvable->{'pool'} + $solvable->{pool} solvable.pool solvable.pool The pool this solvable belongs to, same as the pool of the repo. Id id; /* read only */ - $solvable->{'id'} + $solvable->{id} solvable.id solvable.id The specific id of the solvable. char *name; /* read/write */ - $solvable->{'name'} + $solvable->{name} solvable.name solvable.name char *evr; /* read/write */ - $solvable->{'evr'} + $solvable->{evr} solvable.evr solvable.evr char *arch; /* read/write */ - $solvable->{'arch'} + $solvable->{arch} solvable.arch solvable.arch char *vendor; /* read/write */ - $solvable->{'vendor'} + $solvable->{vendor} solvable.vendor solvable.vendor @@ -1013,22 +1013,22 @@ Easy access to often used attributes of solvables. They are internally stored as Ids. Id nameid; /* read/write */ - $solvable->{'nameid'} + $solvable->{nameid} solvable.nameid solvable.nameid Id evrid; /* read/write */ - $solvable->{'evrid'} + $solvable->{evrid} solvable.evrid solvable.evrid Id archid; /* read/write */ - $solvable->{'archid'} + $solvable->{archid} solvable.archid solvable.archid Id vendorid; /* read/write */ - $solvable->{'vendorid'} + $solvable->{vendorid} solvable.vendorid solvable.vendorid @@ -1223,28 +1223,28 @@ by a dataiterator. === ATTRIBUTES === Pool *pool; /* read only */ - $d->{'pool'} + $d->{pool} d.pool d.pool Back pointer to pool. Repo *repo; /* read only */ - $d->{'repo'} + $d->{repo} d.repo d.repo The repository containing the matched object. Solvable *solvable; /* read only */ - $d->{'solvable'} + $d->{solvable} d.solvable d.solvable The solvable containing the value that was matched. Id solvid; /* read only */ - $d->{'solvid'} + $d->{solvid} d.solvid d.solvid @@ -1399,7 +1399,7 @@ is probably the select() method in the Pool class. === ATTRIBUTES === Pool *pool; /* read only */ - $d->{'pool'} + $d->{pool} d.pool d.pool @@ -1627,14 +1627,14 @@ See the section about set bits for more information. === ATTRIBUTES === Pool *pool; /* read only */ - $job->{'pool'} + $job->{pool} d.pool d.pool Back pointer to pool. Id how; /* read/write */ - $job->{'how'} + $job->{how} d.how d.how @@ -1642,7 +1642,7 @@ Union of the selection, action, action modifier, and set flags. The selection part describes the semantics of the ``what'' Id. Id what; /* read/write */ - $job->{'what'} + $job->{what} d.what d.what @@ -1982,7 +1982,7 @@ Solution element type constants === ATTRIBUTES === Pool *pool; /* read only */ - $job->{'pool'} + $job->{pool} d.pool d.pool @@ -2032,14 +2032,14 @@ the user and let him pick the ones he likes. === ATTRIBUTES === Solver *solv; /* read only */ - $problem->{'solv'} + $problem->{solv} problem.solv problem.solv Back pointer to solver object. Id id; /* read only */ - $problem->{'id'} + $problem->{id} problem.id problem.id @@ -2091,21 +2091,21 @@ into one or multiple rules. === ATTRIBUTES === Solver *solv; /* read only */ - $rule->{'solv'} + $rule->{solv} rule.solv rule.solv Back pointer to solver object. Id id; /* read only */ - $rule->{'id'} + $rule->{id} rule.id rule.id The id of the rule. int type; /* read only */ - $rule->{'type'} + $rule->{type} rule.type rule.type @@ -2145,14 +2145,14 @@ A Ruleinfo describes one reason why a rule was created. === ATTRIBUTES === Solver *solv; /* read only */ - $ruleinfo->{'solv'} + $ruleinfo->{solv} ruleinfo.solv ruleinfo.solv Back pointer to solver object. int type; /* read only */ - $ruleinfo->{'type'} + $ruleinfo->{type} ruleinfo.type ruleinfo.type @@ -2160,7 +2160,7 @@ The type of the ruleinfo. See the constant section of the solver class for the rule type list and the special type list. Dep *dep; /* read only */ - $ruleinfo->{'dep'} + $ruleinfo->{dep} ruleinfo.dep ruleinfo.dep @@ -2174,14 +2174,14 @@ The dependency leading to the creation of the rule. The Id of the dependency leading to the creation of the rule, or zero. Solvable *solvable; /* read only */ - $ruleinfo->{'solvable'} + $ruleinfo->{solvable} ruleinfo.solvable ruleinfo.solvable The involved Solvable, e.g. the one containing the dependency. Solvable *othersolvable; /* read only */ - $ruleinfo->{'othersolvable'} + $ruleinfo->{othersolvable} ruleinfo.othersolvable ruleinfo.othersolvable @@ -2205,21 +2205,21 @@ that all need to be executed. === ATTRIBUTES === Solver *solv; /* read only */ - $solution->{'solv'} + $solution->{solv} solution.solv solution.solv Back pointer to solver object. Id problemid; /* read only */ - $solution->{'problemid'} + $solution->{problemid} solution.problemid solution.problemid Id of the problem the solution solves. Id id; /* read only */ - $solution->{'id'} + $solution->{id} solution.id solution.id @@ -2257,35 +2257,35 @@ a single specific package. === ATTRIBUTES === Solver *solv; /* read only */ - $solutionelement->{'solv'} + $solutionelement->{solv} solutionelement.solv solutionelement.solv Back pointer to solver object. Id problemid; /* read only */ - $solutionelement->{'problemid'} + $solutionelement->{problemid} solutionelement.problemid solutionelement.problemid Id of the problem the element (partly) solves. Id solutionid; /* read only */ - $solutionelement->{'solutionid'} + $solutionelement->{solutionid} solutionelement.solutionid solutionelement.solutionid Id of the solution the element is a part of. Id id; /* read only */ - $solutionelement->{'id'} + $solutionelement->{id} solutionelement.id solutionelement.id Id of the solution element. The first element has Id 1, they are numbered consecutively. Id type; /* read only */ - $solutionelement->{'type'} + $solutionelement->{type} solutionelement.type solutionelement.type @@ -2293,21 +2293,21 @@ Type of the solution element. See the constant section of the solver class for t existing types. Solvable *solvable; /* read only */ - $solutionelement->{'solvable'} + $solutionelement->{solvable} solutionelement.solvable solutionelement.solvable The installed solvable that needs to be replaced for replacement elements. Solvable *replacement; /* read only */ - $solutionelement->{'replacement'} + $solutionelement->{replacement} solutionelement.replacement solutionelement.replacement The solvable that needs to be installed to fix the problem. int jobidx; /* read only */ - $solutionelement->{'jobidx'} + $solutionelement->{jobidx} solutionelement.jobidx solutionelement.jobidx @@ -2474,7 +2474,7 @@ Transaction order flags === ATTRIBUTES === Pool *pool; /* read only */ - $trans->{'pool'} + $trans->{pool} trans.pool trans.pool @@ -2606,49 +2606,49 @@ Objects of this type are returned by the classify() Transaction method. === ATTRIBUTES === Transaction *transaction; /* read only */ - $class->{'transaction'} + $class->{transaction} class.transaction class.transaction Back pointer to transaction object. int type; /* read only */ - $class->{'type'} + $class->{type} class.type class.type The type of the transaction elements in the class. int count; /* read only */ - $class->{'count'} + $class->{count} class.count class.count The number of elements in the class. const char *fromstr; - $class->{'fromstr'} + $class->{fromstr} class.fromstr class.fromstr The old vendor or architecture. const char *tostr; - $class->{'tostr'} + $class->{tostr} class.tostr class.tostr The new vendor or architecture. Id fromid; - $class->{'fromid'} + $class->{fromid} class.fromid class.fromid The id of the old vendor or architecture. Id toid; - $class->{'toid'} + $class->{toid} class.toid class.toid @@ -2693,7 +2693,7 @@ Create an already finalized checksum object. === ATTRIBUTES === Id type; /* read only */ - $chksum->{'type'} + $chksum->{type} chksum.type chksum.type @@ -2835,14 +2835,14 @@ flag. === ATTRIBUTES === Repo *repo; /* read only */ - $data->{'repo'} + $data->{repo} data.repo data.repo Back pointer to repository object. Id id; /* read only */ - $data->{'id'} + $data->{id} data.id data.id @@ -2979,7 +2979,7 @@ a Datamatch object or by accesing the ``meta'' attribute of a repository. === ATTRIBUTES === Repo *repo; /* read only */ - $data->{'repo'} + $data->{repo} data.repo data.repo diff --git a/examples/p5solv b/examples/p5solv index 850d92f..9bee102 100755 --- a/examples/p5solv +++ b/examples/p5solv @@ -15,8 +15,8 @@ package Repo::generic; sub new { my ($class, $alias, $type, $attr) = @_; my $r = { %{$attr || {}} }; - $r->{'alias'} = $alias; - $r->{'type'} = $type; + $r->{alias} = $alias; + $r->{type} = $type; return bless $r, $class; } @@ -49,7 +49,7 @@ sub calc_cookie_ext { sub cachepath { my ($self, $ext) = @_; - my $path = $self->{'alias'}; + my $path = $self->{alias}; $path =~ s/^\./_/s; $path .= $ext ? "_$ext.solvx" : '.solv'; $path =~ s!/!_!gs; @@ -58,17 +58,17 @@ sub cachepath { sub load { my ($self, $pool) = @_; - $self->{'handle'} = $pool->add_repo($self->{'alias'}); - $self->{'handle'}->{'appdata'} = $self; - $self->{'handle'}->{'priority'} = 99 - $self->{'priority'}; - my $dorefresh = $self->{'autorefresh'}; + $self->{handle} = $pool->add_repo($self->{alias}); + $self->{handle}->{appdata} = $self; + $self->{handle}->{priority} = 99 - $self->{priority}; + my $dorefresh = $self->{autorefresh}; if ($dorefresh) { my @s = stat($self->cachepath()); $dorefresh = 0 if @s && ($self->{'metadata_expire'} == -1 || time() - $s[9] < $self->{'metadata_expire'}); } - $self->{'cookie'} = ''; + $self->{cookie} = ''; if (!$dorefresh && $self->usecachedrepo()) { - print "repo: '$self->{'alias'}' cached\n"; + print "repo: '$self->{alias}' cached\n"; return 1; } return 0; @@ -80,11 +80,11 @@ sub load_ext { sub download { my ($self, $file, $uncompress, $chksum, $markincomplete) = @_; - if (!$self->{'baseurl'}) { - print "$self->{'alias'}: no baseurl\n"; + if (!$self->{baseurl}) { + print "$self->{alias}: no baseurl\n"; return undef; } - my $url = $self->{'baseurl'}; + my $url = $self->{baseurl}; $url =~ s!/$!!; $url .= "/$file"; open(my $f, '+>', undef) || die; @@ -96,15 +96,15 @@ sub download { POSIX::lseek(fileno($f), 0, POSIX::SEEK_SET); if ($st) { print "$file: download error #$st\n"; - $self->{'incomplete'} = 1 if $markincomplete; + $self->{incomplete} = 1 if $markincomplete; return undef; } if ($chksum) { - my $fchksum = solv::Chksum->new($chksum->{'type'}); + my $fchksum = solv::Chksum->new($chksum->{type}); $fchksum->add_fd(fileno($f)); if ($fchksum != $chksum) { print "$file: checksum error\n"; - $self->{'incomplete'} = 1 if $markincomplete; + $self->{incomplete} = 1 if $markincomplete; return undef; } } @@ -117,7 +117,7 @@ sub download { sub usecachedrepo { my ($self, $ext, $mark) = @_; - my $cookie = $ext ? $self->{'extcookie'} : $self->{'cookie'}; + my $cookie = $ext ? $self->{extcookie} : $self->{cookie}; my $cachepath = $self->cachepath($ext); my $fextcookie; if (sysopen(my $f, $cachepath, POSIX::O_RDONLY)) { @@ -125,7 +125,7 @@ sub usecachedrepo { my $fcookie = ''; return undef if sysread($f, $fcookie, 32) != 32; return undef if $cookie && $fcookie ne $cookie; - if ($self->{'type'} ne 'system' && !$ext) { + if ($self->{type} ne 'system' && !$ext) { sysseek($f, -32 * 2, Fcntl::SEEK_END); return undef if sysread($f, $fextcookie, 32) != 32; } @@ -133,11 +133,11 @@ sub usecachedrepo { my $fd = solv::xfopen_fd(undef, fileno($f)); my $flags = $ext ? $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES : 0; $flags |= $solv::Repo::REPO_LOCALPOOL if $ext && $ext ne 'DL'; - if (!$self->{'handle'}->add_solv($fd, $flags)) { + if (!$self->{handle}->add_solv($fd, $flags)) { return undef; } - $self->{'cookie'} = $fcookie unless $ext; - $self->{'extcookie'} = $fextcookie if $fextcookie; + $self->{cookie} = $fcookie unless $ext; + $self->{extcookie} = $fextcookie if $fextcookie; utime undef, undef, $f if $mark; return 1; } @@ -146,7 +146,7 @@ sub usecachedrepo { sub writecachedrepo { my ($self, $ext, $info) = @_; - return if $self->{'incomplete'}; + return if $self->{incomplete}; mkdir("/var/cache/solv", 0755) unless -d "/var/cache/solv"; my ($f, $tmpname); eval { @@ -156,25 +156,25 @@ sub writecachedrepo { chmod 0444, $f; my $ff = solv::xfopen_fd(undef, fileno($f)); if (!$info) { - $self->{'handle'}->write($ff); + $self->{handle}->write($ff); } elsif ($ext) { $info->write($ff); } else { - $self->{'handle'}->write_first_repodata($ff); + $self->{handle}->write_first_repodata($ff); } undef $ff; # also flushes - if ($self->{'type'} ne 'system' && !$ext) { - $self->{'extcookie'} ||= $self->calc_cookie_ext($f, $self->{'cookie'}); - syswrite($f, $self->{'extcookie'}); + if ($self->{type} ne 'system' && !$ext) { + $self->{extcookie} ||= $self->calc_cookie_ext($f, $self->{cookie}); + syswrite($f, $self->{extcookie}); } - syswrite($f, $ext ? $self->{'extcookie'} : $self->{'cookie'}); + syswrite($f, $ext ? $self->{extcookie} : $self->{cookie}); close($f); - if ($self->{'handle'}->iscontiguous()) { + if ($self->{handle}->iscontiguous()) { $f = solv::xfopen($tmpname); if ($f) { if (!$ext) { - $self->{'handle'}->empty(); - die("internal error, cannot reload solv file\n") unless $self->{'handle'}->add_solv($f, $solv::Repo::SOLV_ADD_NO_STUBS); + $self->{handle}->empty(); + die("internal error, cannot reload solv file\n") unless $self->{handle}->add_solv($f, $solv::Repo::SOLV_ADD_NO_STUBS); } else { $info->extend_to_repo(); my $flags = $solv::Repo::REPO_EXTEND_SOLVABLES; @@ -197,7 +197,7 @@ our @ISA = ('Repo::generic'); sub find { my ($self, $what) = @_; - my $di = $self->{'handle'}->Dataiterator($solv::SOLVID_META, $solv::REPOSITORY_REPOMD_TYPE, $what, $solv::Dataiterator::SEARCH_STRING); + my $di = $self->{handle}->Dataiterator($solv::SOLVID_META, $solv::REPOSITORY_REPOMD_TYPE, $what, $solv::Dataiterator::SEARCH_STRING); $di->prepend_keyname($solv::REPOSITORY_REPOMD); for my $d (@$di) { my $dp = $d->parentpos(); @@ -234,7 +234,7 @@ sub add_ext { sub add_exts { my ($self) = @_; - my $repodata = $self->{'handle'}->add_repodata(0); + my $repodata = $self->{handle}->add_repodata(0); $self->add_ext($repodata, 'deltainfo', 'DL'); $self->add_ext($repodata, 'filelists', 'FL'); $repodata->internalize(); @@ -251,7 +251,7 @@ sub load_ext { } else { return 0; } - print("[$self->{'alias'}:$ext: "); + print("[$self->{alias}:$ext: "); STDOUT->flush(); if ($self->usecachedrepo($ext)) { print "cached]\n"; @@ -263,9 +263,9 @@ sub load_ext { my $f = $self->download($filename, 1, $filechksum); return 0 unless $f; if ($ext eq 'FL') { - $self->{'handle'}->add_rpmmd($f, 'FL', $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES|$solv::Repo::REPO_LOCALPOOL); + $self->{handle}->add_rpmmd($f, 'FL', $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES|$solv::Repo::REPO_LOCALPOOL); } elsif ($ext eq 'DL') { - $self->{'handle'}->add_deltainfoxml($f, $solv::Repo::REPO_USE_LOADING); + $self->{handle}->add_deltainfoxml($f, $solv::Repo::REPO_USE_LOADING); } $self->writecachedrepo($ext, $repodata); return 1; @@ -274,40 +274,40 @@ sub load_ext { sub load { my ($self, $pool) = @_; return 1 if $self->Repo::generic::load($pool); - print "rpmmd repo '$self->{'alias'}': "; + print "rpmmd repo '$self->{alias}': "; STDOUT->flush(); my $f = $self->download("repodata/repomd.xml"); if (!$f) { print "no repomd.xml file, skipped\n"; - $self->{'handle'}->free(1); - delete $self->{'handle'}; + $self->{handle}->free(1); + delete $self->{handle}; return undef; } - $self->{'cookie'} = $self->calc_cookie_fp($f); + $self->{cookie} = $self->calc_cookie_fp($f); if ($self->usecachedrepo(undef, 1)) { print "cached\n"; return 1; } - $self->{'handle'}->add_repomdxml($f, 0); + $self->{handle}->add_repomdxml($f, 0); print "fetching\n"; my ($filename, $filechksum) = $self->find('primary'); if ($filename) { $f = $self->download($filename, 1, $filechksum, 1); if ($f) { - $self->{'handle'}->add_rpmmd($f, undef, 0); + $self->{handle}->add_rpmmd($f, undef, 0); } - return undef if $self->{'incomplete'}; + return undef if $self->{incomplete}; } ($filename, $filechksum) = $self->find('updateinfo'); if ($filename) { $f = $self->download($filename, 1, $filechksum, 1); if ($f) { - $self->{'handle'}->add_updateinfoxml($f, 0); + $self->{handle}->add_updateinfoxml($f, 0); } } $self->add_exts(); $self->writecachedrepo(); - $self->{'handle'}->create_stubs(); + $self->{handle}->create_stubs(); return 1; } @@ -318,7 +318,7 @@ our @ISA = ('Repo::generic'); sub find { my ($self, $what) = @_; - my $di = $self->{'handle'}->Dataiterator($solv::SOLVID_META, $solv::SUSETAGS_FILE_NAME, $what, $solv::Dataiterator::SEARCH_STRING); + my $di = $self->{handle}->Dataiterator($solv::SOLVID_META, $solv::SUSETAGS_FILE_NAME, $what, $solv::Dataiterator::SEARCH_STRING); $di->prepend_keyname($solv::SUSETAGS_FILE); for my $d (@$di) { my $dp = $d->parentpos(); @@ -354,7 +354,7 @@ sub add_ext { $repodata->add_idarray($handle, $solv::REPOSITORY_KEYS, $solv::REPOKEY_TYPE_DIRSTRARRAY); } else { for my $langid (sort { $a <=> $b } keys %langtags) { - $repodata->add_idarray($handle, $solv::REPOSITORY_KEYS, $self->{'handle'}->{'pool'}->id2langid($langid, $ext, 1)); + $repodata->add_idarray($handle, $solv::REPOSITORY_KEYS, $self->{handle}->{pool}->id2langid($langid, $ext, 1)); $repodata->add_idarray($handle, $solv::REPOSITORY_KEYS, $langtags{$langid}); } } @@ -363,8 +363,8 @@ sub add_ext { sub add_exts { my ($self) = @_; - my $repodata = $self->{'handle'}->add_repodata(0); - my $di = $self->{'handle'}->Dataiterator($solv::SOLVID_META, $solv::SUSETAGS_FILE_NAME, undef, 0); + my $repodata = $self->{handle}->add_repodata(0); + my $di = $self->{handle}->Dataiterator($solv::SOLVID_META, $solv::SUSETAGS_FILE_NAME, undef, 0); $di->prepend_keyname($solv::SUSETAGS_FILE); for my $d (@$di) { my $filename = $d->str(); @@ -379,21 +379,21 @@ sub load_ext { my ($self, $repodata) = @_; my $filename = $repodata->lookup_str($solv::SOLVID_META, $solv::SUSETAGS_FILE_NAME); my $ext = substr($filename, 9, 2); - print("[$self->{'alias'}:$ext: "); + print("[$self->{alias}:$ext: "); STDOUT->flush(); if ($self->usecachedrepo($ext)) { print "cached]\n"; return 1; } print "fetching]\n"; - my $defvendorid = $self->{'handle'}->{'meta'}->lookup_id($solv::SUSETAGS_DEFAULTVENDOR); - my $descrdir = $self->{'handle'}->{'meta'}->lookup_str($solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr'; + my $defvendorid = $self->{handle}->{meta}->lookup_id($solv::SUSETAGS_DEFAULTVENDOR); + my $descrdir = $self->{handle}->{meta}->lookup_str($solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr'; my $filechksum = $repodata->lookup_checksum($solv::SOLVID_META, $solv::SUSETAGS_FILE_CHECKSUM); my $f = $self->download("$descrdir/$filename", 1, $filechksum); return 0 unless $f; my $flags = $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES; $flags |= $solv::Repo::REPO_LOCALPOOL if $ext ne 'DL'; - $self->{'handle'}->add_susetags($f, $defvendorid, $ext, $flags); + $self->{handle}->add_susetags($f, $defvendorid, $ext, $flags); $self->writecachedrepo($ext, $repodata); return 1; } @@ -401,50 +401,50 @@ sub load_ext { sub load { my ($self, $pool) = @_; return 1 if $self->Repo::generic::load($pool); - print "susetags repo '$self->{'alias'}': "; + print "susetags repo '$self->{alias}': "; STDOUT->flush(); my $f = $self->download("content"); if (!$f) { print "no content file, skipped\n"; - $self->{'handle'}->free(1); - delete $self->{'handle'}; + $self->{handle}->free(1); + delete $self->{handle}; return undef; } - $self->{'cookie'} = $self->calc_cookie_fp($f); + $self->{cookie} = $self->calc_cookie_fp($f); if ($self->usecachedrepo(undef, 1)) { print "cached\n"; return 1; } - $self->{'handle'}->add_content($f, 0); + $self->{handle}->add_content($f, 0); print "fetching\n"; - my $defvendorid = $self->{'handle'}->{'meta'}->lookup_id($solv::SUSETAGS_DEFAULTVENDOR); - my $descrdir = $self->{'handle'}->{'meta'}->lookup_str($solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr'; + my $defvendorid = $self->{handle}->{meta}->lookup_id($solv::SUSETAGS_DEFAULTVENDOR); + my $descrdir = $self->{handle}->{meta}->lookup_str($solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr'; my ($filename, $filechksum) = $self->find('packages.gz'); ($filename, $filechksum) = $self->find('packages') unless $filename; if ($filename) { $f = $self->download("$descrdir/$filename", 1, $filechksum, 1); if ($f) { - $self->{'handle'}->add_susetags($f, $defvendorid, undef, $solv::Repo::REPO_NO_INTERNALIZE|$solv::Repo::SUSETAGS_RECORD_SHARES); + $self->{handle}->add_susetags($f, $defvendorid, undef, $solv::Repo::REPO_NO_INTERNALIZE|$solv::Repo::SUSETAGS_RECORD_SHARES); ($filename, $filechksum) = $self->find('packages.en.gz'); ($filename, $filechksum) = $self->find('packages.en') unless $filename; if ($filename) { $f = $self->download("$descrdir/$filename", 1, $filechksum, 1); if ($f) { - $self->{'handle'}->add_susetags($f, $defvendorid, undef, $solv::Repo::REPO_NO_INTERNALIZE|$solv::Repo::REPO_REUSE_REPODATA|$solv::Repo::REPO_EXTEND_SOLVABLES); + $self->{handle}->add_susetags($f, $defvendorid, undef, $solv::Repo::REPO_NO_INTERNALIZE|$solv::Repo::REPO_REUSE_REPODATA|$solv::Repo::REPO_EXTEND_SOLVABLES); } } - $self->{'handle'}->internalize(); + $self->{handle}->internalize(); } } $self->add_exts(); $self->writecachedrepo(); - $self->{'handle'}->create_stubs(); + $self->{handle}->create_stubs(); return undef; } sub packagespath { my ($self) = @_; - return ($self->{'handle'}->{'meta'}->lookup_str($solv::SUSETAGS_DATADIR) || 'suse') . '/'; + return ($self->{handle}->{meta}->lookup_str($solv::SUSETAGS_DATADIR) || 'suse') . '/'; } package Repo::unknown; @@ -453,7 +453,7 @@ our @ISA = ('Repo::generic'); sub load { my ($self) = @_; - print "unsupported repo '$self->{'alias'}': skipped\n"; + print "unsupported repo '$self->{alias}': skipped\n"; return 0; } @@ -464,21 +464,21 @@ our @ISA = ('Repo::generic'); sub load { my ($self, $pool) = @_; - $self->{'handle'} = $pool->add_repo($self->{'alias'}); - $self->{'handle'}->{'appdata'} = $self; - $pool->{'installed'} = $self->{'handle'}; + $self->{handle} = $pool->add_repo($self->{alias}); + $self->{handle}->{appdata} = $self; + $pool->{installed} = $self->{handle}; print "rpm database: "; - $self->{'cookie'} = $self->calc_cookie_file('/var/lib/rpm/Packages'); + $self->{cookie} = $self->calc_cookie_file('/var/lib/rpm/Packages'); if ($self->usecachedrepo()) { print "cached\n"; return 1; } print "reading\n"; if (defined(&solv::Repo::add_products)) { - $self->{'handle'}->add_products("/etc/products.d", $solv::Repo::REPO_NO_INTERNALIZE); + $self->{handle}->add_products("/etc/products.d", $solv::Repo::REPO_NO_INTERNALIZE); } my $f = solv::xfopen($self->cachepath()); - $self->{'handle'}->add_rpmdb_reffp($f, $solv::Repo::REPO_REUSE_REPODATA); + $self->{handle}->add_rpmdb_reffp($f, $solv::Repo::REPO_REUSE_REPODATA); $self->writecachedrepo(); return 1; } @@ -487,7 +487,7 @@ package main; sub load_stub { my ($repodata) = @_; - my $repo = $repodata->{'repo'}->{'appdata'}; + my $repo = $repodata->{repo}->{appdata}; return $repo ? $repo->load_ext($repodata) : 0; } @@ -526,9 +526,9 @@ for my $reposdir (@reposdirs) { $repoattr->{$p} = $cfg->val($alias, $p); } my $repo; - if ($repoattr->{'type'} eq 'rpm-md') { + if ($repoattr->{type} eq 'rpm-md') { $repo = Repo::rpmmd->new($alias, 'repomd', $repoattr); - } elsif ($repoattr->{'type'} eq 'yast2') { + } elsif ($repoattr->{type} eq 'yast2') { $repo = Repo::susetags->new($alias, 'susetags', $repoattr); } else { $repo = Repo::unknown->new($alias, 'unknown', $repoattr); @@ -545,7 +545,7 @@ $pool->set_loadcallback(\&load_stub); my $sysrepo = Repo::system->new('@System', 'system'); $sysrepo->load($pool); for my $repo (@repos) { - $repo->load($pool) if $repo->{'enabled'}; + $repo->load($pool) if $repo->{enabled}; } if ($cmd eq 'search') { @@ -553,10 +553,10 @@ if ($cmd eq 'search') { my $sel = $pool->Selection(); my $di = $pool->Dataiterator(0, $solv::SOLVABLE_NAME, $ARGV[0], $solv::Dataiterator::SEARCH_SUBSTRING | $solv::Dataiterator::SEARCH_NOCASE); for my $d (@$di) { - $sel->add_raw($solv::Job::SOLVER_SOLVABLE, $d->{'solvid'}); + $sel->add_raw($solv::Job::SOLVER_SOLVABLE, $d->{solvid}); } for my $s ($sel->solvables()) { - print "- ".$s->str()." [$s->{'repo'}->{'name'}]: ".$s->lookup_str($solv::SOLVABLE_SUMMARY)."\n"; + print "- ".$s->str()." [$s->{repo}->{name}]: ".$s->lookup_str($solv::SOLVABLE_SUMMARY)."\n"; } exit(0); } @@ -597,7 +597,7 @@ if ($cmd eq 'list' || $cmd eq 'info') { for my $s ($job->solvables()) { if ($cmd eq 'info') { printf "Name: %s\n", $s->str(); - printf "Repo: %s\n", $s->{'repo'}->{'name'}; + printf "Repo: %s\n", $s->{repo}->{name}; printf "Summary: %s\n", $s->lookup_str($solv::SOLVABLE_SUMMARY); my $str = $s->lookup_str($solv::SOLVABLE_URL); printf "Url: %s\n", $str if $str; @@ -605,7 +605,7 @@ if ($cmd eq 'list' || $cmd eq 'info') { printf "License: %s\n", $str if $str; printf "Description:\n%s\n", $s->lookup_str($solv::SOLVABLE_DESCRIPTION); } else { - printf " - %s [%s]\n", $s->str(), $s->{'repo'}->{'name'}; + printf " - %s [%s]\n", $s->str(), $s->{repo}->{name}; printf " %s\n", $s->lookup_str($solv::SOLVABLE_SUMMARY); } } @@ -615,7 +615,7 @@ if ($cmd eq 'list' || $cmd eq 'info') { # up magic, turn into install if nothing matches for my $job (@jobs) { - $job->{'how'} ^= $solv::Job::SOLVER_UPDATE ^ $solv::Job::SOLVER_INSTALL if $cmd eq 'up' && $job->isemptyupdate(); + $job->{how} ^= $solv::Job::SOLVER_UPDATE ^ $solv::Job::SOLVER_INSTALL if $cmd eq 'up' && $job->isemptyupdate(); } my $solver = $pool->Solver(); @@ -626,13 +626,13 @@ while (1) { my @problems = $solver->solve(\@jobs); last unless @problems; for my $problem (@problems) { - print "Problem $problem->{'id'}/".@problems.":\n"; + print "Problem $problem->{id}/".@problems.":\n"; my $r = $problem->findproblemrule(); my $ri = $r->info(); print $ri->problemstr()."\n"; my @solutions = $problem->solutions(); for my $solution (@solutions) { - print " Solution $solution->{'id'}:\n"; + print " Solution $solution->{id}:\n"; for my $element ($solution->elements(1)) { print " - ".$element->str()."\n"; } @@ -650,8 +650,8 @@ while (1) { my $solution = $solutions[$sol - 1]; for my $element ($solution->elements()) { my $newjob = $element->Job(); - if ($element->{'type'} == $solv::Solver::SOLVER_SOLUTION_JOB) { - $jobs[$element->{'jobidx'}] = $newjob; + if ($element->{type} == $solv::Solver::SOLVER_SOLUTION_JOB) { + $jobs[$element->{jobidx}] = $newjob; } else { push @jobs, $newjob if $newjob && !grep {$_ == $newjob} @jobs; } @@ -668,27 +668,27 @@ if ($trans->isempty()) { print "\nTransaction summary:\n\n"; for my $c ($trans->classify($solv::Transaction::SOLVER_TRANSACTION_SHOW_OBSOLETES|$solv::Transaction::SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE)) { - if ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_ERASE) { - print "$c->{'count'} erased packages:\n"; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_INSTALL) { - print "$c->{'count'} installed packages:\n"; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_REINSTALLED) { - print "$c->{'count'} reinstalled packages:\n"; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_DOWNGRADED) { - print "$c->{'count'} downgraded packages:\n"; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_CHANGED) { - print "$c->{'count'} changed packages:\n"; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_UPGRADED) { - print "$c->{'count'} upgraded packages:\n"; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_VENDORCHANGE) { - printf "$c->{'count'} vendor changes from '%s' to '%s':\n", $c->{'fromstr'}, $c->{'tostr'}; - } elsif ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_ARCHCHANGE) { - printf "$c->{'count'} arch changes from '%s' to '%s':\n", $c->{'fromstr'}, $c->{'tostr'}; + if ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_ERASE) { + print "$c->{count} erased packages:\n"; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_INSTALL) { + print "$c->{count} installed packages:\n"; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_REINSTALLED) { + print "$c->{count} reinstalled packages:\n"; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_DOWNGRADED) { + print "$c->{count} downgraded packages:\n"; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_CHANGED) { + print "$c->{count} changed packages:\n"; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_UPGRADED) { + print "$c->{count} upgraded packages:\n"; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_VENDORCHANGE) { + printf "$c->{count} vendor changes from '%s' to '%s':\n", $c->{fromstr}, $c->{tostr}; + } elsif ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_ARCHCHANGE) { + printf "$c->{count} arch changes from '%s' to '%s':\n", $c->{fromstr}, $c->{tostr}; } else { next; } for my $p ($c->solvables()) { - if ($c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_UPGRADED || $c->{'type'} == $solv::Transaction::SOLVER_TRANSACTION_DOWNGRADED) { + if ($c->{type} == $solv::Transaction::SOLVER_TRANSACTION_UPGRADED || $c->{type} == $solv::Transaction::SOLVER_TRANSACTION_DOWNGRADED) { my $other = $trans->othersolvable($p); printf " - %s -> %s\n", $p->str(), $other->str(); } else { @@ -714,14 +714,14 @@ if (@newpkgs) { $downloadsize += $_->lookup_num($solv::SOLVABLE_DOWNLOADSIZE) for @newpkgs; printf "Downloading %d packages, %d K\n", scalar(@newpkgs), $downloadsize; for my $p (@newpkgs) { - my $repo = $p->{'repo'}->{'appdata'}; + my $repo = $p->{repo}->{appdata}; my ($location) = $p->lookup_location(); next unless $location; $location = $repo->packagespath() . $location; my $chksum = $p->lookup_checksum($solv::SOLVABLE_CHECKSUM); my $f = $repo->download($location, 0, $chksum); - die("\n$repo->{'alias'}: $location not found in repository\n") unless $f; - $newpkgsfps{$p->{'id'}} = $f; + die("\n$repo->{alias}: $location not found in repository\n") unless $f; + $newpkgsfps{$p->{id}} = $f; print "."; STDOUT->flush(); } @@ -735,15 +735,15 @@ for my $p ($trans->steps()) { if ($steptype == $solv::Transaction::SOLVER_TRANSACTION_ERASE) { print "erase ".$p->str()."\n"; next unless $p->lookup_num($solv::RPM_RPMDBID); - my $evr = $p->{'evr'}; + my $evr = $p->{evr}; $evr =~ s/^[0-9]+://; # strip epoch - system('rpm', '-e', '--nodeps', '--nodigest', '--nosignature', "$p->{'name'}-$evr.$p->{'arch'}") && die("rpm failed: $?\n"); + system('rpm', '-e', '--nodeps', '--nodigest', '--nosignature', "$p->{name}-$evr.$p->{arch}") && die("rpm failed: $?\n"); } elsif ($steptype == $solv::Transaction::SOLVER_TRANSACTION_INSTALL || $steptype == $solv::Transaction::SOLVER_TRANSACTION_MULTIINSTALL) { print "install ".$p->str()."\n"; - my $f = $newpkgsfps{$p->{'id'}}; + my $f = $newpkgsfps{$p->{id}}; my $mode = $steptype == $solv::Transaction::SOLVER_TRANSACTION_INSTALL ? '-U' : '-i'; system('rpm', $mode, '--force', '--nodeps', '--nodigest', '--nosignature', "/dev/fd/".$f->fileno()) && die("rpm failed: $?\n"); - delete $newpkgsfps{$p->{'id'}}; + delete $newpkgsfps{$p->{id}}; } }