pkgmanagement.html 178 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <META NAME="generator" CONTENT="http://txt2tags.org">
  5. </HEAD><BODY BGCOLOR="white" TEXT="black">
  6. <CENTER>
  7. </CENTER>
  8. <H1>Part IV - Package management</H1>
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  10. <html>
  11. <!-- This user guide is for Qi (version 1.3,
  12. 10 Sep 2019), which is a simple but well-integrated package manager.
  13. Copyright (C) 2019 Matias Andres Fonzo, Santiago del Estero,
  14. Argentina.
  15. Permission is granted to copy, distribute and/or modify this document
  16. under the terms of the GNU Free Documentation License, Version 1.3 or
  17. any later version published by the Free Software Foundation; with no
  18. Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
  19. Texts. A copy of the license is included in the section entitled
  20. "GNU Free Documentation License". -->
  21. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  22. <head>
  23. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  24. <title>Qi user guide</title>
  25. <meta name="description" content="Qi user guide">
  26. <meta name="keywords" content="Qi user guide">
  27. <meta name="resource-type" content="document">
  28. <meta name="distribution" content="global">
  29. <meta name="Generator" content="makeinfo">
  30. <link href="#Top" rel="start" title="Top">
  31. <link href="#Index" rel="index" title="Index">
  32. <link href="#SEC_Contents" rel="contents" title="Table of Contents">
  33. <link href="dir.html#Top" rel="up" title="(dir)">
  34. <style type="text/css">
  35. <!--
  36. a.summary-letter {text-decoration: none}
  37. blockquote.indentedblock {margin-right: 0em}
  38. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  39. blockquote.smallquotation {font-size: smaller}
  40. div.display {margin-left: 3.2em}
  41. div.example {margin-left: 3.2em}
  42. div.lisp {margin-left: 3.2em}
  43. div.smalldisplay {margin-left: 3.2em}
  44. div.smallexample {margin-left: 3.2em}
  45. div.smalllisp {margin-left: 3.2em}
  46. kbd {font-style: oblique}
  47. pre.display {font-family: inherit}
  48. pre.format {font-family: inherit}
  49. pre.menu-comment {font-family: serif}
  50. pre.menu-preformatted {font-family: serif}
  51. pre.smalldisplay {font-family: inherit; font-size: smaller}
  52. pre.smallexample {font-size: smaller}
  53. pre.smallformat {font-family: inherit; font-size: smaller}
  54. pre.smalllisp {font-size: smaller}
  55. span.nolinebreak {white-space: nowrap}
  56. span.roman {font-family: initial; font-weight: normal}
  57. span.sansserif {font-family: sans-serif; font-weight: normal}
  58. ul.no-bullet {list-style: none}
  59. -->
  60. </style>
  61. </head>
  62. <body lang="en">
  63. <h1 class="settitle" align="center">Qi user guide</h1>
  64. <a name="SEC_Contents"></a>
  65. <h2 class="contents-heading">Table of Contents</h2>
  66. <div class="contents">
  67. <ul class="no-bullet">
  68. <li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a></li>
  69. <li><a name="toc-Invoking-qi-1" href="#Invoking-qi">2 Invoking qi</a></li>
  70. <li><a name="toc-The-qirc-file-1" href="#The-qirc-file">3 The qirc file</a></li>
  71. <li><a name="toc-Packages-1" href="#Packages">4 Packages</a>
  72. <ul class="no-bullet">
  73. <li><a name="toc-Package-conflicts" href="#Package-conflicts">4.1 Package conflicts</a></li>
  74. <li><a name="toc-Installing-packages" href="#Installing-packages">4.2 Installing packages</a></li>
  75. <li><a name="toc-Removing-packages" href="#Removing-packages">4.3 Removing packages</a></li>
  76. <li><a name="toc-Upgrading-packages" href="#Upgrading-packages">4.4 Upgrading packages</a>
  77. <ul class="no-bullet">
  78. <li><a name="toc-Package-blacklist" href="#Package-blacklist">4.4.1 Package blacklist</a></li>
  79. </ul></li>
  80. </ul></li>
  81. <li><a name="toc-Recipes-1" href="#Recipes">5 Recipes</a>
  82. <ul class="no-bullet">
  83. <li><a name="toc-Variables" href="#Variables">5.1 Variables</a></li>
  84. <li><a name="toc-Special-variables" href="#Special-variables">5.2 Special variables</a></li>
  85. <li><a name="toc-Writing-recipes" href="#Writing-recipes">5.3 Writing recipes</a></li>
  86. <li><a name="toc-Building-packages" href="#Building-packages">5.4 Building packages</a></li>
  87. <li><a name="toc-Variables-from-the-environment" href="#Variables-from-the-environment">5.5 Variables from the environment</a></li>
  88. <li><a name="toc-The-meta-file" href="#The-meta-file">5.6 The meta file</a></li>
  89. </ul></li>
  90. <li><a name="toc-Order-files-1" href="#Order-files">6 Order files</a></li>
  91. <li><a name="toc-Creating-packages-1" href="#Creating-packages">7 Creating packages</a></li>
  92. <li><a name="toc-Examining-packages-1" href="#Examining-packages">8 Examining packages</a></li>
  93. <li><a name="toc-Exit-status-1" href="#Exit-status">9 Exit status</a></li>
  94. <li><a name="toc-Index-1" href="#Index">Index</a></li>
  95. </ul>
  96. </div>
  97. <a name="Top"></a>
  98. <div class="header">
  99. <p>
  100. Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  101. </div>
  102. <a name="SEC_Top"></a>
  103. <p>This user guide is for Qi (version 1.3,
  104. 10 Sep 2019).
  105. </p>
  106. <table class="menu" border="0" cellspacing="0">
  107. <tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description and features of qi
  108. </td></tr>
  109. <tr><td align="left" valign="top">&bull; <a href="#Invoking-qi" accesskey="2">Invoking qi</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Command-line options
  110. </td></tr>
  111. <tr><td align="left" valign="top">&bull; <a href="#The-qirc-file" accesskey="3">The qirc file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file
  112. </td></tr>
  113. <tr><td align="left" valign="top">&bull; <a href="#Packages" accesskey="4">Packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Managing packages
  114. </td></tr>
  115. <tr><td align="left" valign="top">&bull; <a href="#Recipes" accesskey="5">Recipes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Building packages
  116. </td></tr>
  117. <tr><td align="left" valign="top">&bull; <a href="#Order-files" accesskey="6">Order files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Handling build order
  118. </td></tr>
  119. <tr><td align="left" valign="top">&bull; <a href="#Creating-packages" accesskey="7">Creating packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Making Qi packages
  120. </td></tr>
  121. <tr><td align="left" valign="top">&bull; <a href="#Examining-packages" accesskey="8">Examining packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Debugging purposes
  122. </td></tr>
  123. <tr><td align="left" valign="top">&bull; <a href="#Exit-status" accesskey="9">Exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exit codes
  124. </td></tr>
  125. <tr><td align="left" valign="top">&bull; <a href="#Index">Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
  126. </td></tr>
  127. </table>
  128. <br>
  129. <p>Copyright (C) 2019 Matias Fonzo.
  130. </p>
  131. <p>Qi&rsquo;s home page can be found at <a href="http://www.dragora.org">http://www.dragora.org</a>.
  132. Send&nbsp;bug&nbsp;reports&nbsp;or&nbsp;suggestions&nbsp;to&nbsp;<a href="mailto:dragora-users@nongnu.org"><span class="nolinebreak">dragora-users</span>@nongnu.org</a>.<!-- /@w -->
  133. </p>
  134. <hr>
  135. <a name="Introduction"></a>
  136. <div class="header">
  137. <p>
  138. Next: <a href="#Invoking-qi" accesskey="n" rel="next">Invoking qi</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  139. </div>
  140. <a name="Introduction-1"></a>
  141. <h2 class="chapter">1 Introduction</h2>
  142. <a name="index-introduction"></a>
  143. <p>Qi is a simple but well-integrated package manager. It can create,
  144. install, remove, and upgrade software packages. Qi produces binary
  145. packages using recipes, which are files containing specific instructions
  146. to build each package from source. Qi can manage multiple packages
  147. under a single directory hierarchy. This method allows to maintain a set
  148. of packages and multiple versions of them. This means that Qi could be
  149. used as the main package manager or complement the existing one.
  150. </p>
  151. <p>Qi offers a friendly command line interface, a global configuration
  152. file, a simple recipe layout to deploy software packages; also works
  153. with binary packages in parallel, speeding up installations and packages
  154. in production. The format used for packages is a simplified but safe
  155. POSIX pax archive compressed with lzip.
  156. </p>
  157. <p>Qi is a modern (POSIX-compliant) shell script released under the
  158. terms of the GNU General Public License. There are only two major
  159. dependencies for the magic: graft(1) and tarlz(1), the rest is expected
  160. to be found in any Unix-like system.
  161. </p>
  162. <hr>
  163. <a name="Invoking-qi"></a>
  164. <div class="header">
  165. <p>
  166. Next: <a href="#The-qirc-file" accesskey="n" rel="next">The qirc file</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  167. </div>
  168. <a name="Invoking-qi-1"></a>
  169. <h2 class="chapter">2 Invoking qi</h2>
  170. <a name="index-invocation"></a>
  171. <p>This chapter describes the synopsis and command line options for
  172. invoke Qi.
  173. </p>
  174. <div class="example">
  175. <pre class="example">Usage: qi [<var>OPTION</var>]... [<var>FILE</var>]...
  176. </pre></div>
  177. <p>One mandatory option specifies the operation that &lsquo;<samp>qi</samp>&rsquo; should
  178. perform, other options are meant to detail how this operation should be
  179. performed.
  180. </p>
  181. <p>qi supports the following options to operate:
  182. </p>
  183. <dl compact="compact">
  184. <dt><code>-b</code></dt>
  185. <dd><p>Build package using recipe names.
  186. </p>
  187. </dd>
  188. <dt><code>-c</code></dt>
  189. <dd><p>Create .tlz package from directory.
  190. </p>
  191. </dd>
  192. <dt><code>-d</code></dt>
  193. <dd><p>Delete packages.
  194. </p>
  195. </dd>
  196. <dt><code>-i</code></dt>
  197. <dd><p>Install packages.
  198. </p>
  199. </dd>
  200. <dt><code>-o</code></dt>
  201. <dd><p>Resolve build order through .order files.
  202. </p>
  203. </dd>
  204. <dt><code>-u</code></dt>
  205. <dd><p>Update packages (implies -i, -d and -p options).
  206. </p>
  207. </dd>
  208. <dt><code>-w</code></dt>
  209. <dd><p>Warn about files that will be linked.
  210. </p>
  211. </dd>
  212. <dt><code>-x</code></dt>
  213. <dd><p>Extract a package for debugging purposes.
  214. </p></dd>
  215. </dl>
  216. <p>There are common options between modes:
  217. </p>
  218. <dl compact="compact">
  219. <dt><code>-N</code></dt>
  220. <dd><p>Do not read the configuration file.
  221. </p>
  222. <p>This will ignore any value in the qirc file.
  223. </p>
  224. </dd>
  225. <dt><code>-P &lt;DIR&gt;</code></dt>
  226. <dd><p>Package directory for installations.
  227. </p>
  228. <p>This option sets &lsquo;<samp>${packagedir}</samp>&rsquo;.
  229. </p>
  230. <p>Only valid for -i, -d, or -u options.
  231. </p>
  232. </dd>
  233. <dt><code>-f</code></dt>
  234. <dd><p>Force option.
  235. </p>
  236. <p>This option can force the build of a recipe, or force the update of a
  237. pre-existing package.
  238. </p>
  239. <p>Only valid for -b, -u options.
  240. </p>
  241. </dd>
  242. <dt><code>-t &lt;DIR&gt;</code></dt>
  243. <dd><p>Target directory for symbolic links.
  244. </p>
  245. <p>This option sets &lsquo;<samp>${targetdir}</samp>&rsquo;.
  246. </p>
  247. <p>Only valid for -i, -d, or -u options.
  248. </p>
  249. </dd>
  250. <dt><code>-k</code></dt>
  251. <dd><p>Keep (don&rsquo;t delete) &lsquo;<samp>${srcdir}</samp>&rsquo; or &lsquo;<samp>${destdir}</samp>&rsquo; in build
  252. mode, keep (don&rsquo;t delete) package directory in delete mode.
  253. </p>
  254. <p>Only valid for -b, -d or -u options.
  255. </p>
  256. </dd>
  257. <dt><code>-p</code></dt>
  258. <dd><p>Prune conflicts on package installations.
  259. </p>
  260. <p>This option may proceed with the package installation if one or more
  261. conflicts occur.
  262. </p>
  263. </dd>
  264. <dt><code>-r /rootdir</code></dt>
  265. <dd><p>Use the fully qualified named directory as the root directory for all qi
  266. operations. The target directory and package directory will be relative
  267. to the specified directory, including the log file for graft.
  268. </p>
  269. </dd>
  270. <dt><code>-v</code></dt>
  271. <dd><p>Be verbose (a 2nd -v gives more).
  272. </p></dd>
  273. </dl>
  274. <p>Options for build mode (-b):
  275. </p>
  276. <dl compact="compact">
  277. <dt><code>-O &lt;DIR&gt;</code></dt>
  278. <dd><p>Where the packages produced are written.
  279. </p>
  280. <p>This option sets &lsquo;<samp>${outdir}</samp>&rsquo;.
  281. </p>
  282. </dd>
  283. <dt><code>-W &lt;DIR&gt;</code></dt>
  284. <dd><p>Where archives, patches, and recipes are expected.
  285. </p>
  286. <p>This option sets &lsquo;<samp>${worktree}</samp>&rsquo;.
  287. </p>
  288. </dd>
  289. <dt><code>-Z &lt;DIR&gt;</code></dt>
  290. <dd><p>Where (compressed) sources will be found.
  291. </p>
  292. <p>This option sets &lsquo;<samp>${tardir}</samp>&rsquo;.
  293. </p>
  294. </dd>
  295. <dt><code>-a</code></dt>
  296. <dd><p>Architecture to use.
  297. </p>
  298. <p>Default value is obtained via uname(1) as &lsquo;<samp>uname -m</samp>&rsquo;.
  299. </p>
  300. </dd>
  301. <dt><code>-j</code></dt>
  302. <dd><p>Parallel jobs for the compiler.
  303. </p>
  304. <p>If not specified, default sets to 1.
  305. </p>
  306. </dd>
  307. <dt><code>-1</code></dt>
  308. <dd><p>Increment release number (&lsquo;<samp>${release}</samp>&rsquo; + 1).
  309. </p>
  310. <p>It will be omitted if the -n option is being used.
  311. </p>
  312. </dd>
  313. <dt><code>-n</code></dt>
  314. <dd><p>Don&rsquo;t create a .tlz package.
  315. </p>
  316. </dd>
  317. <dt><code>-S</code></dt>
  318. <dd><p>Selects the option to skip completed recipes.
  319. </p>
  320. <p>This means, in interactive mode, when the dialog
  321. to summarize recipes is shown.
  322. </p></dd>
  323. </dl>
  324. <p>Informative options:
  325. </p>
  326. <dl compact="compact">
  327. <dt><code>-L</code></dt>
  328. <dd><p>Print default directory locations.
  329. </p>
  330. <p>This will print the target directory, package directory, working tree,
  331. the directory for tarballs, and the output directory for the packages
  332. produced.
  333. </p>
  334. </dd>
  335. <dt><code>-h</code></dt>
  336. <dd><p>Display the help describing the options and then exit.
  337. </p>
  338. </dd>
  339. <dt><code>-V</code></dt>
  340. <dd><p>Print the version number and license information.
  341. The version number should be included in all bug reports.
  342. </p></dd>
  343. </dl>
  344. <p>Expected non-option arguments are package directories and regular files:
  345. recipes or files ending in .tlz, .order. When FILE is -, qi can read from
  346. the standard input. See examples in <a href="#Packages">Packages</a>.
  347. </p>
  348. <hr>
  349. <a name="The-qirc-file"></a>
  350. <div class="header">
  351. <p>
  352. Next: <a href="#Packages" accesskey="n" rel="next">Packages</a>, Previous: <a href="#Invoking-qi" accesskey="p" rel="prev">Invoking qi</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  353. </div>
  354. <a name="The-qirc-file-1"></a>
  355. <h2 class="chapter">3 The qirc file</h2>
  356. <a name="index-configuration-file"></a>
  357. <p>The global <samp>qirc</samp> file offers a way to define variables and tools
  358. (such as a download manager) for default use. This file is used by qi
  359. at runtime, e.g., to build, install, remove or upgrade packages.
  360. </p>
  361. <p>It has the following rules:
  362. </p>
  363. <ul>
  364. <li> Variables must be declared as &lsquo;<samp>name=value</samp>&rsquo;.
  365. </li><li> Declaration of values should only take one line, no line break.
  366. </li><li> For security reasons, assignments like &lsquo;<samp>name=$var</samp>&rsquo; are only
  367. interpreted as literal.
  368. </li></ul>
  369. <p>The command line options related to the package directory and target
  370. directory plus some of the options used for the build mode can override
  371. some values in <samp>qirc</samp>. See <a href="#Invoking-qi">Invoking qi</a>.
  372. </p>
  373. <p>The order in which qi looks for this file is:
  374. </p>
  375. <ol>
  376. <li> <code>${HOME}/.qirc</code>
  377. Effective user.
  378. </li><li> &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo;
  379. System-wide.
  380. </li></ol>
  381. <p>If you intend to run qi as effective user, the file
  382. &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo; could be copied to <code>${HOME}/.qirc</code>
  383. setting the paths for &lsquo;<samp>${packagedir}</samp>&rsquo; and &lsquo;<samp>${targetdir}</samp>&rsquo;
  384. according to the <code>$HOME</code>.
  385. </p>
  386. <hr>
  387. <a name="Packages"></a>
  388. <div class="header">
  389. <p>
  390. Next: <a href="#Recipes" accesskey="n" rel="next">Recipes</a>, Previous: <a href="#The-qirc-file" accesskey="p" rel="prev">The qirc file</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  391. </div>
  392. <a name="Packages-1"></a>
  393. <h2 class="chapter">4 Packages</h2>
  394. <a name="index-managing-packages"></a>
  395. <p>A package is a suite of programs usually distributed in binary form
  396. which may also contain manual pages, documentation, or any other file
  397. associated to a specific software.
  398. </p>
  399. <p>The package format used by qi is a simplified POSIX pax archive
  400. compressed with lzip. The file extension for packages is &lsquo;<samp>.tlz</samp>&rsquo;.
  401. </p>
  402. <p>Both package installation and package de-installation are managed using
  403. two important (internal) variables: &lsquo;<samp>${packagedir}</samp>&rsquo; and
  404. &lsquo;<samp>${targetdir}</samp>&rsquo;, these values can be changed in the
  405. configuration file or via options.
  406. </p>
  407. <p>&lsquo;<samp>${packagedir}</samp>&rsquo; is a common directory tree where the package
  408. contents will be decompressed (will reside).
  409. </p>
  410. <p>&lsquo;<samp>${targetdir}</samp>&rsquo; is a target directory where the links will be
  411. made by graft(1) taking &lsquo;<samp>${packagedir}/package_name</samp>&rsquo; into account.
  412. </p>
  413. <p>Packages are installed in self-contained directory trees and symbolic
  414. links from a common area are made to the package files. This allows
  415. multiple versions of the same package to coexist on the same system.
  416. </p>
  417. <a name="Package-conflicts"></a>
  418. <h3 class="section">4.1 Package conflicts</h3>
  419. <a name="index-package-conflicts"></a>
  420. <p>All the links to install or remove a package are handled by graft(1).
  421. Since multiple packages can be installed or removed at the same time,
  422. certain conflicts may arise between the packages.
  423. </p>
  424. <p>graft<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>
  425. defines a CONFLICT as one of the following conditions:
  426. </p>
  427. <ul>
  428. <li> If the package object is a directory and the target object exists but is
  429. not a directory.
  430. </li><li> If the package object is not a directory and the target object exists
  431. and is not a symbolic link.
  432. </li><li> If the package object is not a directory and the target object exists
  433. and is a symbolic link to something other than the package object.
  434. </li></ul>
  435. <p>The default behavior of qi for an incoming package is to ABORT if a
  436. conflict arises. When a package is going to be deleted, qi tells to
  437. graft(1) to remove those parts that are not in conflict, leaving the
  438. links to the belonging package. This behavior can be forced if the
  439. -p option is given.
  440. </p>
  441. <a name="Installing-packages"></a>
  442. <h3 class="section">4.2 Installing packages</h3>
  443. <a name="index-package-installation"></a>
  444. <p>To install a single package, simply type:
  445. </p>
  446. <div class="example">
  447. <pre class="example">qi -i coreutils-8.30-i586+1.tlz
  448. </pre></div>
  449. <p>To install multiple packages at once, type:
  450. </p>
  451. <div class="example">
  452. <pre class="example">qi -i gcc-8.3.0-i586+1.tlz rafaela-2.2-i586+1.tlz ...
  453. </pre></div>
  454. <p>Warn about the files that will be linked:
  455. </p>
  456. <div class="example">
  457. <pre class="example">qi -w bash-5.0-i586+1.tlz
  458. </pre></div>
  459. <p>This is to verify the content of a package before installing it.
  460. </p>
  461. <p>See the process of an installation (very verbose):
  462. </p>
  463. <div class="example">
  464. <pre class="example">qi -i -v mariana-3.0-i586+1.tlz
  465. </pre></div>
  466. <p>A second -v gives more.
  467. </p>
  468. <p>Installing package in a different location:
  469. </p>
  470. <div class="example">
  471. <pre class="example">qi -r /media/floppy -i lzip-1.21-i586+1.tlz
  472. </pre></div>
  473. <p>The -r option assumes &lsquo;<samp>${targetdir}</samp>&rsquo; and &lsquo;<samp>${packagedir}</samp>&rsquo;.
  474. See:
  475. </p>
  476. <div class="example">
  477. <pre class="example">qi -r /home/selk -P /pkgs -t / -i lzip-1.21-i586+1.tlz
  478. </pre></div>
  479. <p>In this case the content of &quot;lzip-1.21-i586+1.tlz&quot; will be decompressed
  480. into &lsquo;<samp>/home/selk/pkgs/lzip-1.21-i586+1</samp>&rsquo;. Assuming that the main
  481. binary for lzip is under &lsquo;<samp>/home/selk/pkgs/lzip-1.21-i586+1/usr/bin/</samp>&rsquo;
  482. the target for &quot;usr/bin&quot; will be created at &lsquo;<samp>/home/selk</samp>&rsquo;. Considering
  483. that you have exported the <code>PATH</code> as &lsquo;<samp>${HOME}/usr/bin</samp>&rsquo;, now the
  484. system is able to see the recent lzip.
  485. </p>
  486. <p>Installing from a list of packages using standard input:
  487. </p>
  488. <div class="example">
  489. <pre class="example">cat FILELIST.txt | qi -i -
  490. </pre></div>
  491. <p>The list of packages must contain full path names to be passed in the
  492. installation, e.g.:
  493. /var/cache/qi/packages/x86_64/devel/tcl-8.6.9-x86_64+1.tlz
  494. /var/cache/qi/packages/x86_64/devel/tk-8.6.9.1-x86_64+1.tlz
  495. /var/cache/qi/packages/x86_64/devel/vala-0.42.3-x86_64+1.tlz
  496. </p>
  497. <a name="Removing-packages"></a>
  498. <h3 class="section">4.3 Removing packages</h3>
  499. <a name="index-package-de_002dinstallation"></a>
  500. <p>To remove a package, simply type:
  501. </p>
  502. <div class="example">
  503. <pre class="example">qi -d xz-5.2.4-i586+1.tlz
  504. </pre></div>
  505. <p>Delete mode will match the package name using &lsquo;<samp>${packagedir}</samp>&rsquo; as
  506. prefix. For example, if the value of &lsquo;<samp>${packagedir}</samp>&rsquo; is set to
  507. /usr/local/pkgs, this will be equal to:
  508. </p>
  509. <div class="example">
  510. <pre class="example">qi -d /usr/local/pkgs/xz-5.2.4-i586+1
  511. </pre></div>
  512. <p>Detailed output (very verbose):
  513. </p>
  514. <div class="example">
  515. <pre class="example">qi -d -v /usr/local/pkgs/xz-5.2.4-i586+1
  516. </pre></div>
  517. <p>A second -v gives more.
  518. </p>
  519. <p>By default the delete mode does not preserve a package directory after
  520. removing its links from &lsquo;<samp>${targetdir}</samp>&rsquo;, but this behavior can be
  521. changed if the -k option is passed:
  522. </p>
  523. <div class="example">
  524. <pre class="example">qi -d -k /usr/local/pkgs/lzip-1.21-i586+1
  525. </pre></div>
  526. <p>This means that the links to the package can be reactivated, later:
  527. </p>
  528. <div class="example">
  529. <pre class="example">cd /usr/local/pkgs &amp;&amp; graft -i lzip-1.21-i586+1
  530. </pre></div>
  531. <p>Removing package from a different location:
  532. </p>
  533. <div class="example">
  534. <pre class="example">qi -r /home/cthulhu -P /pkgs -t / -d xz-5.2.4-i586+1
  535. </pre></div>
  536. <p>Removing a package using standard input:
  537. </p>
  538. <div class="example">
  539. <pre class="example">echo &quot;vala-0.42.3-x86_64+1&quot; | qi -d -
  540. </pre></div>
  541. <p>This will match with the package directory.
  542. </p>
  543. <a name="Upgrading-packages"></a>
  544. <h3 class="section">4.4 Upgrading packages</h3>
  545. <a name="index-package-upgrade"></a>
  546. <p>The upgrade mode inherits the properties of the installation and removal
  547. process. To make sure that a package is updated, the package is installed
  548. in a temporary directory taking &lsquo;<samp>${packagedir}</samp>&rsquo; into account. Once
  549. the incoming package is pre-installed, qi can proceed to search and delete
  550. packages that have the same name (considered as previous ones). Finally,
  551. the package is re-installed at its final location and the temporary
  552. directory is removed.
  553. </p>
  554. <p>To upgrade a package, just type:
  555. </p>
  556. <div class="example">
  557. <pre class="example">qi -u gcc-9.0.1-i586+1.tlz
  558. </pre></div>
  559. <p>This will proceed to update &quot;gcc-9.0.1-i586+1&quot; removing other versions
  560. of &quot;gcc&quot; (if any).
  561. </p>
  562. <p>If you want to keep the package directories of versions found during the
  563. upgrade process, just pass:
  564. </p>
  565. <div class="example">
  566. <pre class="example">qi -u -k gcc-9.0.1-i586+1.tlz
  567. </pre></div>
  568. <p>To see the upgrade process (very verbose):
  569. </p>
  570. <div class="example">
  571. <pre class="example">qi -u -v gcc-9.0.1-i586+1.tlz
  572. </pre></div>
  573. <p>A second -v gives more.
  574. </p>
  575. <p>To force the upgrade of an existing package:
  576. </p>
  577. <div class="example">
  578. <pre class="example">qi -u -f gcc-9.0.1-i586+1.tlz
  579. </pre></div>
  580. <a name="Package-blacklist"></a>
  581. <h4 class="subsection">4.4.1 Package blacklist</h4>
  582. <a name="index-package-blacklist"></a>
  583. <p>To implement general package facilities, either to install, remove or
  584. maintain the hierarchy of packages in a clean manner, qi makes use of the
  585. pruning operation via graft(1):
  586. </p>
  587. <p>There is a risk if those are crucial packages for the proper functioning
  588. of the system, because it implies the deactivation of symbolic from the
  589. target directory, <em>especially</em> when transitioning an incoming package
  590. into its final location during upgrade.
  591. </p>
  592. <p>A blacklist of package names has been devised for the case where
  593. a user decides to upgrade all packages in the system, or
  594. just the crucial ones, such as the C library.
  595. </p>
  596. <p>The blacklist is related to the upgrade mode only, consists in installing
  597. a package instead of updating it or removing previous versions of it;
  598. the content of the package will be updated over the existing content at
  599. &lsquo;<samp>${packagedir}</samp>&rsquo;, while the existing links from
  600. &lsquo;<samp>${targetdir}</samp>&rsquo; will be preserved. A pruning of links will be
  601. carried out in order to re-link possible differences with the recent
  602. content, this helps to avoid leaving dead links in the target directory.
  603. </p>
  604. <p>Since the upgrade mode is also used to install a new package, the mechanism
  605. for blacklist is to install a declared package if it does not already
  606. exist. If it already exists, it is verified that the binary package is
  607. newer than the package directory in order to perform an update.
  608. </p>
  609. <p>Package names for the blacklist can be set from the configuration file.
  610. </p>
  611. <hr>
  612. <a name="Recipes"></a>
  613. <div class="header">
  614. <p>
  615. Next: <a href="#Order-files" accesskey="n" rel="next">Order files</a>, Previous: <a href="#Packages" accesskey="p" rel="prev">Packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  616. </div>
  617. <a name="Recipes-1"></a>
  618. <h2 class="chapter">5 Recipes</h2>
  619. <a name="index-recipes"></a>
  620. <p>A recipe is a file telling qi what to do. Most often, the recipe tells
  621. qi how to build a binary package from a source tarball.
  622. </p>
  623. <p>A recipe has two parts: a list of variable definitions and a list of
  624. sections. By convention, the syntax of a section is:
  625. </p>
  626. <div class="example">
  627. <pre class="example">section_name()
  628. {
  629. section lines
  630. }
  631. </pre></div>
  632. <p>The section name is followed by parentheses, one newline and an opening
  633. brace. The line finishing the section contains just a closing brace.
  634. The section names or the function names currently recognized are
  635. &lsquo;<samp>build</samp>&rsquo;.
  636. </p>
  637. <p>The &lsquo;<samp>build</samp>&rsquo; section is an augmented shell script. This is the main
  638. section (or <strong>shell function</strong>) which contains the instructions to
  639. build and produce a package.
  640. </p>
  641. <a name="Variables"></a>
  642. <h3 class="section">5.1 Variables</h3>
  643. <a name="index-variables"></a>
  644. <p>A &quot;variable&quot; is a <strong>shell variable</strong> defined either in <samp>qirc</samp>
  645. or in a recipe to represent a string of text, called the variable&rsquo;s
  646. &quot;value&quot;. These values are substituted by explicit request in the
  647. definitions of other variables or in calls to external commands.
  648. </p>
  649. <p>Variables can represent lists of file names, options to pass to
  650. compilers, programs to run, directories to look in for source files,
  651. directories to write output to, or anything else you can imagine.
  652. </p>
  653. <p>Definitions of variables in qi have four levels of precedence.
  654. Options which define variables from the command-line override those
  655. specified in the <samp>qirc</samp> file, while variables defined in the recipe
  656. override those specified in <samp>qirc</samp>, taking priority over those
  657. variables set by command-line options. Finally, the variables have
  658. default values if they are not defined anywhere.
  659. </p>
  660. <p>Options that set variables through the command-line can only reference
  661. variables defined in <samp>qirc</samp> and variables with default values.
  662. </p>
  663. <p>Definitions of variables in <samp>qirc</samp> can only reference variables
  664. previously defined in <samp>qirc</samp> and variables with default values.
  665. </p>
  666. <p>Definitions of variables in the recipe can only reference variables
  667. set by the command-line, variables previously defined in the recipe,
  668. variables defined in <samp>qirc</samp>, and variables with default values.
  669. </p>
  670. <a name="Special-variables"></a>
  671. <h3 class="section">5.2 Special variables</h3>
  672. <a name="index-special-variables"></a>
  673. <p>There are variables which can only be set using the command line options or
  674. via <samp>qirc</samp>, there are other special variables which can be defined or
  675. redefined in a recipe. See the following definitions:
  676. </p>
  677. <p>&lsquo;<samp>outdir</samp>&rsquo; is the directory where the packages produced are written.
  678. This variable can not be redefined in the recipe. Default sets to
  679. &lsquo;<samp>/var/cache/qi/packages</samp>&rsquo;.
  680. </p>
  681. <p>&lsquo;<samp>worktree</samp>&rsquo; is the working tree where archives, patches, and recipes
  682. are expected. This variable can not be redefined in the recipe. Default
  683. sets to &lsquo;<samp>/usr/src/qi</samp>&rsquo;.
  684. </p>
  685. <p>&lsquo;<samp>tardir</samp>&rsquo; is defined in the recipe to the directory where the tarball
  686. containing the source can be found. The full name of the tarball is
  687. composed as &lsquo;<samp>${tardir}/$tarname</samp>&rsquo;. Its value is available in the
  688. recipe as &lsquo;<samp>${tardir}</samp>&rsquo;; a value of . for &lsquo;<samp>tardir</samp>&rsquo; sets it to
  689. the value of CWD (Current Working Directory), this is where the recipe
  690. lives.
  691. </p>
  692. <p>&lsquo;<samp>arch</samp>&rsquo; is the architecture to compose the package name. Its value is
  693. available in the recipe as &lsquo;<samp>${arch}</samp>&rsquo;. Default value is the output
  694. of &lsquo;<samp>uname -m</samp>&rsquo;.
  695. </p>
  696. <p>&lsquo;<samp>jobs</samp>&rsquo; is the number of parallel jobs to pass to the compiler. Its
  697. value is available in the recipe as &lsquo;<samp>${jobs}</samp>&rsquo;. The default value
  698. is 1.
  699. </p>
  700. <p>The two variables &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; can be
  701. set in the recipe, as any other variable, but if they are not, qi uses
  702. default values for them when building a package.
  703. </p>
  704. <p>&lsquo;<samp>srcdir</samp>&rsquo; contains the source code to be compiled, and defaults to
  705. &lsquo;<samp>${program}-${version}</samp>&rsquo;. &lsquo;<samp>destdir</samp>&rsquo; is the place where the
  706. built package will be installed, and defaults to
  707. &lsquo;<samp>${TMPDIR}/package-${program}</samp>&rsquo;.
  708. </p>
  709. <p>If &lsquo;<samp>pkgname</samp>&rsquo; is left undefined, the special variable &lsquo;<samp>program</samp>&rsquo;
  710. is assigned by default. If &lsquo;<samp>pkgversion</samp>&rsquo; is left undefined, the
  711. special variable &lsquo;<samp>version</samp>&rsquo; is assigned by default.
  712. </p>
  713. <p>&lsquo;<samp>pkgname</samp>&rsquo; and &lsquo;<samp>pkgversion</samp>&rsquo; along with: &lsquo;<samp>version</samp>&rsquo;, &lsquo;<samp>arch</samp>&rsquo;,
  714. and &lsquo;<samp>release</samp>&rsquo; are used to produce the name of the package in the form:
  715. &lsquo;<samp>${pkgname}-${pkgversion}-${arch}+${release}.tlz</samp>&rsquo;
  716. </p>
  717. <p>A special variable called &lsquo;<samp>replace</samp>&rsquo; can be used to declare package
  718. names that will be replaced at the time of installation.
  719. </p>
  720. <p>A typical recipe contains the following variables:
  721. </p>
  722. <ul>
  723. <li> &lsquo;<samp>program</samp>&rsquo;: software name.
  724. <p>It matches the source name. It is also used to compose the name of the
  725. package if &lsquo;<samp>${pkgname}</samp>&rsquo; is not specified.
  726. </p>
  727. </li><li> &lsquo;<samp>version</samp>&rsquo;: software version.
  728. <p>It matches the source name. It is also used to compose the version of the
  729. package if &lsquo;<samp>${pkgversion}</samp>&rsquo; is not specified.
  730. </p>
  731. </li><li> &lsquo;<samp>arch</samp>&rsquo;: software architecture.
  732. <p>It is used to compose the architecture of the package in which it is
  733. build.
  734. </p>
  735. </li><li> &lsquo;<samp>release</samp>&rsquo;: release number.
  736. <p>This is used to reflect the release number of the package. It is
  737. recommended to increase this number after any significant change in
  738. the recipe or post-install script.
  739. </p></li></ul>
  740. <p>Obtaining sources over the network must be declared in the recipe using
  741. the &lsquo;<samp>fetch</samp>&rsquo; variable. Use double quotes for separated values.
  742. </p>
  743. <p>The variables &lsquo;<samp>netget</samp>&rsquo; and &lsquo;<samp>rsync</samp>&rsquo; can be defined in <samp>qirc</samp>
  744. to establish a network downloader in order to get the sources. If they
  745. are not defined, qi uses default values:
  746. </p>
  747. <p>&lsquo;<samp>netget</samp>&rsquo; is the general network downloader tool, defaults sets to
  748. &lsquo;<samp>wget -c -w1 -t3 --no-check-certificate</samp>&rsquo;.
  749. </p>
  750. <p>&lsquo;<samp>rsync</samp>&rsquo; is the network tool for sources containing the prefix for
  751. the RSYNC protocol, default sets to
  752. &lsquo;<samp>rsync -v -a -L -z -i --progress</samp>&rsquo;.
  753. </p>
  754. <p>The variable &lsquo;<samp>description</samp>&rsquo; is used to print the package description
  755. when a package is installed.
  756. </p>
  757. <p>A description has two parts: a brief description, and a long description.
  758. By convention, the syntax of &lsquo;<samp>description</samp>&rsquo; is:
  759. </p>
  760. <div class="example">
  761. <pre class="example">description=&quot;
  762. Brief description.
  763. Long description.
  764. &quot;
  765. </pre></div>
  766. <p>The first line of the value represented is a brief description of the
  767. software (called &quot;blurb&quot;). A blank line separates the <em>brief
  768. description</em> from the <em>long description</em>, which should contain a more
  769. descriptive description of the software.
  770. </p>
  771. <p>An example looks like:
  772. </p>
  773. <div class="example">
  774. <pre class="example">description=&quot;
  775. The GNU core utilities.
  776. The GNU core utilities are the basic file, shell and text manipulation
  777. utilities of the GNU operating system. These are the core utilities
  778. which are expected to exist on every operating system.
  779. &quot;
  780. </pre></div>
  781. <p>Please consider a length limit of 78 characters as maximum, because the same
  782. one would be used on the meta file creation. See
  783. <a href="#Recipes">The meta file</a> section.
  784. </p>
  785. <p>The &lsquo;<samp>homepage</samp>&rsquo; variable is used to declare the main site or home page:
  786. </p>
  787. <div class="example">
  788. <pre class="example">homepage=http://www.gnu.org/software/gcc
  789. </pre></div>
  790. <p>The variable &lsquo;<samp>license</samp>&rsquo; is used for license information<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>.
  791. Some code in the program can be covered by license A, license B, or
  792. license C. For &quot;separate licensing&quot; or &quot;heterogeneous licensing&quot;, we
  793. suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a conjunction
  794. (if that ever happens in a significant way), and comma for heterogeneous
  795. licensing. Comma would have lower precedence, plus added special terms.
  796. </p>
  797. <div class="example">
  798. <pre class="example">license=&quot;LGPL, GPL | Artistic + added permission&quot;
  799. </pre></div>
  800. <a name="Writing-recipes"></a>
  801. <h3 class="section">5.3 Writing recipes</h3>
  802. <a name="index-writing-recipes"></a>
  803. <p>Originally, qi was designed for the version 3 of Dragora GNU/Linux (this
  804. does not mean that you can&rsquo;t use it in another distribution, just that
  805. if you do you will need to test it for your selves). To aid this here
  806. are some references to well written recipes:
  807. </p>
  808. <p><a href="http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</a>.
  809. <a href="http://notabug.org/dragora/dragora/src/master/recipes">http://notabug.org/dragora/dragora/src/master/recipes</a>.
  810. </p>
  811. <p>You can also check the &quot;doc&quot; directory in the distribution sources of qi
  812. for some examples.
  813. </p>
  814. <a name="Building-packages"></a>
  815. <h3 class="section">5.4 Building packages</h3>
  816. <a name="index-package-build"></a>
  817. <p>A recipe is any valid regular file. Qi sets priorities for reading a
  818. recipe, the order in which qi looks for a recipe is:
  819. </p>
  820. <ol>
  821. <li> Current working directory.
  822. </li><li> If the specified path name does not contain &quot;recipe&quot; as the last
  823. component. Qi will complete it by adding &quot;recipe&quot; to the path name.
  824. </li><li> If the recipe is not in the current working directory, it will be
  825. searched under &lsquo;<samp>${worktree}/recipes</samp>&rsquo;. The last component will be
  826. completed adding &quot;recipe&quot; to the specified path name.
  827. </li></ol>
  828. <p>To build a single package, type:
  829. </p>
  830. <div class="example">
  831. <pre class="example">qi -b x-apps/xterm
  832. </pre></div>
  833. <p>Multiple jobs can be passed to the compiler to speed up the build process:
  834. </p>
  835. <div class="example">
  836. <pre class="example">qi -b -j3 x-apps/xterm
  837. </pre></div>
  838. <p>Update or install the package produced (if it is not already installed)
  839. when finish:
  840. </p>
  841. <div class="example">
  842. <pre class="example">qi -b -j3 -u x-apps/xterm
  843. </pre></div>
  844. <p>Only process a recipe but do not create the binary package:
  845. </p>
  846. <div class="example">
  847. <pre class="example">qi -b -n dict/aspell
  848. </pre></div>
  849. <p>The options -i or -u have no effect when -n is given.
  850. </p>
  851. <p>This can be useful to inspect the build process of recipe:
  852. </p>
  853. <p>qi -b -k -n dict/aspell 2&gt;&amp;1 | tee aspell-buildlog.txt
  854. </p>
  855. <p>The -k option could preserve the source directory and the destination
  856. directory for later inspection. A log file of the build process will be
  857. created redirecting both, standard error and standard output to tee(1).
  858. </p>
  859. <a name="Variables-from-the-environment"></a>
  860. <h3 class="section">5.5 Variables from the environment</h3>
  861. <a name="index-environment-variables"></a>
  862. <p>Qi has environment variables which can be used at build time:
  863. </p>
  864. <p>The variable <code>TMPDIR</code> sets the temporary directory for sources, which is
  865. used for package extractions (see <a href="#Examining-packages">Examining packages</a>) and is
  866. prepended to the value of &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; in
  867. build mode. By convention its default value is equal to
  868. &lsquo;<samp>/usr/src/qi/build</samp>&rsquo;.
  869. </p>
  870. <p>The variables <code>QICFLAGS</code>, <code>QICXXFLAGS</code>, and <code>QILDFLAGS</code> have
  871. no effect by default. The environment variables such as <code>CFLAGS</code>,
  872. <code>CXXFLAGS</code>, and <code>LDFLAGS</code> are unset at compile time:
  873. </p>
  874. <p>Recommended practice is to set variables in the command line of
  875. &lsquo;<samp>configure</samp>&rsquo; or <em>make(1)</em> instead of exporting to the
  876. environment. As follows:
  877. </p>
  878. <blockquote>
  879. <p>Variables not defined in a site shell script can be set in the environment
  880. passed to configure. However, some packages may run configure again
  881. during the build, and the customized values of these variables may be
  882. lost. In order to avoid this problem, you should set them in the
  883. configure command line, using &lsquo;<samp>VAR=value</samp>&rsquo;. For example:
  884. </p>
  885. <p><code>./configure CC=/usr/local2/bin/gcc</code>
  886. </p>
  887. <p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</a>
  888. </p></blockquote>
  889. <blockquote>
  890. <p>Indeed, while configure can notice the definition of CC in
  891. &lsquo;<samp>./configure CC=bizarre-cc</samp>&rsquo;, it is impossible to notice it in
  892. &lsquo;<samp>CC=bizarre-cc ./configure</samp>&rsquo;, which, unfortunately, is what most
  893. users do.
  894. </p>
  895. <p>[...]
  896. </p>
  897. <p>configure: error: changes in the environment can compromise the build.
  898. </p>
  899. <p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
  900. </p></blockquote>
  901. <blockquote>
  902. <p>It is not wise for makefiles to depend for their functioning on
  903. environment variables set up outside their control, since this would cause
  904. different users to get different results from the same makefile. This is
  905. against the whole purpose of most makefiles.
  906. </p>
  907. <p><a href="http://gnu.org/software/make/manual/make.html#Environment">http://gnu.org/software/make/manual/make.html#Environment</a>
  908. </p></blockquote>
  909. <a name="The-meta-file"></a>
  910. <h3 class="section">5.6 The meta file</h3>
  911. <a name="index-the-meta-file"></a>
  912. <p>The &quot;meta file&quot; is a regular file created during the build mode, it
  913. contains information about the package such as package name, package
  914. version, architecture, release, fetch address, description, and other
  915. minor data extracted from processed recipes. The name of the file is
  916. generated as &lsquo;<samp>${full_pkgname}.tlz.txt</samp>&rsquo;, and its purpose is to
  917. reflect essential information to the user without having to look inside
  918. the package content. The file format is also intended to be imported
  919. from other scripts.
  920. </p>
  921. <p>The content of a meta file looks like:
  922. </p>
  923. <div class="example">
  924. <pre class="example">#
  925. # The Bourne Again SHell.
  926. #
  927. # Bash is an sh-compatible shell that incorporates useful features from
  928. # the Korn shell (ksh) and C shell (csh). It is intended to conform to
  929. # the IEEE POSIX P1003.2/ISO 9945.2 shell and tools standard.
  930. #
  931. # It offers functional improvements over sh for both programming and
  932. # interactive use.
  933. #
  934. QICFLAGS=&quot;-g0 -Os -mtune=generic -pipe&quot;
  935. QICXXFLAGS=&quot;-g0 -Os -mtune=generic -pipe&quot;
  936. QILDFLAGS=&quot;-s&quot;
  937. pkgname=bash
  938. pkgversion=5.0
  939. arch=x86_64
  940. release=1
  941. blurb=&quot;The Bourne Again SHell.&quot;
  942. homepage=&quot;http://www.gnu.org/software/bash&quot;
  943. license=&quot;GPLv3+&quot;
  944. fetch=&quot;ftp://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz&quot;
  945. replace=&quot;&quot;
  946. </pre></div>
  947. <p>Package descriptions are extracted from the variable &lsquo;<samp>description</samp>&rsquo;
  948. where each line is interpreted literally and pre-formatted to fit in
  949. (exactly) <strong>80 columns</strong>, plus the character &lsquo;<samp>#</samp>&rsquo; and a space
  950. is prefixed to every line.
  951. </p>
  952. <p>In addition to the Special variables, there are implicit variables such as
  953. &lsquo;<samp>blurb</samp>&rsquo;:
  954. </p>
  955. <p>The &lsquo;<samp>blurb</samp>&rsquo; variable is related to the special variable
  956. &lsquo;<samp>description</samp>&rsquo;. Its value is composed using the first (substantial)
  957. line of &lsquo;<samp>description</samp>&rsquo;, mentioned as the &quot;brief description&quot;.
  958. </p>
  959. <hr>
  960. <a name="Order-files"></a>
  961. <div class="header">
  962. <p>
  963. Next: <a href="#Creating-packages" accesskey="n" rel="next">Creating packages</a>, Previous: <a href="#Recipes" accesskey="p" rel="prev">Recipes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  964. </div>
  965. <a name="Order-files-1"></a>
  966. <h2 class="chapter">6 Order files</h2>
  967. <a name="index-handling-build-order"></a>
  968. <p>The order mode has the purpose of resolving the build order through
  969. .order files. An order file contains a list of recipe names, by default
  970. does not perform any action other than to print a resolved list in
  971. descending order. For example, if <strong>a</strong> depends on <strong>b</strong> and
  972. <strong>c</strong>, and <strong>c</strong> depends on <strong>b</strong> as well, the file might
  973. look like:
  974. </p>
  975. <div class="example">
  976. <pre class="example">a: c b
  977. b:
  978. c: b
  979. </pre></div>
  980. <p>Each letter represents a recipe name, complete dependencies for
  981. the first recipe name are listed in descending order, which is
  982. printed from right to left, and removed from left to right:
  983. </p>
  984. <p><small>OUTPUT</small>
  985. </p>
  986. <div class="example">
  987. <pre class="example">b
  988. c
  989. a
  990. </pre></div>
  991. <p>Blank lines, colons and parentheses are simply ignored. Comment lines
  992. beginning with &lsquo;<samp>#</samp>&rsquo; are allowed.
  993. </p>
  994. <p>An order file could be used to build a series of packages, for example,
  995. if the content is:
  996. </p>
  997. <div class="example">
  998. <pre class="example"># Image handling libraries
  999. libs/libjpeg-turbo: devel/nasm
  1000. x-libs/jasper: libs/libjpeg-turbo
  1001. libs/tiff: libs/libjpeg-turbo
  1002. </pre></div>
  1003. <p>To proceed with each recipe, we can type:
  1004. </p>
  1005. <div class="example">
  1006. <pre class="example">qi -o imglibs.order | qi -b -i -
  1007. </pre></div>
  1008. <p>The output of &lsquo;<samp>qi -o imglibs.order</samp>&rsquo; tells to qi in which order it
  1009. should build the recipes:
  1010. </p>
  1011. <div class="example">
  1012. <pre class="example">devel/nasm
  1013. libs/libjpeg-turbo
  1014. x-libs/jasper
  1015. libs/tiff
  1016. </pre></div>
  1017. <hr>
  1018. <a name="Creating-packages"></a>
  1019. <div class="header">
  1020. <p>
  1021. Next: <a href="#Examining-packages" accesskey="n" rel="next">Examining packages</a>, Previous: <a href="#Order-files" accesskey="p" rel="prev">Order files</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  1022. </div>
  1023. <a name="Creating-packages-1"></a>
  1024. <h2 class="chapter">7 Creating packages</h2>
  1025. <a name="index-package-creation"></a>
  1026. <p>The &quot;creation mode&quot; is an internal function of qi to make new Qi compatible
  1027. compatible packages, the creation mode is selected by the -c option.
  1028. A package is produced using the contents of the Current Directory, and
  1029. the package file is written out.
  1030. </p>
  1031. <div class="example">
  1032. <pre class="example">Usage: qi -c [<var>OUTPUT/packagename.tlz</var>]...
  1033. </pre></div>
  1034. <p>The argument for the file name to be written must contain a fully
  1035. qualified named directory as the output directory where the package
  1036. produced will be written. The file name should be composed using the
  1037. full name: name-version-architecture+release.tlz
  1038. </p>
  1039. <p><small>EXAMPLE</small>
  1040. </p>
  1041. <div class="example">
  1042. <pre class="example">cd /usr/local/pkgs
  1043. cd claws-mail-3.17.1-x86_64+1
  1044. qi -c /var/cache/qi/packages/x86_64/local/claws-mail-3.17.1-x86_64+1.tlz
  1045. </pre></div>
  1046. <p>In this case, the package &quot;claws-mail-3.17.1-x86_64+1.tlz&quot; will be written
  1047. into &lsquo;<samp>/var/cache/qi/packages/x86_64/local/</samp>&rsquo;.
  1048. </p>
  1049. <p>All packages produced are complemented by a checksum file (.sha256).
  1050. </p>
  1051. <hr>
  1052. <a name="Examining-packages"></a>
  1053. <div class="header">
  1054. <p>
  1055. Next: <a href="#Exit-status" accesskey="n" rel="next">Exit status</a>, Previous: <a href="#Creating-packages" accesskey="p" rel="prev">Creating packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  1056. </div>
  1057. <a name="Examining-packages-1"></a>
  1058. <h2 class="chapter">8 Examining packages</h2>
  1059. <a name="index-package-examination"></a>
  1060. <p>The &quot;extraction mode&quot; serves to examine binary packages for debugging
  1061. purposes. The extraction mode is selected by the -x option. It
  1062. decompresses a package into a single directory, verifying its integrity
  1063. and preserving its properties.
  1064. </p>
  1065. <div class="example">
  1066. <pre class="example">Usage: qi -x [<var>packagename.tlz</var>]...
  1067. </pre></div>
  1068. <p><small>EXAMPLE</small>
  1069. </p>
  1070. <div class="example">
  1071. <pre class="example">qi -x mksh-R56c-x86_64+1.tlz
  1072. </pre></div>
  1073. <p>This action will put the content of &quot;mksh-R56c-x86_64+1.tlz&quot; into a
  1074. single directory, this will be a private directory for the user who
  1075. </p>
  1076. <p>requested the action, creation mode will be equal to <strong>u=rwx,g=,o=
  1077. (0700)</strong>. The package content will reside on this location, default
  1078. mask to deploy the content will be equal to
  1079. <strong>u=rwx,g=rwx,o=rwx (0000)</strong>.
  1080. </p>
  1081. <p>The creation of the custom directory is influenced by the value of the
  1082. <code>TMPDIR</code> variable.
  1083. </p>
  1084. <hr>
  1085. <a name="Exit-status"></a>
  1086. <div class="header">
  1087. <p>
  1088. Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Examining-packages" accesskey="p" rel="prev">Examining packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  1089. </div>
  1090. <a name="Exit-status-1"></a>
  1091. <h2 class="chapter">9 Exit status</h2>
  1092. <a name="index-exit-codes"></a>
  1093. <p>All the exit codes are described in this chapter.
  1094. </p>
  1095. <dl compact="compact">
  1096. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  1097. <dd><p>Successful completion (no errors).
  1098. </p>
  1099. </dd>
  1100. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  1101. <dd><p>Minor common errors:
  1102. </p>
  1103. <ul class="no-bullet">
  1104. <li>- Help usage on illegal options or required arguments.
  1105. </li><li>- Program needed by qi (prerequisite) is not available.
  1106. </li></ul>
  1107. </dd>
  1108. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  1109. <dd><p>Command execution error:
  1110. </p>
  1111. <p>This code is used to return the evaluation of external commands and shell
  1112. arguments in case of error.
  1113. </p>
  1114. </dd>
  1115. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  1116. <dd><p>Integrity check error for compressed files.
  1117. </p>
  1118. <p>Compressed files means:
  1119. </p>
  1120. <ul class="no-bullet">
  1121. <li>- Tarball files from tar(1).
  1122. Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
  1123. .tar.xz, .txz
  1124. </li><li>- Tarball files from tarlz(1).
  1125. Supported extensions: .tar.lz, .tlz
  1126. </li><li>- Zip files from unzip(1).
  1127. Supported extensions: .zip, .ZIP
  1128. </li><li>- Gzip files from gzip(1).
  1129. Supported extensions: .gz, .Z
  1130. </li><li>- Bzip2 files from bzip2(1).
  1131. Supported extensions: .bz2
  1132. </li><li>- Lzip files from lzip(1).
  1133. Supported extensions: .lz
  1134. </li><li>- Xz files from xz(1).
  1135. Supported extensions: .xz
  1136. </li></ul>
  1137. </dd>
  1138. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  1139. <dd><p>File empty, not regular, or expected.
  1140. </p>
  1141. <p>Commonly, it is expected:
  1142. </p>
  1143. <ul class="no-bullet">
  1144. <li>- An argument for the mode of operation.
  1145. </li><li>- A readable file or directory.
  1146. </li><li>- A binary package (.tlz).
  1147. </li><li>- A valid recipe.
  1148. </li><li>- An order file (.order).
  1149. </li><li>- A protocol supported by the network downloader tool.
  1150. </li><li>- A checksum file (.sha256).
  1151. </li></ul>
  1152. </dd>
  1153. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  1154. <dd><p>Empty or not defined variable:
  1155. </p>
  1156. <p>This code is used to report empty or undefined variables; usually,
  1157. variables coming from a recipe or assigned arrays that are tested.
  1158. </p>
  1159. </dd>
  1160. <dt>&lsquo;<samp>6</samp>&rsquo;</dt>
  1161. <dd><p>Package already installed:
  1162. </p>
  1163. <p>The package directory for an incoming .tlz package already exists.
  1164. </p>
  1165. </dd>
  1166. <dt>&lsquo;<samp>10</samp>&rsquo;</dt>
  1167. <dd><p>Network manager error:
  1168. </p>
  1169. <p>This code is used if the network downloader tool fails for some reason.
  1170. </p></dd>
  1171. </dl>
  1172. <hr>
  1173. <a name="Index"></a>
  1174. <div class="header">
  1175. <p>
  1176. Previous: <a href="#Exit-status" accesskey="p" rel="prev">Exit status</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
  1177. </div>
  1178. <a name="Index-1"></a>
  1179. <h2 class="unnumbered">Index</h2>
  1180. <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
  1181. &nbsp;
  1182. <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
  1183. &nbsp;
  1184. <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
  1185. &nbsp;
  1186. <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
  1187. &nbsp;
  1188. <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
  1189. &nbsp;
  1190. <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
  1191. &nbsp;
  1192. <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
  1193. &nbsp;
  1194. <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
  1195. &nbsp;
  1196. <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
  1197. &nbsp;
  1198. <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
  1199. &nbsp;
  1200. <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
  1201. &nbsp;
  1202. </td></tr></table>
  1203. <table class="index-cp" border="0">
  1204. <tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
  1205. <tr><td colspan="4"> <hr></td></tr>
  1206. <tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr>
  1207. <tr><td></td><td valign="top"><a href="#index-configuration-file">configuration file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-qirc-file">The qirc file</a></td></tr>
  1208. <tr><td colspan="4"> <hr></td></tr>
  1209. <tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr>
  1210. <tr><td></td><td valign="top"><a href="#index-environment-variables">environment variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1211. <tr><td></td><td valign="top"><a href="#index-exit-codes">exit codes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Exit-status">Exit status</a></td></tr>
  1212. <tr><td colspan="4"> <hr></td></tr>
  1213. <tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr>
  1214. <tr><td></td><td valign="top"><a href="#index-handling-build-order">handling build order</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Order-files">Order files</a></td></tr>
  1215. <tr><td colspan="4"> <hr></td></tr>
  1216. <tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr>
  1217. <tr><td></td><td valign="top"><a href="#index-introduction">introduction</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Introduction">Introduction</a></td></tr>
  1218. <tr><td></td><td valign="top"><a href="#index-invocation">invocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Invoking-qi">Invoking qi</a></td></tr>
  1219. <tr><td colspan="4"> <hr></td></tr>
  1220. <tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr>
  1221. <tr><td></td><td valign="top"><a href="#index-managing-packages">managing packages</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
  1222. <tr><td colspan="4"> <hr></td></tr>
  1223. <tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr>
  1224. <tr><td></td><td valign="top"><a href="#index-package-blacklist">package blacklist</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
  1225. <tr><td></td><td valign="top"><a href="#index-package-build">package build</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1226. <tr><td></td><td valign="top"><a href="#index-package-conflicts">package conflicts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
  1227. <tr><td></td><td valign="top"><a href="#index-package-creation">package creation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Creating-packages">Creating packages</a></td></tr>
  1228. <tr><td></td><td valign="top"><a href="#index-package-de_002dinstallation">package de-installation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
  1229. <tr><td></td><td valign="top"><a href="#index-package-examination">package examination</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Examining-packages">Examining packages</a></td></tr>
  1230. <tr><td></td><td valign="top"><a href="#index-package-installation">package installation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
  1231. <tr><td></td><td valign="top"><a href="#index-package-upgrade">package upgrade</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
  1232. <tr><td colspan="4"> <hr></td></tr>
  1233. <tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr>
  1234. <tr><td></td><td valign="top"><a href="#index-recipes">recipes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1235. <tr><td colspan="4"> <hr></td></tr>
  1236. <tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr>
  1237. <tr><td></td><td valign="top"><a href="#index-special-variables">special variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1238. <tr><td colspan="4"> <hr></td></tr>
  1239. <tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr>
  1240. <tr><td></td><td valign="top"><a href="#index-the-meta-file">the meta file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1241. <tr><td colspan="4"> <hr></td></tr>
  1242. <tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr>
  1243. <tr><td></td><td valign="top"><a href="#index-variables">variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1244. <tr><td colspan="4"> <hr></td></tr>
  1245. <tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr>
  1246. <tr><td></td><td valign="top"><a href="#index-writing-recipes">writing recipes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
  1247. <tr><td colspan="4"> <hr></td></tr>
  1248. </table>
  1249. <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
  1250. &nbsp;
  1251. <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
  1252. &nbsp;
  1253. <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
  1254. &nbsp;
  1255. <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
  1256. &nbsp;
  1257. <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
  1258. &nbsp;
  1259. <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
  1260. &nbsp;
  1261. <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
  1262. &nbsp;
  1263. <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
  1264. &nbsp;
  1265. <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
  1266. &nbsp;
  1267. <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
  1268. &nbsp;
  1269. <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
  1270. &nbsp;
  1271. </td></tr></table>
  1272. <div class="footnote">
  1273. <hr>
  1274. <h4 class="footnotes-heading">Footnotes</h4>
  1275. <h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
  1276. <p>The official guide for Graft can be found at
  1277. <a href="http://peters.gormand.com.au/Home/tools/graft/graft.html">http://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
  1278. <h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
  1279. <p>The proposal for &lsquo;<samp>license</samp>&rsquo; was made by Richard M. Stallman at
  1280. <a href="http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</a>.</p>
  1281. </div>
  1282. <hr>
  1283. </body>
  1284. </html>
  1285. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  1286. <html>
  1287. <head>
  1288. <title>Graft</title>
  1289. </head>
  1290. <body>
  1291. <center>
  1292. <h1><em>Graft</em> - a package management utility</h1>
  1293. </center>
  1294. <h4>Prepared by Peter Samuel
  1295. <a href="mailto:peter.r.samuel@gmail.com"><tt>&lt;peter.r.samuel@gmail.com&gt;</tt></a></h4>
  1296. <h4>$Revision: 2.16 $</h4>
  1297. <h4>$Date: 2018/04/16 14:54:07 $</h4>
  1298. <blockquote>
  1299. <p> <em><strong>graft:</strong> To insert (a graft) in a branch or stem
  1300. of another tree; to propagate by insertion in another stock; also, to
  1301. insert a graft upon. To implant a portion of (living flesh or skin) in
  1302. a lesion so as to form an organic union. To join (one thing) to another
  1303. as if by grafting, so as to bring about a close union.</em> </p>
  1304. </blockquote>
  1305. <hr>
  1306. <h2><a name="contents">Contents</a></h2>
  1307. <ul>
  1308. <li> <a href="#intro">Introduction</a>
  1309. <li> <a href="#rationale">Rationale</a>
  1310. <li> <a href="#research">Research</a>
  1311. <li> <a href="#design">Design</a>
  1312. <ul>
  1313. <li> <a href="#precedence">Control file precedence &amp; conflict resolution</a>
  1314. </ul>
  1315. <li> <a href="#history">History</a>
  1316. <li> <a href="#installation">Installation</a>
  1317. <ul>
  1318. <li> <a href="#rpm_and_deb">Creating RPM and DEB packages</a>
  1319. <li> <a href="#gotchas">Grafting <em>Graft</em> and
  1320. <em>Perl</em> - the bootstrap problem</a>
  1321. </ul>
  1322. <li> <a href="#using-graft">Using <em>Graft</em></a>
  1323. <ul>
  1324. <li> <a href="#compiling-packages">Compiling
  1325. Packages</a>
  1326. <li><a href="#usage"><em>Graft</em> command line
  1327. options</a>
  1328. <ol>
  1329. <li><a href="#graft-i">Install</a>
  1330. <li><a href="#graft-d">Delete</a>
  1331. <li><a href="#graft-p">Prune</a>
  1332. <li><a href="#graft-L">Information</a>
  1333. </ol>
  1334. <li> <a href="#testing">Testing the <em>Graft</em>
  1335. Installation</a>
  1336. <li> <a href="#installing-packages">Installing
  1337. Packages</a>
  1338. <li> <a href="#bypass">Bypassing package
  1339. directories</a>
  1340. <li> <a href="#include">Including specific files
  1341. and/or directories</a>
  1342. <li> <a href="#exclude">Excluding specific files
  1343. and/or directories</a>
  1344. <li> <a href="#config_dirs">Grafting configuration files</a>
  1345. <li><a href="#partial-graft">Grafting part of a
  1346. package</a>
  1347. <li> <a href="#deleting-packages">Deleting and/or
  1348. Upgrading Packages</a>
  1349. <li><a href="#transitioning">Transitioning a package to
  1350. <em>Graft</em> control</a>
  1351. <li> <a href="#conflicts">Conflict Processing</a>
  1352. <li> <a href="#exitstatus">Exit Status</a>
  1353. </ul>
  1354. <li> <a href="#other-pkg-tools">Using <em>Graft</em> with
  1355. other package management tools</a>
  1356. <li> <a href="#availability">Availability</a>
  1357. <li> <a href="#license">License</a>
  1358. </ul>
  1359. <hr>
  1360. <h2><a name="intro">Introduction</a></h2>
  1361. <p> <em>Graft</em> provides a mechanism for managing multiple packages
  1362. under a single directory hierarchy. It was inspired by both <em>Depot</em>
  1363. (Carnegie Mellon University) and <em>Stow</em> (Bob Glickstein). </p>
  1364. <p> For the purposes of this discussion a <em>package</em> is defined as
  1365. a suite of programs and files that make up an individual product. For
  1366. example, the <em>package</em> known as <em>gcc</em> consists of the compiler
  1367. and preprocessor programs, include files, manual pages and any other
  1368. associated file or program. The concept of a <em>package</em> should not be
  1369. confused with some vendor's definitions that are - by this definition -
  1370. actually collections of <em>packages</em>. </p>
  1371. <p> Special thanks to Gordon Rowell, Charles Butcher, Charlie Brady,
  1372. Robert Maldon and Matias A. Fonzo for design suggestions and contributions.
  1373. </p>
  1374. <hr>
  1375. <h2><a name="rationale">Rationale</a></h2>
  1376. <p> In any reasonably large environment, many software packages will be
  1377. installed. The installation location for these packages usually follows
  1378. one of three rationales - each with its own advantages and drawbacks: </p>
  1379. <ol>
  1380. <li> <p> Each package is isolated from all other packages by
  1381. installing it into a self contained directory tree. All binaries,
  1382. manual pages, library and configuration files are stored under
  1383. a single directory tree. This directory tree contains NO other
  1384. files which are not the exclusive domain of the package in
  1385. question. </p>
  1386. <p> This method makes package demarcation obvious. As each
  1387. package is self contained, identification of any file within a
  1388. package is immediately apparent. </p>
  1389. <p> Multiple versions of packages can be installed fairly easily
  1390. to accommodate acceptance testing of new versions and/or legacy
  1391. systems. </p>
  1392. <p> However, the use of individual package directories can
  1393. lead to VERY long <strong>$PATH</strong> and <strong>$MANPATH</strong> environment
  1394. variables. Some shells may not be able to handle such long
  1395. variables. Whenever a new package is added, each user MUST
  1396. update their <strong>$PATH</strong> and <strong>$MANPATH</strong> to make the package
  1397. available. </p>
  1398. <li> <p> Packages are installed under a common directory tree.
  1399. Binaries for all packages are grouped in a single directory,
  1400. manual pages for all packages in another directory and so on.
  1401. </p>
  1402. <p> This method eliminates the need for continually updating long
  1403. <strong>$PATH</strong> variables for each user. As soon as a package is
  1404. placed into the common '<tt>bin</tt>' directory it is immediately
  1405. available to all users (after a shell rehash if necessary). </p>
  1406. <p> However, when a package is to be updated it is often very
  1407. difficult to isolate all the files related to a particular
  1408. package if they are intermingled with unrelated files. </p>
  1409. <li> <p> A combination of methods (1) and (2). </p>
  1410. </ol>
  1411. <p> In an effort to maximise the advantages and minimise the
  1412. disadvantages, <em>Depot</em>, <em>Stow</em> and <em>Graft</em> adopt a similar
  1413. philosophy: </p>
  1414. <blockquote>
  1415. <p> Packages are installed in self contained directory trees and
  1416. symbolic links from a common area are made to the package files. </p>
  1417. </blockquote>
  1418. <p> This approach allows multiple versions of the same package to co-exist
  1419. on the one system. One version is the commonly available version and
  1420. symbolic links will be made to this version. New versions can be tested
  1421. and once acceptable can replace the current commonly available version.
  1422. Older versions can still be used for legacy systems by using the
  1423. '<em>real</em>' path name to the package instead of the '<em>common</em>'
  1424. path name. </p>
  1425. <p> The size and complexity of environment variables such as <strong>$PATH</strong>
  1426. and <strong>$MANPATH</strong> is minimised because only the common area is
  1427. required. Any special cases can also be accommodated but these will
  1428. usually be in the minority when compared with the number of commonly
  1429. available packages. </p>
  1430. <hr>
  1431. <h2><a name="research">Research</a></h2>
  1432. <p> <strong>Note:</strong> Development of <em>Graft</em> began in late 1996. The
  1433. comments regarding the packages listed below reflect their functionality
  1434. and behaviour at that time and may not necessarily reflect their current
  1435. functionality and behaviour. </p>
  1436. <p> As stated earlier, <em>Graft</em> was inspired by <em>Depot</em> and
  1437. <em>Stow</em>. Both these systems were examined and finally rejected for
  1438. the following reasons: </p>
  1439. <dl>
  1440. <dt> <em>Depot</em>
  1441. <a href="ftp://ftp.andrew.cmu.edu/pub/depot/depot.tar.gz">ftp://ftp.andrew.cmu.edu/pub/depot/depot.tar.gz</a>
  1442. <dd> <p> <em>Depot</em> is very flexible yet cumbersome. </p>
  1443. <p> It requires a database file to be created which
  1444. provides a snapshot of the current state of both the package
  1445. repository and the <em>Depot</em> target. It is possible to
  1446. inadvertently destroy the package repository if the database
  1447. is damaged. </p>
  1448. <p> <em>Depot</em> assumes &quot;<em>ownership</em>&quot; of the
  1449. target area, making it almost impossible to accommodate
  1450. packages that are not under the control of <em>Depot</em>.
  1451. ("<em>Ownership</em>" in this case means that <em>Depot</em>
  1452. assumes ALL files in the target area will be under the
  1453. control of <em>Depot</em>. It does not imply that <em>Depot</em>
  1454. modifies Unix file permissions). </p>
  1455. <p> Because of <em>Depot</em>'s assumed <em>ownership</em> it is
  1456. difficult for other packages not under the control of
  1457. <em>Depot</em> to be placed in the same target area. </p>
  1458. <p> <em>Depot</em> attempts to impose a fixed package repository
  1459. relative to the package target. It assumes that all
  1460. packages will be stored under
  1461. '<tt><em>dir</em>/depot/<em>package</em></tt>' and the target
  1462. will be '<tt><em>dir</em></tt>'. This can be overridden on
  1463. the command line but the internals of <em>Depot</em> make
  1464. this mechanism cumbersome. </p>
  1465. <p> <em>Depot</em> is written in C and there are many source
  1466. files in its distribution. Local modifications would be
  1467. difficult to quickly implement and test. </p>
  1468. <dt> <em>Stow</em>
  1469. <a href="https://www.gnu.org/software/stow/">https://www.gnu.org/software/stow/</a>
  1470. <dd> <p> <em>Stow</em> is a stateless system. It requires no
  1471. database or configuration information. </p>
  1472. <p> Like <em>Depot</em>, it assumes that the package repository
  1473. will be stored under '<tt><em>dir</em>/stow/<em>package</em></tt>'
  1474. and the target will be '<tt><em>dir</em></tt>'. This can be
  1475. overridden on the command line and works well during the
  1476. install phase. </p>
  1477. <p> <em>Stow</em> assumes &quot;<em>ownership</em>&quot;
  1478. of the target area, making it difficult to accommodate
  1479. packages that are not under the control of <em>Stow</em>.
  1480. ("<em>Ownership</em>" in this case means that <em>Stow</em>
  1481. assumes ALL files in the target area will be under the
  1482. control of <em>Stow</em>. It does not imply that <em>Stow</em>
  1483. modifies Unix file permissions). </p>
  1484. <p> Because of <em>Stow</em>'s assumed <em>ownership</em>
  1485. it is difficult for other packages not under the control
  1486. of <em>Stow</em> to be placed in the same target area. When
  1487. deleting packages, <em>Stow</em> examines everything in the
  1488. target directory - whether it is associated with the package
  1489. it is trying to delete or not. This can be time consuming and
  1490. potentially dangerous as empty directories are also removed
  1491. - even empty directories that do not belong to the package
  1492. being removed. </p>
  1493. <p> <em>Stow</em> has a clever feature of <em>folding</em> and
  1494. <em>unfolding</em> directories. It attempts to optimise the
  1495. number of symbolic links by making links to directories if
  1496. the directory is only associated with a single package. If
  1497. at a later date <em>Stow</em> discovers another package that
  1498. needs that directory it will <em>unfold</em> that directory
  1499. into a collection of symbolic links to files rather than
  1500. a single symbolic link to the directory. <em>Stow</em> will
  1501. <em>fold</em> the directory when removing packages if the
  1502. remainder of the directory is only concerned with a single
  1503. package. While clever, this feature is probably a waste of
  1504. time and effort. It means that the entire package target
  1505. must be scanned to determine package ownership of links and
  1506. as packages will usually be replaced by newer versions a
  1507. directory <em>fold</em> will probably be short lived. </p>
  1508. <p> <em>Stow</em> will sometimes miss potential conflicts when
  1509. run in <em>show only</em> mode. The conflicts may occur when a
  1510. directory is unfolded and will not show up in <em>show only</em>
  1511. mode. </p>
  1512. <p> <em>Stow</em>'s author suggests that packages be compiled
  1513. such that they refer to files in the target location rather
  1514. than the actual package installation directory. This approach
  1515. precludes the use of multiple versions of packages with
  1516. different configuration and/or library files. </p>
  1517. <p> <em>Stow</em> is written in <em>Perl</em> and is only a
  1518. few hundred lines of code so local modifications can be
  1519. accommodated. However there are very few comments in the
  1520. code which makes the process of modification difficult. </p>
  1521. </dl>
  1522. <p> Since the release of <em>Graft</em> 1.6, the existence of yet another
  1523. packaging program has been brought to the author's attention. </p>
  1524. <dl>
  1525. <dt> <em>Encap</em>
  1526. <a href="http://www.ks.uiuc.edu/Development/Computers/docs/sysadmin/Build/encap.html">http://www.ks.uiuc.edu/Development/Computers/docs/sysadmin/Build/encap.html</a>
  1527. <dd> <p> <em>Encap</em> grew out of work begun at the University
  1528. of Illinois Champaign-Urbana. It has the same underlying
  1529. philosophy as <em>Depot</em>, <em>Stow</em> and <em>Graft</em> -
  1530. encapsulate packages into self contained directories and use
  1531. symbolic links to make them visible in a common location. </p>
  1532. <p> <em>Encap</em> uses a combination of a <em>csh</em> wrapper
  1533. and a <em>Perl</em> program to accomplish its work. Like both
  1534. <em>Depot</em> and <em>Stow</em>, <em>Encap</em> assumes that all
  1535. compiled packages will live under a single directory hierarchy
  1536. - by default '<tt><em>dir</em>/encap/<em>package</em></tt>'. It
  1537. then attempts to create a symbolic link tree for ALL the
  1538. packages under this area. There doesn't appear to be any
  1539. easy way to support the quick addition or removal of a single
  1540. package. </p>
  1541. <p> A new release of <em>Encap</em> incorporating many new
  1542. features was expected to be available in early 1997, however
  1543. no release greater than version 1.2 has been forthcoming. </p>
  1544. <p> One good feature of <em>Encap</em> is the ability to exclude
  1545. specific files from the package tree. This concept has been
  1546. incorporated into <em>Graft</em> 1.7 and above. </p>
  1547. </dl>
  1548. <p> Since the release of <em>Graft</em> 2.3, the existence of
  1549. several another packaging programs have been brought to the author's
  1550. attention. Rather than outline their features and whether or not the
  1551. author feels they are superior (or inferior) to <em>Graft</em>, a reference
  1552. to each package and a brief description is given and further research
  1553. is left as an exercise for the reader: </p>
  1554. <dl>
  1555. <dt> <em>stowES</em>
  1556. <dd>
  1557. <pre>
  1558. <a href="https://os.inf.tu-dresden.de/~adam/stowES/">https://os.inf.tu-dresden.de/~adam/stowES/</a>
  1559. </pre>
  1560. <p> &quot;<em>stowES (stow Enhancement Script) is
  1561. a Perl script which tries to ease the use of the "stow"
  1562. packaging program and software which can be compiled and
  1563. installed with autoconf. It automates the compilation and
  1564. installation of software packages and provides some useful
  1565. functions to maintain your stow packages (e.g., list packages,
  1566. check packages for integrity, etc.).</em>&quot; </p>
  1567. <dt> <em>opt_depot</em>
  1568. <dd>
  1569. <pre>
  1570. <a href="https://github.com/jonabbey/opt_depot">https://github.com/jonabbey/opt_depot</a>
  1571. </pre>
  1572. <p> &quot;<em>opt_depot is a suite of Perl scripts which makes
  1573. it easy to manage installed software across a wide range
  1574. of client systems. opt_depot makes it possible to keep all
  1575. files associated with a program together in one directory,
  1576. so installation and de-installation is simple. opt_depot is
  1577. easy to manage, and provides a scheme for installing software
  1578. in a truly portable fashion; packages may be installed locally
  1579. on client systems, or kept in a central package archive for
  1580. NFS access. </em>&quot;</p>
  1581. <p> This site also has links to several other package
  1582. management utilities, including <em>Graft</em>. </p>
  1583. <dt> <em>relink</em>
  1584. <dd>
  1585. <pre>
  1586. <a href="http://sourceforge.net/projects/relink/">http://sourceforge.net/projects/relink/</a>
  1587. </pre>
  1588. <p> &quot;<em>relink is a package management tool for
  1589. organization and management of software packages. It should
  1590. run on any UNIX platform that runs PERL. Similar tools
  1591. include: rpm(REDHAT/Mandrake), pkgadd(Slackware/SUN),
  1592. stow(GNU) and depot(CMU)</em>&quot; </p>
  1593. <dt> <em>univSrcPkg</em>
  1594. <dd>
  1595. <pre>
  1596. <a href="http://freecode.com/articles/the-universal-source-package">http://freecode.com/articles/the-universal-source-package</a>
  1597. </pre>
  1598. <p> <a href="mailto:bud@sistema.it">Bud Bruegger</a> has written
  1599. a brief paper outlining his thoughts on a &quot;<em>Universal Source
  1600. Package</em>&quot; solution. </p>
  1601. <p> This site also has links to other package management
  1602. programs and similar items of interest. </p>
  1603. </dl>
  1604. <hr>
  1605. <h2><a name="design">Design</a></h2>
  1606. <p> This brings us to <em>Graft</em>. <em>Graft</em> has been designed to
  1607. use the best features of <em>Depot</em>, <em>Stow</em> and <em>Encap</em>
  1608. while maintaining as simple a mechanism as possible. The principles of
  1609. <em>Graft</em> are: </p>
  1610. <ul>
  1611. <li> <p> <em>Graft</em> will allow packages to be <em>grafted</em>
  1612. from any directory to any other directory. Default
  1613. <tt>installation</tt> and <tt>target</tt> directories will be
  1614. used but can easily be overridden on the command line. </p>
  1615. <li> <p> <em>Graft</em> will log its actions to a log file. The
  1616. log file can be specified on the command line. If not specified
  1617. on the command line a default log file will be used. </p>
  1618. <li> <p> <em>Graft</em> will NOT create symbolic links to
  1619. directories. If a directory does not exist in the target tree
  1620. it will be created (with the same ownership and permissions as
  1621. the original if desired). </p>
  1622. <li> <p> <em>Graft</em> will create symbolic links with full
  1623. pathnames rather than relative pathnames. This allows easy
  1624. identification of true package locations and facilitates block
  1625. movement of a target tree without the need for <em>Graft</em>
  1626. deletion and re-installation. </p>
  1627. <li> <p> <em>Graft</em> will cease installation of a package if a
  1628. conflict arises. A conflict is defined as one of the following
  1629. conditions: </p>
  1630. <ul>
  1631. <li> If the package object is a directory and the
  1632. target object exists but is not a directory.
  1633. <li> If the package object is not a directory and the
  1634. target object exists and is not a symbolic link.
  1635. <li> If the package object is not a directory and the
  1636. target object exists and is a symbolic link to
  1637. something other than the package object.
  1638. <li> If the package directory contains a
  1639. <tt>.graft-config</tt> file and the target object exists
  1640. but does not match the 32-bit CRC of the package object.
  1641. </ul>
  1642. <li> <p> Installation conflicts will always be reported. Conflicts
  1643. will be reported to standard error. </p>
  1644. <li> <p> <em>Graft</em> will attempt to display all possible
  1645. operations when asked, even when asked not to perform the
  1646. operations. </p>
  1647. <li> <p> <em>Graft</em> will not delete directories when
  1648. uninstalling. <em>Graft</em> will print an appropriate message if an
  1649. empty directory results and leave the deletion for the operator
  1650. to perform outside the scope of <em>Graft</em>'s operations. This
  1651. ensures that <em>place holder</em> directories that may be
  1652. used by other packages are not inadvertently removed. This
  1653. feature can be permanently disabled by setting a flag in the
  1654. <tt>Makefile</tt>. It can also be temporarily disabled using a
  1655. command line option. </p>
  1656. <li> <p> <em>Graft</em> will continue to delete the remainder of
  1657. a package after a conflict arises. This maximises the amount of
  1658. deletion that can be performed. </p>
  1659. <li> <p> Deletion conflicts will always be reported. Conflicts
  1660. will be reported to standard error. </p>
  1661. <li> <p> <em>Graft</em> will only concern itself with files
  1662. relating to the package at hand. This will allow other packages
  1663. to be placed in the target area without fear of intervention by
  1664. <em>Graft</em>. </p>
  1665. <li> <p> <em>Graft</em> will only allow the superuser to install
  1666. or delete packages. This feature can be permanently disabled by
  1667. setting a flag in the <tt>Makefile</tt> or it may be overridden
  1668. by a command line option. </p>
  1669. <li> <p> If the file <tt>.nograft</tt> exists in any package
  1670. directory, <em>Graft</em> will bypass that directory and any
  1671. subdirectories during installation. The name of this file is
  1672. specified in the <tt>Makefile</tt>. </p>
  1673. <li> <p> When installing a directory tree, if the file
  1674. <tt>.graft-exclude</tt> exists in any package directory,
  1675. <em>Graft</em> will assume that the file contains a list of
  1676. file and/or directory names - one per line - which correspond
  1677. to files and/or directories in the directory containing the
  1678. <tt>.graft-exclude</tt> file. These files and/or directories
  1679. will NOT be <em>grafted</em>. The name of this file is specified
  1680. in the <tt>Makefile</tt>. </p>
  1681. <p> The <tt>.nograft</tt> file takes priority over the
  1682. <tt>.graft-exclude</tt> file. </p>
  1683. <li> <p> When installing a directory tree, if the file
  1684. <tt>.graft-include</tt> exists in any package directory,
  1685. <em>Graft</em> will assume that the file contains a list of
  1686. file and/or directory names - one per line - which correspond
  1687. to files and/or directories in the directory containing the
  1688. <tt>.graft-include</tt> file. ONLY the files and/or directories
  1689. listed in the <tt>.graft-include</tt> will be <em>grafted</em>. The
  1690. name of this file is specified in the <tt>Makefile</tt>. </p>
  1691. <p> The <tt>.graft-exclude</tt> file takes priority over the
  1692. <tt>.graft-include</tt> file. </p>
  1693. <li> <p> When installing a directory tree, if the file
  1694. <tt>.graft-config</tt> exists in a package directory, the contents
  1695. of the directory will be <strong>copied</strong> to the target
  1696. directory. If the target files exists and is in conflict with the
  1697. package file then the package file will be copied into the target
  1698. directory as <tt>file<em>.new</em></tt>. </p>
  1699. <p> The <tt>.graft-include</tt> file takes priority over the
  1700. <tt>.graft-config</tt> file. </p>
  1701. <li> <p> If the file <tt>.nograft</tt> exists in any package
  1702. directory, it will be ignored and <em>Graft</em> will continue
  1703. processing the directory and any subdirectories during
  1704. deletion. </p>
  1705. <li> <p> If the file <tt>.graft-exclude</tt> exists in any
  1706. package directory, its contents will be ignored and <em>Graft</em>
  1707. will continue processing the directory and any subdirectories
  1708. during deletion. </p>
  1709. <li> <p> If the file <tt>.graft-include</tt> exists in any
  1710. package directory, its contents will be ignored and <em>Graft</em>
  1711. will continue processing the directory and any subdirectories
  1712. during deletion. </p>
  1713. <li> <p> If the file <tt>.graft-config</tt> exists in any
  1714. package directory, during deletion matching files in the target
  1715. directory will not be deleted however any
  1716. <tt>file<em>.new</em></tt> files will be deleted. </p>
  1717. <li> <p> As an aid to transitioning systems to <em>Graft</em>,
  1718. <em>Graft</em> will allow conflicting files to be pruned. This
  1719. pruning can take the form of a file rename or a file removal
  1720. depending on either a <tt>Makefile</tt> flag or a command line
  1721. option. If file removal is selected and the file is a non-empty
  1722. directory, it will be renamed instead. </p>
  1723. <li> <p> If the file <tt>.nograft</tt> exists in any package
  1724. directory, it will be ignored and <em>Graft</em> will continue
  1725. processing the directory and any subdirectories during
  1726. pruning. </p>
  1727. <li> <p> If the file <tt>.graft-exclude</tt> exists in any
  1728. package directory, its contents will be ignored and <em>Graft</em>
  1729. will continue processing the directory and any subdirectories
  1730. during pruning. </p>
  1731. <li> <p> If the file <tt>.graft-include</tt> exists in any
  1732. package directory, its contents will be ignored and <em>Graft</em>
  1733. will continue processing the directory and any subdirectories
  1734. during pruning. </p>
  1735. <li> <p> If the file <tt>.graft-config</tt> exists in any
  1736. package directory, the files in the directory will be ignored
  1737. during pruning. Sub-directories will continue to be processed
  1738. appropriately. </p>
  1739. </ul>
  1740. <h3><a name="precedence">Control file precedence &amp; conflict resolution</a></h3>
  1741. <p> As stated above, the various <em>Graft</em> control files have the
  1742. following precedence, from highest to lowest: </p>
  1743. <pre>
  1744. .nograft &gt; .graft-exclude &gt; .graft-include &gt; .graft-config
  1745. </pre>
  1746. <p> The following table summarises the activities of <em>Graft</em> when
  1747. various control files are present: </p>
  1748. <center>
  1749. <table summary="Control File Precedence" border=2 cellpadding=3>
  1750. <tr>
  1751. <th colspan=5>
  1752. Install
  1753. </th>
  1754. </tr>
  1755. <tr>
  1756. <th>
  1757. <em>Target</em>
  1758. </th>
  1759. <th>
  1760. <em>.nograft</em>
  1761. </th>
  1762. <th>
  1763. <em>.graft-exclude</em>
  1764. </th>
  1765. <th>
  1766. <em>.graft-include</em>
  1767. </th>
  1768. <th>
  1769. <em>.graft-config</em>
  1770. </th>
  1771. </tr>
  1772. <tr>
  1773. <td>
  1774. does not exist
  1775. </td>
  1776. <td>
  1777. IGNORE
  1778. </td>
  1779. <td>
  1780. IGNORE
  1781. </td>
  1782. <td>
  1783. SYMLINK
  1784. </td>
  1785. <td>
  1786. COPY
  1787. </td>
  1788. </tr>
  1789. <tr>
  1790. <td>
  1791. symlink to source
  1792. </td>
  1793. <td>
  1794. IGNORE
  1795. </td>
  1796. <td>
  1797. IGNORE
  1798. </td>
  1799. <td>
  1800. NOP
  1801. </td>
  1802. <td>
  1803. DELETE &amp; COPY
  1804. </td>
  1805. </tr>
  1806. <tr>
  1807. <td>
  1808. symlink to other
  1809. </td>
  1810. <td>
  1811. IGNORE
  1812. </td>
  1813. <td>
  1814. IGNORE
  1815. </td>
  1816. <td>
  1817. CONFLICT
  1818. </td>
  1819. <td>
  1820. N/A
  1821. </td>
  1822. </tr>
  1823. <tr>
  1824. <td>
  1825. symlink to other (crc match)
  1826. </td>
  1827. <td>
  1828. N/A
  1829. </td>
  1830. <td>
  1831. N/A
  1832. </td>
  1833. <td>
  1834. N/A
  1835. </td>
  1836. <td>
  1837. NOP
  1838. </td>
  1839. </tr>
  1840. <tr>
  1841. <td>
  1842. symlink to other (crc diff)
  1843. </td>
  1844. <td>
  1845. N/A
  1846. </td>
  1847. <td>
  1848. N/A
  1849. </td>
  1850. <td>
  1851. N/A
  1852. </td>
  1853. <td>
  1854. COPY.new
  1855. </td>
  1856. </tr>
  1857. <tr>
  1858. <td>
  1859. file
  1860. </td>
  1861. <td>
  1862. IGNORE
  1863. </td>
  1864. <td>
  1865. IGNORE
  1866. </td>
  1867. <td>
  1868. CONFLICT
  1869. </td>
  1870. <td>
  1871. N/A
  1872. </td>
  1873. </tr>
  1874. <tr>
  1875. <td>
  1876. file (crc match)
  1877. </td>
  1878. <td>
  1879. N/A
  1880. </td>
  1881. <td>
  1882. N/A
  1883. </td>
  1884. <td>
  1885. N/A
  1886. </td>
  1887. <td>
  1888. NOP
  1889. </td>
  1890. </tr>
  1891. <tr>
  1892. <td>
  1893. file (crc diff)
  1894. </td>
  1895. <td>
  1896. N/A
  1897. </td>
  1898. <td>
  1899. N/A
  1900. </td>
  1901. <td>
  1902. N/A
  1903. </td>
  1904. <td>
  1905. COPY.new
  1906. </td>
  1907. </tr>
  1908. <tr>
  1909. <td>
  1910. not a file
  1911. </td>
  1912. <td>
  1913. IGNORE
  1914. </td>
  1915. <td>
  1916. IGNORE
  1917. </td>
  1918. <td>
  1919. CONFLICT
  1920. </td>
  1921. <td>
  1922. CONFLICT
  1923. </td>
  1924. </tr>
  1925. <tr>
  1926. <th colspan=5>
  1927. Delete
  1928. </th>
  1929. </tr>
  1930. <tr>
  1931. <th>
  1932. <em>Target</em>
  1933. </th>
  1934. <th>
  1935. <em>.nograft</em>
  1936. </th>
  1937. <th>
  1938. <em>.graft-exclude</em>
  1939. </th>
  1940. <th>
  1941. <em>.graft-include</em>
  1942. </th>
  1943. <th>
  1944. <em>.graft-config</em>
  1945. </th>
  1946. </tr>
  1947. <tr>
  1948. <td>
  1949. does not exist
  1950. </td>
  1951. <td>
  1952. NOP
  1953. </td>
  1954. <td>
  1955. NOP
  1956. </td>
  1957. <td>
  1958. NOP
  1959. </td>
  1960. <td>
  1961. NOP
  1962. </td>
  1963. </tr>
  1964. <tr>
  1965. <td>
  1966. symlink to source
  1967. </td>
  1968. <td>
  1969. DELETE
  1970. </td>
  1971. <td>
  1972. DELETE
  1973. </td>
  1974. <td>
  1975. DELETE
  1976. </td>
  1977. <td>
  1978. DELETE &amp; DELETE.new
  1979. </td>
  1980. </tr>
  1981. <tr>
  1982. <td>
  1983. symlink to other
  1984. </td>
  1985. <td>
  1986. CONFLICT
  1987. </td>
  1988. <td>
  1989. CONFLICT
  1990. </td>
  1991. <td>
  1992. CONFLICT
  1993. </td>
  1994. <td>
  1995. N/A
  1996. </td>
  1997. </tr>
  1998. <tr>
  1999. <td>
  2000. symlink to other (crc match)
  2001. </td>
  2002. <td>
  2003. N/A
  2004. </td>
  2005. <td>
  2006. N/A
  2007. </td>
  2008. <td>
  2009. N/A
  2010. </td>
  2011. <td>
  2012. DELETE.new
  2013. </td>
  2014. </tr>
  2015. <tr>
  2016. <td>
  2017. symlink to other (crc diff)
  2018. </td>
  2019. <td>
  2020. N/A
  2021. </td>
  2022. <td>
  2023. N/A
  2024. </td>
  2025. <td>
  2026. N/A
  2027. </td>
  2028. <td>
  2029. NOP
  2030. </td>
  2031. </tr>
  2032. <tr>
  2033. <td>
  2034. file
  2035. </td>
  2036. <td>
  2037. NOTE
  2038. </td>
  2039. <td>
  2040. NOTE
  2041. </td>
  2042. <td>
  2043. CONFLICT
  2044. </td>
  2045. <td>
  2046. N/A
  2047. </td>
  2048. </tr>
  2049. <tr>
  2050. <td>
  2051. file (crc match)
  2052. </td>
  2053. <td>
  2054. N/A
  2055. </td>
  2056. <td>
  2057. N/A
  2058. </td>
  2059. <td>
  2060. N/A
  2061. </td>
  2062. <td>
  2063. DELETE.new
  2064. </td>
  2065. </tr>
  2066. <tr>
  2067. <td>
  2068. file (crc diff)
  2069. </td>
  2070. <td>
  2071. N/A
  2072. </td>
  2073. <td>
  2074. N/A
  2075. </td>
  2076. <td>
  2077. N/A
  2078. </td>
  2079. <td>
  2080. NOP
  2081. </td>
  2082. </tr>
  2083. <tr>
  2084. <td>
  2085. not a file
  2086. </td>
  2087. <td>
  2088. CONFLICT
  2089. </td>
  2090. <td>
  2091. CONFLICT
  2092. </td>
  2093. <td>
  2094. CONFLICT
  2095. </td>
  2096. <td>
  2097. CONFLICT
  2098. </td>
  2099. </tr>
  2100. <tr>
  2101. <th colspan=5>
  2102. Prune
  2103. </th>
  2104. </tr>
  2105. <tr>
  2106. <th>
  2107. <em>Target</em>
  2108. </th>
  2109. <th>
  2110. <em>.nograft</em>
  2111. </th>
  2112. <th>
  2113. <em>.graft-exclude</em>
  2114. </th>
  2115. <th>
  2116. <em>.graft-include</em>
  2117. </th>
  2118. <th>
  2119. <em>.graft-config</em>
  2120. </th>
  2121. </tr>
  2122. <tr>
  2123. <td>
  2124. does not exist
  2125. </td>
  2126. <td>
  2127. NOP
  2128. </td>
  2129. <td>
  2130. NOP
  2131. </td>
  2132. <td>
  2133. NOP
  2134. </td>
  2135. <td>
  2136. N/A
  2137. </td>
  2138. </tr>
  2139. <tr>
  2140. <td>
  2141. symlink to source
  2142. </td>
  2143. <td>
  2144. NOP
  2145. </td>
  2146. <td>
  2147. NOP
  2148. </td>
  2149. <td>
  2150. NOP
  2151. </td>
  2152. <td>
  2153. N/A
  2154. </td>
  2155. </tr>
  2156. <tr>
  2157. <td>
  2158. symlink to other
  2159. </td>
  2160. <td>
  2161. PRUNE
  2162. </td>
  2163. <td>
  2164. PRUNE
  2165. </td>
  2166. <td>
  2167. PRUNE
  2168. </td>
  2169. <td>
  2170. N/A
  2171. </td>
  2172. </tr>
  2173. <tr>
  2174. <td>
  2175. file
  2176. </td>
  2177. <td>
  2178. PRUNE
  2179. </td>
  2180. <td>
  2181. PRUNE
  2182. </td>
  2183. <td>
  2184. PRUNE
  2185. </td>
  2186. <td>
  2187. N/A
  2188. </td>
  2189. </tr>
  2190. <tr>
  2191. <td>
  2192. not a file
  2193. </td>
  2194. <td>
  2195. PRUNE
  2196. </td>
  2197. <td>
  2198. PRUNE
  2199. </td>
  2200. <td>
  2201. PRUNE
  2202. </td>
  2203. <td>
  2204. N/A
  2205. </td>
  2206. </tr>
  2207. </table>
  2208. </center>
  2209. <hr>
  2210. <h2><a name="history">History</a></h2>
  2211. <p> Development on <em>Graft</em> began in October 1996. The initial design
  2212. used a configuration file to map the installed location of each package to
  2213. its target directory (that is the directory in which the symbolic links
  2214. would be created). Work proceeded at a regular pace and by November 1997
  2215. <em>Graft</em> version <em>2.1</em> was released. In this, and all
  2216. subsequent versions, the configuration file had been removed in favour of
  2217. using default source and target directories. </p>
  2218. <p> No further work was performed until September 2000 when the concept of
  2219. bypassing or including files and directories using <tt>.nograft</tt> or
  2220. <tt>.graft-include</tt> files was introduced in <em>Graft</em> version
  2221. <em>2.3</em>. </p>
  2222. <p> Again nothing changed until February 2002 when Rod Whitby identified a
  2223. bug in the handling of <tt>.graft-include</tt> files. Several other users
  2224. (Peter Bray, Robert Maldon and others) also reported some deprecation
  2225. warnings when using <em>Graft</em> with <em>Perl</em> version
  2226. <em>5.6.0</em>. <em>Graft</em> version <em>2.4</em> was the end of
  2227. <em>Graft</em> development for over a decade. </p>
  2228. <p> In May 2015 Matias A. Fonzo contacted the author wishing to use
  2229. <em>Graft</em> in the
  2230. <a href="http://www.dragora.org/">Dragora GNU/Linux</a>
  2231. distribution. Matias' usage of <em>Graft</em> lead to <em>Graft</em>
  2232. version <em>2.5</em> in June 2015 whereby the <tt>-P</tt> command line
  2233. option was silently ignored if the effective user was not root. </p>
  2234. <p> Since the release of <em>Graft</em> version <em>2.4</em> the author's
  2235. <em>Perl</em> code had improved somewhat so <em>Graft</em> version
  2236. <em>2.6</em> released in July 2015 represented a major clean up of coding
  2237. style and internals. No new behaviours or features were added to the
  2238. <em>2.6</em> release. </p>
  2239. <p> Matias made some more suggestions and improvements up to and including
  2240. <em>Graft</em> version <em>2.16</em> in April 2018. These changes added
  2241. the <tt>.graft-config</tt> control file, the <tt>-r /rootdir</tt> option for
  2242. specifying a new root directory, the <tt>-L</tt> option for displaying
  2243. default locations as well as introducing some tighter controls on the
  2244. messages and exit status of <em>Graft</em> under various conditions. </p>
  2245. <hr>
  2246. <h2><a name="installation">Installation</a></h2>
  2247. <p> Before installing <em>Graft</em> you'll need <em>Perl</em>
  2248. 5.<em>x</em>. <em>Graft</em> version 2.<em>x</em> requires features only
  2249. available with <em>Perl</em> 5.<em>x</em> and will not run with
  2250. <em>Perl</em> 4.<em>x</em>. </p>
  2251. <p> Your operating system and its file system(s) should also support
  2252. symbolic links. If you can't make symbolic links then you can't use
  2253. <em>Graft</em>! <em>Graft</em> will exit gracefully if your version of
  2254. <em>Perl</em> does not support symbolic links. It will also exit gracefully
  2255. if you attempt to <em>graft</em> a package into a file system that does not
  2256. support symbolic links - from a Linux <tt>ext4</tt> file system into an
  2257. <tt>vfat</tt> file system for example. </p>
  2258. <p> <em>Graft</em> has been written to ensure it uses <em>Perl</em> modules
  2259. that are considered part of the core <em>Perl</em> distribution. However it
  2260. may be possible that you're using a home grown installation of
  2261. <em>Perl</em> or some distribution that doesn't have the same <em>Perl</em>
  2262. modules as the author's development environment. </p>
  2263. <p> If this is the case you'll see compile failures for the following modules
  2264. if they are unavailable: </p>
  2265. <pre>
  2266. File::Basename
  2267. Getopt::Long
  2268. </pre>
  2269. <p> You will not be able to install <em>Graft</em> until these modules are
  2270. available. </p>
  2271. <p> You may also see run-time failures when using <em>Graft</em> with
  2272. <tt>.graft-config</tt> files if the following modules are unavailable: </p>
  2273. <pre>
  2274. Compress::Raw::Zlib (<em>used in install and delete modes</em>)
  2275. File::Copy (<em>only used in install mode</em>)
  2276. </pre>
  2277. <p> If you don't have these modules and you do not intend to use
  2278. <tt>.graft-config</tt> files then you can continue to use <em>Graft</em>
  2279. without issue. </p>
  2280. <p> Follow these instructions to install <em>Graft</em>: </p>
  2281. <ol>
  2282. <li> <p> Unpack the gzipped <em>Graft</em> distribution: </p>
  2283. <pre>
  2284. gunzip -c graft-2.16.tar.gz | tar xvf -
  2285. </pre>
  2286. <li> <p> change directories to the <em>Graft</em> distribution
  2287. directory: </p>
  2288. <pre>
  2289. cd graft-2.16
  2290. </pre>
  2291. <li> <p> Create an writable version of the <tt>Makefile</tt> by
  2292. running the command </p>
  2293. <pre>
  2294. make -f Makefile.dist
  2295. </pre>
  2296. <p> You'll see output similar to </p>
  2297. <pre>
  2298. cp Makefile.dist Makefile
  2299. chmod 644 Makefile
  2300. ######################################################
  2301. # #
  2302. # You'll now need to modify the Makefile #
  2303. # variables to suit your local conditions. #
  2304. # #
  2305. ######################################################
  2306. make: *** [Makefile] Error 1
  2307. </pre>
  2308. <p> You can ignore the error message. That is just there to
  2309. prevent the creation of the <em>graft</em> executable before you've
  2310. made your site specific configurations to the <tt>Makefile</tt>.
  2311. </p>
  2312. <li> <p> Edit the <tt>Makefile</tt>. The following variables should be
  2313. modified to suit your local requirements: </p>
  2314. <dl>
  2315. <dt>
  2316. <pre>
  2317. <strong>PACKAGEDIR</strong> = /usr/local/pkgs
  2318. <strong>TARGETDIR</strong> = /usr/local
  2319. </pre>
  2320. <dd> <p> These two variables control your default
  2321. package <tt>installation</tt> and <tt>target</tt>
  2322. directories. Most sites will probably choose to
  2323. install packages under a common <tt>installation</tt>
  2324. directory and then <em>graft</em> them into a common
  2325. <tt>target</tt> directory. </p>
  2326. <p> If no specific <tt>target</tt> directory is
  2327. given on the command line, <em>Graft</em> will use
  2328. the default value specified by <strong>TARGETDIR</strong>. If
  2329. a <tt>target</tt> directory is given on the command
  2330. line but is not fully qualified, the value specified
  2331. by <strong>TARGETDIR</strong> will be prepended to the command
  2332. line argument. </p>
  2333. <p> Package names provided to <em>Graft</em> that are
  2334. not fully qualified will have the value specified
  2335. by <strong>PACKAGEDIR</strong> prepended to the command line
  2336. arguments. </p>
  2337. <dt>
  2338. <pre>
  2339. <strong>TOP</strong> = $(PACKAGEDIR)/graft-$(VERSION)
  2340. <strong>BIN</strong> = $(TOP)/bin
  2341. <strong>MAN</strong> = $(TOP)/man
  2342. <strong>DOC</strong> = $(TOP)/doc
  2343. </pre>
  2344. <dd> <p> There should be no need to modify these
  2345. values unless you wish to install <em>Graft</em> into
  2346. a directory that is different from your default
  2347. package installation directory. If you do modify
  2348. <strong>TOP</strong> you should not change the values of
  2349. <strong>BIN</strong>, <strong>MAN</strong> and <strong>DOC</strong>. If you feel
  2350. you must change these values then perhaps you've
  2351. misunderstood the concept behind <em>Graft</em> so a
  2352. re-read of this document may be in order. </p>
  2353. <dt>
  2354. <pre>
  2355. <strong>PERL</strong> = /usr/bin/perl
  2356. </pre>
  2357. <dd> <p> This variable refers to the location
  2358. of the <em>Perl</em> 5.<em>x</em> that will be used by
  2359. the <em>Graft</em> executable. If you plan on
  2360. <em>grafting</em> <em>Perl</em> then this value should
  2361. be the <em>grafted</em> location of <em>Perl</em>
  2362. rather than the installation location of <em>Perl</em>.
  2363. If you are using an operating system that comes with
  2364. <em>Perl</em> 5.<em>x</em> - such as RedHat or Ubuntu
  2365. Linux - then you don't need to worry about
  2366. <em>grafting</em> <em>Perl</em> so the value of
  2367. <strong>PERL</strong> should reflect its installed
  2368. location. </p>
  2369. <p> Most Unix, Linux and other Unix like operating
  2370. systems ship with <em>Perl</em> these days so
  2371. modifying this value is probably unnecessary. </p>
  2372. <dt>
  2373. <pre>
  2374. <strong>BUILDPERL</strong> = $(PERL)
  2375. </pre>
  2376. <dd> <p> <em>Perl</em> is required during the
  2377. <tt>make</tt>. You'll only need to change this if
  2378. the current installed location of <em>Perl</em> is
  2379. different to the future <em>grafted</em> location of
  2380. <em>Perl</em>. </p>
  2381. <dt>
  2382. <pre>
  2383. <strong>LOGFILE</strong> = /var/log/graft
  2384. </pre>
  2385. <dd> <p> <em>Graft</em> logs all of its actions to a log
  2386. file. Modify the value of <strong>LOGFILE</strong> to suit
  2387. your local needs. An alternative name can be
  2388. specified on the command line. </p>
  2389. <p> If you want logging disabled by default, set the
  2390. value of <strong>LOGFILE</strong> to <tt>/dev/null</tt>. </p>
  2391. <dt>
  2392. <pre>
  2393. <strong>GRAFT-IGNORE</strong> = .nograft
  2394. <strong>GRAFT-EXCLUDE</strong> = .graft-exclude
  2395. <strong>GRAFT-INCLUDE</strong> = .graft-include
  2396. <strong>GRAFT-CONFIG</strong> = .graft-config
  2397. </pre>
  2398. <dd> <p> These variables hold the names of the
  2399. special <em>Graft</em> files that control whether or
  2400. not subdirectories or files are <em>grafted</em>. If
  2401. you change these values, try to choose obvious names.
  2402. If you want the files to appear in a simple directory
  2403. listing, do not use file names that begin with a
  2404. dot &quot;.&quot; character. </p>
  2405. <dt>
  2406. <pre>
  2407. <strong>GRAFT-NEVER</strong> =
  2408. </pre>
  2409. <dd> <p> This variable holds the names of the
  2410. files and/or directories that should never be
  2411. <em>grafted</em>. Typically these may be source code
  2412. repositories as used by systems such as
  2413. <em>CVS</em>, or perhaps lockfiles. The default
  2414. value is empty but if you wish to specify values,
  2415. simply add them to the variable using only
  2416. whitespace as a separator. For example: </p>
  2417. <pre>
  2418. GRAFT-NEVER = CVS RCS SCCS .lock
  2419. </pre>
  2420. <dt>
  2421. <pre>
  2422. <strong>NEVERGRAFT</strong> = 0
  2423. </pre>
  2424. <dd> <p> If this variable is set to <strong>1</strong>,
  2425. the files and/or directories specified by
  2426. <strong>GRAFT-NEVER</strong> will be automatically excluded
  2427. from the <em>grafted</em> directory. </p>
  2428. <p> If this variable is set to <strong>0</strong>, the files
  2429. and/or directories specified by <strong>GRAFT-NEVER</strong>
  2430. will be not be excluded from the <em>grafted</em>
  2431. directory. </p>
  2432. <p> The sense of this value is reversed by use of
  2433. the <strong>-C</strong> command line option.
  2434. <p> The automatic exclusion is bypassed completely
  2435. if the <em>grafted</em> directory contains either
  2436. a <tt>.nograft</tt> or <tt>.graft-include</tt>
  2437. file. </p>
  2438. <dt>
  2439. <pre>
  2440. <strong>PRUNED-SUFFIX</strong> = .pruned
  2441. </pre>
  2442. <dd> <p> This variable sets the suffix name of
  2443. <em>pruned</em> files. <em>Pruned</em> files will be
  2444. renamed <em>filename</em><tt>.pruned</tt>. </p>
  2445. <dt>
  2446. <pre>
  2447. <strong>CONFIG-SUFFIX</strong> = .new
  2448. </pre>
  2449. <dd> <p> This variable sets the suffix name of configuration
  2450. files that will be copied to the target directory when
  2451. the target object is in conflict with the package
  2452. object. The files will be copied as
  2453. <em>filename</em><tt>.new</tt>. </p>
  2454. <dt>
  2455. <pre>
  2456. <strong>SUPERUSER</strong> = 1
  2457. </pre>
  2458. <dd> <p> If this variable is set to <strong>1</strong> only
  2459. the superuser can <em>install</em>, <em>delete</em>
  2460. or <em>prune</em> packages. This can be overridden
  2461. by the use of the <strong>-u</strong> command line
  2462. option. If this variable is set to <strong>0</strong>,
  2463. superuser privileges are not required and the
  2464. <strong>-u</strong> override command line option is
  2465. disabled. </p>
  2466. <p> If you are installing a private copy of
  2467. <em>Graft</em> to manage packages in your home
  2468. directory you should set <strong>SUPERUSER</strong> to
  2469. <strong>0</strong>. </p>
  2470. <p> If you're using <em>Graft</em> to manage a global
  2471. set of packages you should set <strong>SUPERUSER</strong>
  2472. to <strong>1</strong>. </p>
  2473. <dt>
  2474. <pre>
  2475. <strong>PRESERVEPERMS</strong> = 0
  2476. </pre>
  2477. <dd> <p> When <em>grafting</em> packages, <em>Graft</em>
  2478. will create new directories as required. By setting
  2479. <strong>PRESERVEPERMS</strong> to <strong>1</strong>,
  2480. the original user id, group id and file modes will be
  2481. carried over to the new directory. This variable is
  2482. used only if <strong>SUPERUSER</strong> is set to
  2483. <strong>1</strong>. The sense of this variable can be
  2484. reversed using the <strong>-P</strong> command line
  2485. option. </p>
  2486. <dt>
  2487. <pre>
  2488. <strong>DELETEOBJECTS</strong> = 0
  2489. </pre>
  2490. <dd> <p> When deleting <em>grafted</em> packages,
  2491. <em>Graft</em> may leave empty directories. Setting
  2492. <strong>DELETEOBJECTS</strong> to <strong>1</strong>
  2493. will allow <em>Graft</em> to delete these directories.
  2494. If <strong>DELETEOBJECTS</strong> is <strong>0</strong>
  2495. then <em>Graft</em> will display an appropriate message
  2496. reminding the user that a directory has been emptied.
  2497. The sense of this variable can be reversed using the
  2498. <strong>-D</strong> command line option. </p>
  2499. <p> It's probably not good practise to set this value
  2500. to <strong>1</strong> as some directories may be used
  2501. as place holders by a number of different packages. If
  2502. the value is set to <strong>0</strong> deletion of
  2503. directories can be forced via the <strong>-D</strong>
  2504. command line option. </p>
  2505. <p> When pruning packages, <em>graft</em> can either
  2506. remove conflicting files or rename them. If
  2507. <strong>DELETEOBJECTS</strong> is set to
  2508. <strong>1</strong> the default prune action will be to
  2509. delete conflicting objects. If
  2510. <strong>DELETEOBJECTS</strong> is set to
  2511. <strong>0</strong> the default prune action will be to
  2512. rename conflicting objects. The sense of this variable
  2513. can be reversed using the <strong>-D</strong> command
  2514. line option. </p>
  2515. </dl>
  2516. <p> Save your changes and exit from the editor. </p>
  2517. <li> <p> Remove any existing executables by running: </p>
  2518. <pre>
  2519. make clean
  2520. </pre>
  2521. <p> You should see output similar to: </p>
  2522. <pre>
  2523. rm -f graft
  2524. </pre>
  2525. <li> <p> Create the <em>Graft</em> executable by running: </p>
  2526. <pre>
  2527. make
  2528. </pre>
  2529. <p> You should see output similar to: </p>
  2530. <pre>
  2531. /usr/bin/perl -wc graft.pl
  2532. graft.pl syntax OK
  2533. sed \
  2534. -e 's#xCONFIG-SUFFIXx#.new#g' \
  2535. -e 's#xDELETEOBJECTSx#0#g' \
  2536. -e 's#xGRAFT-CONFIGx#.graft-config#g' \
  2537. -e 's#xGRAFT-EXCLUDEx#.graft-exclude#g' \
  2538. -e 's#xGRAFT-IGNOREx#.nograft#g' \
  2539. -e 's#xGRAFT-INCLUDEx#.graft-include#g' \
  2540. -e 's#xGRAFT-NEVERx##g' \
  2541. -e 's#xLOGFILEx#/var/log/graft#g' \
  2542. -e 's#xNEVERGRAFTx#0#g' \
  2543. -e 's#xPACKAGEDIRx#/usr/local/pkgs#g' \
  2544. -e 's#xPERLx#/usr/bin/perl#g' \
  2545. -e 's#xPRESERVEPERMSx#0#g' \
  2546. -e 's#xPRUNED-SUFFIXx#.pruned#g' \
  2547. -e 's#xSUPERUSERx#1#g' \
  2548. -e 's#xTARGETDIRx#/usr/local#g' \
  2549. &lt; graft.pl &gt; graft
  2550. chmod +x graft
  2551. /usr/bin/perl -wc graft
  2552. graft syntax OK
  2553. if [ -n &quot;&quot; ]; \
  2554. then \
  2555. AUTOIGNORE=1; \
  2556. else \
  2557. AUTOIGNORE=0; \
  2558. fi; \
  2559. sed \
  2560. -e &quot;s#xAUTOIGNOREx#$AUTOIGNORE#g&quot; \
  2561. -e 's#xCONFIG-SUFFIXx#.new#g' \
  2562. -e 's#xDELETEOBJECTSx#0#g' \
  2563. -e 's#xDOCx#/usr/local/pkgs/graft-2.16/doc#g' \
  2564. -e 's#xGRAFT-CONFIGx#.graft-config#g' \
  2565. -e 's#xGRAFT-EXCLUDEx#.graft-exclude#g' \
  2566. -e 's#xGRAFT-IGNOREx#.nograft#g' \
  2567. -e 's#xGRAFT-INCLUDEx#.graft-include#g' \
  2568. -e 's#xGRAFT-NEVERx##g' \
  2569. -e 's#xLOGFILEx#/var/log/graft#g' \
  2570. -e 's#xNEVERGRAFTx#0#g' \
  2571. -e 's#xPACKAGEDIRx#/usr/local/pkgs#g' \
  2572. -e 's#xPERLx#/usr/bin/perl#g' \
  2573. -e 's#xPRESERVEPERMSx#0#g' \
  2574. -e 's#xPRUNED-SUFFIXx#.pruned#g' \
  2575. -e 's#xSUPERUSERx#1#g' \
  2576. -e 's#xTARGETDIRx#/usr/local#g' \
  2577. -e 's#xVERSIONx#2.16#g' \
  2578. &lt; graft.man &gt; graft.1
  2579. </pre>
  2580. <li> <p> If you're using the <em>automounter</em> under Solaris
  2581. 2.<em>x</em>, the installation process may not be able to directly
  2582. create the directory specified by <strong>TOP</strong>. If this is the case
  2583. then manually create this directory using whatever procedures
  2584. are appropriate for your operating system. </p>
  2585. <p> For example, if the <tt>/usr/local</tt> mount point is under the
  2586. control of the <em>automounter</em> via an entry in the
  2587. <tt>auto_pkgs</tt> map: </p>
  2588. <pre>
  2589. * nfshost:/export/sparc-SunOS-5.5.1/usr/local/&amp;
  2590. </pre>
  2591. <p> you'll need to create the <em>Graft</em> installation directory
  2592. by executing the following command on the machine <em>nfshost</em>:
  2593. </p>
  2594. <pre>
  2595. mkdir /export/sparc-SunOS-5.5.1/usr/local/pkgs/graft-2.16
  2596. </pre>
  2597. <li> <p> Install the <em>Graft</em> executable, manual page and
  2598. documentation by executing: </p>
  2599. <pre>
  2600. make install
  2601. </pre>
  2602. <p> You should see output similar to: </p>
  2603. <pre>
  2604. mkdir -p /usr/local/pkgs/graft-2.16/bin
  2605. cp graft /usr/local/pkgs/graft-2.16/bin
  2606. for i in graft.1; \
  2607. do \
  2608. manpage=`basename $i`; \
  2609. man=`expr $i : '.*\.\(.\)'`; \
  2610. mkdir -p /usr/local/pkgs/graft-2.16/man/man$man; \
  2611. cp $i /usr/local/pkgs/graft-2.16/man/man$man/$manpage; \
  2612. chmod 644 /usr/local/pkgs/graft-2.16/man/man$man/$manpage; \
  2613. done
  2614. for i in graft.html graft.pdf graft.ps graft.txt; \
  2615. do \
  2616. mkdir -p /usr/local/pkgs/graft-2.16/doc; \
  2617. cp doc/$i /usr/local/pkgs/graft-2.16/doc; \
  2618. chmod 644 /usr/local/pkgs/graft-2.16/doc/$i; \
  2619. touch /usr/local/pkgs/graft-2.16/doc/.nograft; \
  2620. done
  2621. </pre>
  2622. </ol>
  2623. <p> <em>Graft</em> is now installed and ready to be used. </p>
  2624. <p> <strong>NOTE:</strong> If you make changes to your <em>Graft</em> installation at a
  2625. later date, please run the following commands: </p>
  2626. <pre>
  2627. make clean
  2628. make install
  2629. </pre>
  2630. <p> Failure to do this may result in a <em>Graft</em> manual page that does
  2631. NOT reflect your current configuration. </p>
  2632. <h3><a name="rpm_and_deb">Creating RPM and DEB packages</a></h3>
  2633. <p> Beginning with <em>Graft</em> 2.11 there is now the ability to create
  2634. RPM and Debian installation packages. Obviously you'll need one or more of
  2635. the <em>rpmbuild</em> and <em>dpkg-deb</em> packages installed on your
  2636. system. </p>
  2637. <p> After editing the <tt>Makefile</tt> to suit your environment simply run
  2638. the appropriate <tt>make</tt> command to create the binary installation
  2639. package in the current directory: </p>
  2640. <pre>
  2641. make rpm
  2642. </pre>
  2643. <p> or </p>
  2644. <pre>
  2645. make deb
  2646. </pre>
  2647. <p> The creation of these packages is somewhat experimental. Please let the
  2648. author know if you have issues. </p>
  2649. <hr>
  2650. <h3><a name="gotchas">Grafting <em>Graft</em> and <em>Perl</em> - the
  2651. bootstrap problem</a></h3>
  2652. <p> <strong>If you are using an operating system that comes with <em>Perl</em>
  2653. 5.<em>x</em> - such as RedHat or Ubuntu Linux - then you don't need to worry
  2654. about <em>grafting</em> <em>Perl</em>, so this section can be ignored.</strong> </p>
  2655. <p> <strong>However if you are a creator of an operating system
  2656. distribution then this section may be relevant.</strong> </p>
  2657. <p> Embedded into the <em>Graft</em> executable is the location of the
  2658. <em>Perl</em> executable. If you've understood the concept behind
  2659. <em>Graft</em> then this location may be the <em>grafted</em> location of
  2660. <em>Perl</em> rather than the true location of <em>Perl</em>. </p>
  2661. <p> This presents a dilemma when you come to <em>graft</em> both <em>Graft</em>
  2662. and <em>Perl</em>. You can't run the <em>grafted</em> location of the
  2663. <em>Graft</em> executable because it doesn't exist yet, and you can't run
  2664. the real location of the <em>Graft</em> executable because <em>Perl</em>
  2665. hasn't been <em>grafted</em> yet. </p>
  2666. <p> Assuming that <em>Graft</em> and <em>Perl</em> are installed in </p>
  2667. <pre>
  2668. /usr/local/pkgs/graft-2.16
  2669. /usr/local/pkgs/perl-5.18.2
  2670. </pre>
  2671. <p> you can resolve this dilemma by executing the following commands:
  2672. </p>
  2673. <pre>
  2674. /usr/local/pkgs/perl-5.18.2/bin/perl /usr/local/pkgs/graft-2.16/bin/graft -i graft-2.16
  2675. /usr/local/pkgs/perl-5.18.2/bin/perl /usr/local/pkgs/graft-2.16/bin/graft -i perl-5.18.2
  2676. </pre>
  2677. <p> This will <em>graft</em> both <em>Graft</em> and <em>Perl</em> from the
  2678. default package installation directory (as specified by
  2679. <strong>PACKAGEDIR</strong> in the <tt>Makefile</tt>) into your default target
  2680. directory (as specified by <strong>TARGETDIR</strong> in the <tt>Makefile</tt>).
  2681. </p>
  2682. <p> If you don't wish to use the default directories you can use the
  2683. following commands to <em>graft</em> the packages into <tt>/pkgs</tt>
  2684. instead of <tt>/usr/local</tt> for example: </p>
  2685. <pre>
  2686. /usr/local/pkgs/perl-5.18.2/bin/perl /usr/local/pkgs/graft-2.16/bin/graft -i -t /pkgs /usr/local/pkgs/graft-2.16
  2687. /usr/local/pkgs/perl-5.18.2/bin/perl /usr/local/pkgs/graft-2.16/bin/graft -i -t /pkgs /usr/local/pkgs/perl-5.18.2
  2688. </pre>
  2689. <p> Now both <em>Graft</em> and <em>Perl</em> have been <em>grafted</em> and any
  2690. other package can be <em>grafted</em> by executing the simpler command:
  2691. </p>
  2692. <pre>
  2693. graft -i <em>package</em>
  2694. </pre>
  2695. <p> The <em>Graft</em> distribution includes a program called
  2696. <tt>graftBootStrap.sh</tt> which allows you to easily <em>graft</em> both
  2697. <em>Graft</em> and <em>Perl</em>. It can be found in the <em>contrib</em>
  2698. directory of the distribution. Thanks to Gordon Rowell for providing it.</p>
  2699. <p> You may also find the <tt>-L</tt> command line option to be useful to
  2700. programmatically determine where <em>Graft</em> expects to find
  2701. <em>Perl</em> along with the default locations of its log file, target and
  2702. package directories. See the <a href="#graft-L">Information</a> section
  2703. below for details. </p>
  2704. <hr>
  2705. <h2><a name="using-graft">Using <em>Graft</em></a></h2>
  2706. <h3><a name="compiling-packages">Compiling Packages</a></h3>
  2707. <p> Any packages you wish to place under the control of <em>Graft</em> should
  2708. be compiled and installed in such a way that any package dependent
  2709. files are referenced with the ACTUAL package installation directory
  2710. rather than the common area in which <em>Graft</em> will be creating
  2711. symbolic links. For example, ensure that <em>Perl</em> version
  2712. <em>5.18.2</em> is looking for its library files in
  2713. <tt>/usr/local/pkgs/perl-5.18.2/lib/perl5</tt> instead of
  2714. <tt>/usr/local/lib/perl5</tt>. This approach will allow you to easily
  2715. separate multiple versions of the same package without any problems. </p>
  2716. <hr width="25%">
  2717. <h3><a name="usage"><em>Graft</em> command line options</a></h3>
  2718. <p> All of the details concerning actions, package locations and target
  2719. directories are passed to <em>Graft</em> on the command line.
  2720. (<em>Graft</em> 1.<em>x</em> used a configuration file. This has now been
  2721. deprecated in favour of a log file). </p>
  2722. <p> <em>Graft</em>'s command line options can be summarised as: </p>
  2723. <pre>
  2724. graft -i [-P|u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  2725. graft -d [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  2726. graft -p [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  2727. graft -L
  2728. </pre>
  2729. <p> <em>Graft</em> has four basic actions: </p>
  2730. <ol>
  2731. <li> <p> <a name="graft-i"><strong>Install</strong></a> </p>
  2732. <pre>
  2733. graft -i [-C] [-P|u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  2734. </pre>
  2735. <dl>
  2736. <dt> <strong>-i</strong>
  2737. <dd>
  2738. <p> Install symbolic links from the package
  2739. installation directory to the target directory.
  2740. Requires superuser privileges if
  2741. <strong>SUPERUSER</strong> was set to <strong>1</strong> in the
  2742. <tt>Makefile</tt>. </p>
  2743. <dt> <strong>-C</strong>
  2744. <dd>
  2745. <p> If <strong>NEVERGRAFT</strong> was set to <strong>1</strong>
  2746. in the <tt>Makefile</tt>, disable the automatic
  2747. exclusion of files and/or directories whose
  2748. names exactly match the values specified by
  2749. <strong>GRAFT-NEVER</strong> in the <tt>Makefile</tt>. </p>
  2750. <p> If <strong>NEVERGRAFT</strong> was set to <strong>0</strong>
  2751. in the <tt>Makefile</tt>, force the automatic
  2752. exclusion of files and/or directories whose
  2753. names exactly match the values specified by
  2754. <strong>GRAFT-NEVER</strong> in the <tt>Makefile</tt>. </p>
  2755. <p> Can only be used with the -i option. </p>
  2756. <p> This option is ignored for each <em>grafted</em>
  2757. directory, if the directory contains a
  2758. <tt>.nograft</tt> or <tt>.graft-include</tt>
  2759. file. </p>
  2760. <p> The <em>Graft</em> manual page will correctly
  2761. reflect the behaviour of this option based on the
  2762. values specified in the <tt>Makefile</tt>. If there
  2763. are no objects specified for
  2764. <strong>GRAFT-NEVER</strong> then this option will
  2765. be silently ignored and will not appear in the help
  2766. message nor in the manual page. </p>
  2767. <dt> <strong>-P</strong>
  2768. <dd>
  2769. <p> Preserve modes and ownerships when creating new
  2770. directories or copying files if
  2771. <strong>PRESERVEPERMS</strong> was set to
  2772. <strong>0</strong> in the <tt>Makefile</tt>. Do not
  2773. preserve modes and ownerships if the option is not
  2774. provided on the command line. </p>
  2775. <p> Do not preserve modes and ownerships when
  2776. creating new directories or copying files if
  2777. <strong>PRESERVEPERMS</strong> was set to
  2778. <strong>1</strong> in the <tt>Makefile</tt>.
  2779. Preserve modes and ownerships if the option is not
  2780. provided on the command line. </p>
  2781. <p> Cannot be used with the <strong>-u</strong> option. </p>
  2782. <p> This option will be silently ignored if the
  2783. effective user of <em>Graft</em> is not root. </p>
  2784. <p> The <em>Graft</em> manual page will correctly
  2785. reflect the behaviour of this option based on the
  2786. values specified in the <tt>Makefile</tt>. This
  2787. option will be silently ignored and will not appear
  2788. in the help message nor in the manual page if
  2789. <strong>SUPERUSER</strong> was set to
  2790. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  2791. <dt> <strong>-u</strong>
  2792. <dd>
  2793. <p> Superuser privileges are not required when
  2794. installing packages. </p>
  2795. <p> Cannot be used with the <strong>-P</strong> option. </p>
  2796. <p> This option is only available if
  2797. <strong>SUPERUSER</strong> was set to
  2798. <strong>1</strong> in the <tt>Makefile</tt>. </p>
  2799. <p> The <em>Graft</em> manual page will correctly
  2800. reflect the behaviour of this option based on the
  2801. values specified in the <tt>Makefile</tt>. This
  2802. option will be silently ignored and will not appear
  2803. in the help message nor in the manual page if
  2804. <strong>SUPERUSER</strong> was set to
  2805. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  2806. <dt> <strong>-l <em>log</em></strong>
  2807. <dd>
  2808. <p> Specify an alternate log file instead of the
  2809. default specified by <strong>LOGFILE</strong> in the
  2810. <tt>Makefile</tt>. No logging is performed if
  2811. the <strong>-n</strong> option is used. </p>
  2812. <p> Log entries have the form: </p>
  2813. <pre>
  2814. 878790215 1.10+ I /usr/local/pkgs/cpio-2.4.2 /usr/local
  2815. 878888916 2.1 I /usr/local/pkgs/gzip-1.2.4 /usr/local
  2816. 878888916 2.1 IC /usr/local/pkgs/gzip-1.2.4/bin/gzip invalid symlink
  2817. </pre>
  2818. <p> This shows that a development version of
  2819. <em>graft</em> (1.10+) was used to install
  2820. symbolic links from <tt>/usr/local/pkgs/cpio-2.4.2</tt>
  2821. to <tt>/usr/local</tt>. A new version of
  2822. <em>graft</em> (2.1) was used to install symbolic
  2823. links from <tt>/usr/local/pkgs/gzip-1.2.4</tt> to
  2824. <tt>/usr/local</tt>. The <tt>IC</tt> entry indicates
  2825. that a conflict occurred during this
  2826. installation - the file <tt>/usr/local/pkgs/bin/gzip</tt>
  2827. was a symbolic link to something other than
  2828. <tt>/usr/local/pkgs/gzip-1.2.4/bin/gzip</tt>. </p>
  2829. <dt> <strong>-n</strong>
  2830. <dd>
  2831. <p> List actions but do not perform them. Implies
  2832. the very verbose option. Does not require
  2833. superuser privileges regardless of the value of
  2834. <strong>SUPERUSER</strong> in the <tt>Makefile</tt>. </p>
  2835. <dt> <strong>-v</strong>
  2836. <dd>
  2837. <p> Be verbose. </p>
  2838. <dt> <strong>-V</strong>
  2839. <dd>
  2840. <p> Be very verbose. </p>
  2841. <dt> <strong>-r <em>/rootdir</em></strong>
  2842. <dd>
  2843. <p> Use the fully qualified named directory as the
  2844. root directory for all graft operations. The source
  2845. directory, target directory and log file will all
  2846. be relative to this specific directory. </p>
  2847. <p> Can only be used by the superuser. </p>
  2848. <dt> <strong>-s</strong>
  2849. <dd>
  2850. <p> <em>Stow</em>/<em>Depot</em> compatibility mode.
  2851. Infer the <em>Graft</em> target directory from
  2852. each package installation directory in the
  2853. manner of <em>Stow</em> and <em>Depot</em>. </p>
  2854. <p> Target directory is the <tt>dirname</tt> of the
  2855. <tt>dirname</tt> of the package installation
  2856. directory. (Yes that really is two
  2857. <tt>dirname</tt>s). So if the package
  2858. installation directory is </p>
  2859. <pre>
  2860. /usr/local/depot/gzip-1.2.4
  2861. </pre>
  2862. <p> the package will be <em>grafted</em> into
  2863. </p>
  2864. <pre>
  2865. /usr/local
  2866. </pre>
  2867. <p> Cannot be used with the <strong>-t</strong> option. </p>
  2868. <dt> <strong>-t <em>target</em></strong>
  2869. <dd>
  2870. <p> Override the default <em>graft</em> target
  2871. directory with <strong><em>target</em></strong>. The value
  2872. of <strong><em>target</em></strong> must be a fully
  2873. qualified directory and it must exist. </p>
  2874. <p> Cannot be used with the <strong>-s</strong> option. </p>
  2875. <dt> <strong>package</strong>
  2876. <dd>
  2877. <p> Install the named package. If <strong>package</strong> is
  2878. a fully qualified directory, use it as the
  2879. package installation directory. If
  2880. <strong>package</strong> is not a fully qualified
  2881. directory, prepend it with the value of
  2882. <strong>PACKAGEDIR</strong> as specified in the
  2883. <tt>Makefile</tt>. </p>
  2884. </dl>
  2885. <hr width="10%">
  2886. <li> <p> <a name="graft-d"><strong>Delete</strong></a> </p>
  2887. <pre>
  2888. graft -d [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  2889. </pre>
  2890. <dl>
  2891. <dt> <strong>-d</strong>
  2892. <dd>
  2893. <p> Delete symbolic links from the package target
  2894. directory to the package installation
  2895. directory. Requires superuser privileges if
  2896. <strong>SUPERUSER</strong> was set to <strong>1</strong> in the
  2897. <tt>Makefile</tt>. </p>
  2898. <dt> <strong>-D</strong>
  2899. <dd>
  2900. <p> Delete empty directories if
  2901. <strong>DELETEOBJECTS</strong> was set to <strong>0</strong> in the
  2902. <tt>Makefile</tt>. If the option is not
  2903. provided on the command line, notify the user
  2904. that a directory has been emptied. </p>
  2905. <p> Do not delete empty directories if
  2906. <strong>DELETEOBJECTS</strong> was set to <strong>1</strong> in the
  2907. <tt>Makefile</tt>. Notify the user that a
  2908. directory has been emptied. If the option is
  2909. not provided on the command line, delete empty
  2910. directories. </p>
  2911. <p> The <em>Graft</em> manual page will correctly
  2912. reflect the behaviour of this option based on the
  2913. values specified in the <tt>Makefile</tt>. </p>
  2914. <dt> <strong>-u</strong>
  2915. <dd>
  2916. <p> Superuser privileges are not required when
  2917. deleting packages. </p>
  2918. <p> This option is only available if
  2919. <strong>SUPERUSER</strong> was set to
  2920. <strong>1</strong> in the <tt>Makefile</tt>. </p>
  2921. <p> The <em>Graft</em> manual page will correctly
  2922. reflect the behaviour of this option based on the
  2923. values specified in the <tt>Makefile</tt>. This
  2924. option will be silently ignored and will not appear
  2925. in the help message nor in the manual page if
  2926. <strong>SUPERUSER</strong> was set to
  2927. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  2928. <dt> <strong>-l <em>log</em></strong>
  2929. <dd>
  2930. <p> Specify an alternate log file instead of the
  2931. default specified by <strong>LOGFILE</strong> in the
  2932. <tt>Makefile</tt>. No logging is performed if
  2933. the <strong>-n</strong> option is used. </p>
  2934. <p> Log entries have the form: </p>
  2935. <pre>
  2936. 879126278 1.10+ D /usr/local/pkgs/weblint-1.017 /usr/local
  2937. 879126278 1.10+ DC /usr/local/pkgs/weblint-1.017/bin/weblint file exists
  2938. 879126278 1.10+ DC /usr/local/pkgs/weblint-1.017/man/man1/weblint.1 file exists
  2939. </pre>
  2940. <p> This shows that a development version of
  2941. <em>graft</em> (1.10+) was used to delete
  2942. symbolic links from <tt>/usr/local</tt> to
  2943. <tt>/usr/local/pkgs/weblint-1.017</tt>. The <tt>DC</tt>
  2944. entries indicate that conflicts occurred during
  2945. this action - the files
  2946. <tt>/usr/local/bin/weblint</tt> and
  2947. <tt>/usr/local/man/man1/weblint.1</tt> already
  2948. exist. </p>
  2949. <dt> <strong>-n</strong>
  2950. <dd>
  2951. <p> List actions but do not perform them. Implies
  2952. the very verbose option. Does not require
  2953. superuser privileges regardless of the value of
  2954. <strong>SUPERUSER</strong> in the <tt>Makefile</tt>. </p>
  2955. <dt> <strong>-v</strong>
  2956. <dd>
  2957. <p> Be verbose. </p>
  2958. <dt> <strong>-V</strong>
  2959. <dd>
  2960. <p> Be very verbose. </p>
  2961. <dt> <strong>-r <em>/rootdir</em></strong>
  2962. <dd>
  2963. <p> Use the fully qualified named directory as the
  2964. root directory for all graft operations. The source
  2965. directory, target directory and log file will all
  2966. be relative to this specific directory. </p>
  2967. <p> Can only be used by the superuser. </p>
  2968. <dt> <strong>-s</strong>
  2969. <dd>
  2970. <p> <em>Stow</em>/<em>Depot</em> compatibility mode.
  2971. Infer the <em>Graft</em> target directory from
  2972. each package installation directory in the
  2973. manner of <em>Stow</em> and <em>Depot</em>. </p>
  2974. <p> Target directory is the <tt>dirname</tt> of the
  2975. <tt>dirname</tt> of the package installation
  2976. directory. (Yes that really is two
  2977. <tt>dirname</tt>s). So if the package
  2978. installation directory is </p>
  2979. <pre>
  2980. /usr/local/depot/gzip-1.2.4
  2981. </pre>
  2982. <p> the package will be <em>grafted</em> into
  2983. </p>
  2984. <pre>
  2985. /usr/local
  2986. </pre>
  2987. <p> Cannot be used with the <strong>-t</strong> option. </p>
  2988. <dt> <strong>-t <em>target</em></strong>
  2989. <dd>
  2990. <p> Override the default <em>graft</em> target
  2991. directory with <strong><em>target</em></strong>. The value
  2992. of <strong><em>target</em></strong> must be a fully
  2993. qualified directory and it must exist. </p>
  2994. <p> Cannot be used with the <strong>-s</strong> option. </p>
  2995. <dt> <strong>package</strong>
  2996. <dd>
  2997. <p> Delete the named package. If <strong>package</strong> is
  2998. a fully qualified directory, use it as the
  2999. package installation directory. If
  3000. <strong>package</strong> is not a fully qualified
  3001. directory, prepend it with the value of
  3002. <strong>PACKAGEDIR</strong> as specified in the
  3003. <tt>Makefile</tt>. </p>
  3004. </dl>
  3005. <hr width="10%">
  3006. <li> <p> <a name="graft-p"><strong>Prune</strong></a> </p>
  3007. <pre>
  3008. graft -p [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  3009. </pre>
  3010. <dl>
  3011. <dt> <strong>-p</strong>
  3012. <dd>
  3013. <p> Prune objects (files, links or directories)
  3014. from the package target directory that are in
  3015. conflict with the package installation
  3016. directory. Requires superuser privileges if
  3017. <strong>SUPERUSER</strong> was set to <strong>1</strong> in the
  3018. <tt>Makefile</tt>. </p>
  3019. <dt> <strong>-D</strong>
  3020. <dd>
  3021. <p> Remove conflicting objects if
  3022. <strong>DELETEOBJECTS</strong> was set to <strong>0</strong> in the
  3023. <tt>Makefile</tt>. Rename conflicting objects
  3024. as <tt><em>object</em>.pruned</tt> if the option
  3025. is not provided on the command line. </p>
  3026. <p> Rename conflicting objects to
  3027. <tt><em>object</em>.pruned</tt> if
  3028. <strong>DELETEOBJECTS</strong> was set to <strong>1</strong> in the
  3029. <tt>Makefile</tt>. Remove conflicting objects
  3030. if the option is not provided in the command
  3031. line. </p>
  3032. <p> If a directory is to be removed and it is not
  3033. empty, it will be renamed as
  3034. <tt><em>dir</em>.pruned</tt> and a suitable
  3035. warning message will be given regardless of the
  3036. sense of this flag. </p>
  3037. <p> The <em>Graft</em> manual page will correctly
  3038. reflect the behaviour of this option based on the
  3039. values specified in the <tt>Makefile</tt>. </p>
  3040. <dt> <strong>-u</strong>
  3041. <dd>
  3042. <p> Superuser privileges are not required when
  3043. pruning packages. </p>
  3044. <p> This option is only available if
  3045. <strong>SUPERUSER</strong> was set to
  3046. <strong>1</strong> in the <tt>Makefile</tt>. </p>
  3047. <p> The <em>Graft</em> manual page will correctly
  3048. reflect the behaviour of this option based on the
  3049. values specified in the <tt>Makefile</tt>. This
  3050. option will be silently ignored and will not appear
  3051. in the help message nor in the manual page if
  3052. <strong>SUPERUSER</strong> was set to
  3053. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  3054. <dt> <strong>-l <em>log</em></strong>
  3055. <dd>
  3056. <p> Specify an alternate log file instead of the
  3057. default specified by <strong>LOGFILE</strong> in the
  3058. <tt>Makefile</tt>. No logging is performed if
  3059. the <strong>-n</strong> option is used. </p>
  3060. <p> Log entries have the form: </p>
  3061. <pre>
  3062. 879126283 1.10+ P /usr/local/pkgs/weblint-1.017 /usr/local
  3063. </pre>
  3064. <p> This shows that a development version of
  3065. <em>graft</em> (1.10+) was used to delete objects
  3066. from <tt>/usr/local</tt> that were in conflict with
  3067. <tt>/usr/local/pkgs/weblint-1.017</tt>. </p>
  3068. <dt> <strong>-n</strong>
  3069. <dd>
  3070. <p> List actions but do not perform them. Implies
  3071. the very verbose option. Does not require
  3072. superuser privileges regardless of the value of
  3073. <strong>SUPERUSER</strong> in the <tt>Makefile</tt>. </p>
  3074. <dt> <strong>-v</strong>
  3075. <dd>
  3076. <p> Be verbose. </p>
  3077. <dt> <strong>-V</strong>
  3078. <dd>
  3079. <p> Be very verbose. </p>
  3080. <dt> <strong>-r <em>/rootdir</em></strong>
  3081. <dd>
  3082. <p> Use the fully qualified named directory as the
  3083. root directory for all graft operations. The source
  3084. directory, target directory and log file will all
  3085. be relative to this specific directory. </p>
  3086. <p> Can only be used by the superuser. </p>
  3087. <dt> <strong>-s</strong>
  3088. <dd>
  3089. <p> <em>Stow</em>/<em>Depot</em> compatibility mode.
  3090. Infer the <em>Graft</em> target directory from
  3091. each package installation directory in the
  3092. manner of <em>Stow</em> and <em>Depot</em>. </p>
  3093. <p> Target directory is the <tt>dirname</tt> of the
  3094. <tt>dirname</tt> of the package installation
  3095. directory. (Yes that really is two
  3096. <tt>dirname</tt>s). So if the package
  3097. installation directory is </p>
  3098. <pre>
  3099. /usr/local/depot/gzip-1.2.4
  3100. </pre>
  3101. <p> the package will be <em>grafted</em> into
  3102. </p>
  3103. <pre>
  3104. /usr/local
  3105. </pre>
  3106. <p> Cannot be used with the <strong>-t</strong> option. </p>
  3107. <dt> <strong>-t <em>target</em></strong>
  3108. <dd>
  3109. <p> Override the default <em>graft</em> target
  3110. directory with <strong><em>target</em></strong>. The value
  3111. of <strong><em>target</em></strong> must be a fully
  3112. qualified directory and it must exist. </p>
  3113. <p> Cannot be used with the <strong>-s</strong> option. </p>
  3114. <dt> <strong>package</strong>
  3115. <dd>
  3116. <p> Prune the named package. If <strong>package</strong> is
  3117. a fully qualified directory, use it as the
  3118. package installation directory. If
  3119. <strong>package</strong> is not a fully qualified
  3120. directory, prepend it with the value of
  3121. <strong>PACKAGEDIR</strong> as specified in the
  3122. <tt>Makefile</tt>. </p>
  3123. </dl>
  3124. <li> <p> <a name="graft-L"><strong>Information</strong></a> </p>
  3125. <pre>
  3126. graft -L
  3127. </pre>
  3128. <dl>
  3129. <dt> <strong>-L</strong>
  3130. <dd>
  3131. <p> This is a special mode and it overrides all
  3132. other command line arguments. When present
  3133. <strong>graft</strong> will display the
  3134. <strong>default</strong> locations for Perl, the
  3135. graft log file, the target directory, and the
  3136. package directory in a form suitable for creating
  3137. environment variables for Bourne like shells. The
  3138. output will appear on <strong>STDOUT</strong> as
  3139. follows: </p>
  3140. <pre>
  3141. GRAFT_PERL=/usr/bin/perl
  3142. GRAFT_LOGFILE=/var/log/graft
  3143. GRAFT_TARGETDIR=/usr/local
  3144. GRAFT_PACKAGEDIR=/usr/local/pkgs
  3145. </pre>
  3146. <p> You can set these environment variables using
  3147. one of the following methods. </p>
  3148. <pre>
  3149. eval "$(graft -L)" # modern shells such as bash, zsh etc
  3150. eval "`graft -L`" # older shells such as sh etc
  3151. </pre>
  3152. </dl>
  3153. </ol>
  3154. <hr width="25%">
  3155. <h3><a name="testing">Testing the <em>Graft</em> Installation</a></h3>
  3156. <p> Before creating the symbolic links from the target directory to
  3157. the package directory, you may wish to see what actions <em>Graft</em>
  3158. will perform. Execute the following command: </p>
  3159. <pre>
  3160. graft -i -n <em>package-name</em>
  3161. </pre>
  3162. <p> The <tt>-i</tt> option tells <em>Graft</em> to install the package and
  3163. the <tt>-n</tt> option tells <em>Graft</em> to report on its actions
  3164. without actually performing them. The default <em>Graft</em> target
  3165. directory will be used and the package installation directory will be
  3166. taken from the fully qualified package argument or the default value
  3167. will be prepended to the package argument if it is not fully qualified.
  3168. </p>
  3169. <p> <em>Graft</em> will report on the following actions: </p>
  3170. <ul>
  3171. <li> <p> Installing links to <em>package-location</em> in
  3172. <em>package-target</em> </p>
  3173. <p> Indicates the real package location and its <em>grafted</em>
  3174. target. </p>
  3175. <li> <p> Processing <em>package-directory</em> </p>
  3176. <p> Indicates which package directory is being processed. </p>
  3177. <li> <p> MKDIR <em>dirname</em> </p>
  3178. <p> This destination directory will be created. </p>
  3179. <li> <p> SYMLINK <em>dest-package-file</em> -&gt; <em>package-file</em>
  3180. </p>
  3181. <p> This symbolic link will be created. </p>
  3182. <li> <p> NOP <em>string</em> </p>
  3183. <p> No action was necessary for this package object. </p>
  3184. <li> <p> BYPASS <em>dirname</em> - .nograft file found</p>
  3185. <p> This directory contains a file called <tt>.nograft</tt> so its
  3186. contents and any subdirectories will be bypassed by
  3187. <em>Graft</em>. </p>
  3188. <li> <p> READING include file
  3189. <em>package-dir</em><tt>/.graft-include</tt> </p>
  3190. <p> The directory currently being processed by <em>Graft</em>
  3191. contains a file called <tt>.graft-include</tt> which contains
  3192. a list of file and/or directory names from the directory that
  3193. should only be <em>grafted</em>. The contents of this file are
  3194. being read by <em>Graft</em>. </p>
  3195. <li> <p> INCLUDE file <em>package-file</em> - listed in
  3196. <em>package-dir</em><tt>/.graft-include</tt> </p>
  3197. <p> The file name mentioned in this message appears in the
  3198. <em>.graft-include</em> file and the file exists in the directory
  3199. currently being processed. It will be <tt>grafted</tt>. </p>
  3200. <li> <p> IGNORE file <em>package-file</em> - not listed in
  3201. <em>package-dir</em><tt>/.graft-include</tt> </p>
  3202. <p> The file name mentioned in this message does not appear in the
  3203. <em>.graft-include</em> file and the file exists in the directory
  3204. currently being processed. It will not be <tt>grafted</tt>. </p>
  3205. <li> <p> INCLUDE directory <em>package-directory</em> - listed in
  3206. <em>package-dir</em><tt>/.graft-include</tt> </p>
  3207. <p> The directory name mentioned in this message appears
  3208. in the <em>.graft-include</em> file and the directory exists
  3209. in the directory currently being processed. It will be
  3210. <tt>grafted</tt>. </p>
  3211. <li> <p> IGNORE directory <em>package-file</em> - not listed in
  3212. <em>package-dir</em><tt>/.graft-include</tt> </p>
  3213. <p> The directory name mentioned in this message does not
  3214. appear in the <em>.graft-include</em> file and the directory
  3215. exists in the directory currently being processed. It will not
  3216. be <tt>grafted</tt>. </p>
  3217. <li> <p> READING exclude file
  3218. <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  3219. <p> The directory currently being processed by <em>Graft</em>
  3220. contains a file called <tt>.graft-exclude</tt> which contains
  3221. a list of file and/or directory names from the directory that
  3222. should not be <em>grafted</em>. The contents of this file are
  3223. being read by <em>Graft</em>. </p>
  3224. <li> <p> IGNORE include file
  3225. <em>package-dir</em><tt>/.graft-include</tt>, overridden by exclude
  3226. file <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  3227. <p> The directory currently being processed by <em>Graft</em>
  3228. contains a file called <tt>.graft-exclude</tt> as well as a file
  3229. called <tt>.graft-include</tt>. The <tt>.graft-exclude</tt>
  3230. file takes precedence over the <tt>.graft-include</tt> file,
  3231. so the latter file will be ignored. </p>
  3232. <li> <p> EXCLUDE file <em>package-file</em> - listed in
  3233. <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  3234. <p> The file name mentioned in this message appears in the
  3235. <em>.graft-exclude</em> file and the file exists in the directory
  3236. currently being processed. It will not be <tt>grafted</tt>. </p>
  3237. <li> <p> EXCLUDE directory <em>package-directory</em> - listed in
  3238. <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  3239. <p> The directory name mentioned in this message appears
  3240. in the <em>.graft-exclude</em> file and the directory exists
  3241. in the directory currently being processed. It will not be
  3242. <tt>grafted</tt>. </p>
  3243. <li> <p> CONFLICT <em>message</em> </p>
  3244. <p> <em>Graft</em> could not successfully process a package object.
  3245. One of the following conditions was encountered: </p>
  3246. <ul>
  3247. <li> The package object is a directory and the
  3248. target object exists but it not a directory.
  3249. <li> The package object is not a directory and the
  3250. target object exists and is not a symbolic
  3251. link.
  3252. <li> The package object is not a directory and the
  3253. target object exists and is a symbolic link to
  3254. something other than the package object.
  3255. </ul>
  3256. <p> Conflicts are ALWAYS reported on standard error. If you wish
  3257. to see if the installation of a package will have any
  3258. conflicts, you can execute: </p>
  3259. <pre>
  3260. graft -i -n <em>package-name</em> &gt; /dev/null
  3261. </pre>
  3262. <p> Only <tt>CONFLICT</tt> messages will be displayed. If nothing
  3263. is displayed then you can safely conclude that this package
  3264. can be installed using <em>Graft</em> without any conflicts.
  3265. </p>
  3266. </ul>
  3267. <p> If you were to test the installation of the <em>kermit-5A190</em>
  3268. package you would execute the command: </p>
  3269. <pre>
  3270. graft -i -n kermit-5A190
  3271. </pre>
  3272. You should see output resembling:
  3273. <pre>
  3274. Installing links to /usr/local/pkgs/kermit-5A190 in /usr/local
  3275. Processing /usr/local/pkgs/kermit-5A190
  3276. SYMLINK /usr/local/README -&gt; /usr/local/pkgs/kermit-5A190/README
  3277. NOP /usr/local/pkgs/kermit-5A190/bin and /usr/local/bin are both directories
  3278. Processing /usr/local/pkgs/kermit-5A190/bin
  3279. SYMLINK /usr/local/bin/kermit -&gt; /usr/local/pkgs/kermit-5A190/bin/kermit
  3280. SYMLINK /usr/local/bin/wart -&gt; /usr/local/pkgs/kermit-5A190/bin/wart
  3281. NOP /usr/local/pkgs/kermit-5A190/man and /usr/local/man are both directories
  3282. Processing /usr/local/pkgs/kermit-5A190/man
  3283. NOP /usr/local/pkgs/kermit-5A190/man/man1 and /usr/local/man/man1 are both directories
  3284. Processing /usr/local/pkgs/kermit-5A190/man/man1
  3285. SYMLINK /usr/local/man/man1/kermit.1 -&gt; /usr/local/pkgs/kermit-5A190/man/man1/kermit.1
  3286. MKDIR /usr/local/doc
  3287. Processing /usr/local/pkgs/kermit-5A190/doc
  3288. SYMLINK /usr/local/doc/ckccfg.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckccfg.doc
  3289. SYMLINK /usr/local/doc/ckuins.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuins.doc
  3290. SYMLINK /usr/local/doc/ckc190.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckc190.upd
  3291. SYMLINK /usr/local/doc/ckcker.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckcker.upd
  3292. SYMLINK /usr/local/doc/ckaaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckaaaa.hlp
  3293. SYMLINK /usr/local/doc/ckuaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuaaa.hlp
  3294. NOP /usr/local/pkgs/kermit-5A190/lib and /usr/local/lib are both directories
  3295. Processing /usr/local/pkgs/kermit-5A190/lib
  3296. SYMLINK /usr/local/lib/ckedemo.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckedemo.ini
  3297. SYMLINK /usr/local/lib/ckeracu.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckeracu.ini
  3298. SYMLINK /usr/local/lib/ckermit.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermit.ini
  3299. SYMLINK /usr/local/lib/ckermod.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermod.ini
  3300. SYMLINK /usr/local/lib/cketest.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/cketest.ini
  3301. SYMLINK /usr/local/lib/ckevt.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckevt.ini
  3302. SYMLINK /usr/local/lib/ckurzsz.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckurzsz.ini
  3303. </pre>
  3304. <p> This output shows you that most of the directories already exist
  3305. (indicated by the <tt>NOP</tt> flags). A symbolic link will be created
  3306. in the relevant target directory to each of the files in the
  3307. <em>kermit-5A190</em> package. One directory exists in the
  3308. <em>kermit-5A190</em> package that does not exist in the target -
  3309. <tt>doc</tt>. This directory will be created by <em>Graft</em>. </p>
  3310. <p> <strong>NOTE</strong>: If you are using the <em>automounter</em> you may not be
  3311. able to create the directory <tt>/usr/local/doc</tt>. You'll have to create
  3312. the directory on the NFS server under the file system in which it
  3313. really lives. You should be familiar with the peculiarities of the
  3314. <em>automounter</em> and your specific site configuration before creating
  3315. any directories directly under mount points used by the
  3316. <em>automounter</em>. </p>
  3317. <hr width="25%">
  3318. <h3><a name="installing-packages">Installing Packages</a></h3>
  3319. <p> Once you have ensured that <em>Graft</em> will perform the correct
  3320. actions, you can execute: </p>
  3321. <pre>
  3322. graft -i <em>package-name</em>
  3323. </pre>
  3324. <p> So to install <em>kermit</em> you would execute: </p>
  3325. <pre>
  3326. graft -i kermit-5A190
  3327. </pre>
  3328. <p> There will be no output from <em>Graft</em> unless it encounters a
  3329. conflict. If you wish to see more information you can specify one of
  3330. the verbose flags. For a minimum of output you can execute: </p>
  3331. <pre>
  3332. graft -i -v kermit-5A190
  3333. </pre>
  3334. <p> You should see the following output: </p>
  3335. <pre>
  3336. Processing /usr/local/pkgs/kermit-5A190
  3337. Processing /usr/local/pkgs/kermit-5A190/bin
  3338. Processing /usr/local/pkgs/kermit-5A190/man
  3339. Processing /usr/local/pkgs/kermit-5A190/man/man1
  3340. Processing /usr/local/pkgs/kermit-5A190/doc
  3341. Processing /usr/local/pkgs/kermit-5A190/lib
  3342. </pre>
  3343. <p> If you choose the very verbose option by executing: </p>
  3344. <pre>
  3345. graft -i -V kermit-5A190
  3346. </pre>
  3347. <p> the output will be the same as that when the <tt>-n</tt> option was
  3348. used, however this time <em>Graft</em> will actually create the symbolic
  3349. links. </p>
  3350. <pre>
  3351. Installing links to /usr/local/pkgs/kermit-5A190 in /usr/local
  3352. Processing /usr/local/pkgs/kermit-5A190
  3353. SYMLINK /usr/local/README -&gt; /usr/local/pkgs/kermit-5A190/README
  3354. NOP /usr/local/pkgs/kermit-5A190/bin and /usr/local/bin are both directories
  3355. Processing /usr/local/pkgs/kermit-5A190/bin
  3356. SYMLINK /usr/local/bin/kermit -&gt; /usr/local/pkgs/kermit-5A190/bin/kermit
  3357. SYMLINK /usr/local/bin/wart -&gt; /usr/local/pkgs/kermit-5A190/bin/wart
  3358. NOP /usr/local/pkgs/kermit-5A190/man and /usr/local/man are both directories
  3359. Processing /usr/local/pkgs/kermit-5A190/man
  3360. NOP /usr/local/pkgs/kermit-5A190/man/man1 and /usr/local/man/man1 are both directories
  3361. Processing /usr/local/pkgs/kermit-5A190/man/man1
  3362. SYMLINK /usr/local/man/man1/kermit.1 -&gt; /usr/local/pkgs/kermit-5A190/man/man1/kermit.1
  3363. NOP /usr/local/pkgs/kermit-5A190/doc and /usr/local/doc are both directories
  3364. Processing /usr/local/pkgs/kermit-5A190/doc
  3365. SYMLINK /usr/local/doc/ckccfg.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckccfg.doc
  3366. SYMLINK /usr/local/doc/ckuins.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuins.doc
  3367. SYMLINK /usr/local/doc/ckc190.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckc190.upd
  3368. SYMLINK /usr/local/doc/ckcker.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckcker.upd
  3369. SYMLINK /usr/local/doc/ckaaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckaaaa.hlp
  3370. SYMLINK /usr/local/doc/ckuaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuaaa.hlp
  3371. NOP /usr/local/pkgs/kermit-5A190/lib and /usr/local/lib are both directories
  3372. Processing /usr/local/pkgs/kermit-5A190/lib
  3373. SYMLINK /usr/local/lib/ckedemo.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckedemo.ini
  3374. SYMLINK /usr/local/lib/ckeracu.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckeracu.ini
  3375. SYMLINK /usr/local/lib/ckermit.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermit.ini
  3376. SYMLINK /usr/local/lib/ckermod.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermod.ini
  3377. SYMLINK /usr/local/lib/cketest.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/cketest.ini
  3378. SYMLINK /usr/local/lib/ckevt.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckevt.ini
  3379. SYMLINK /usr/local/lib/ckurzsz.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckurzsz.ini
  3380. </pre>
  3381. <p> <strong>NOTE</strong>: In this case the <tt>/usr/local/doc</tt> directory was not
  3382. created by <em>Graft</em> because <tt>/usr/local</tt> is a mount point
  3383. controlled by the <em>automounter</em>. The <tt>doc</tt> directory was
  3384. created manually prior to executing <em>Graft</em>. </p>
  3385. <hr width="25%">
  3386. <h3><a name="bypass">Bypassing package directories</a></h3>
  3387. <p> You may have the need to place only part of a package under the control
  3388. of <em>Graft</em>. Examples of such occasions may be: </p>
  3389. <ul>
  3390. <li> <p> The contents of one package conflict with another package.
  3391. For example <tt>/usr/local/pkgs/gcc-2.7.2.1/lib/libiberty.a</tt> and
  3392. <tt>/usr/local/pkgs/gdb-4.16/lib/libiberty.a</tt>. </p>
  3393. <li> <p> A package directory is obviously the exclusive domain of
  3394. the package and no benefit will be gained by creating symbolic
  3395. links to its files. For example
  3396. <tt>/usr/local/pkgs/perl-5.18.2/lib/perl5</tt>. </p>
  3397. <p> <strong>NOTE</strong>: This will ONLY work if you originally compiled and
  3398. installed the package such that it refers to its files by their
  3399. '<em>real</em>' pathnames and NOT by the virtual pathnames
  3400. provided by <em>Graft</em>. </p>
  3401. </ul>
  3402. <p> You can force <em>Graft</em> to bypass a directory by creating the file </p>
  3403. <pre>
  3404. <em>package-name/dir/dir/</em>.nograft
  3405. </pre>
  3406. <p> Using the second example above, if you were to create the file: </p>
  3407. <pre>
  3408. /usr/local/pkgs/perl-5.18.2/lib/perl5/.nograft
  3409. </pre>
  3410. <p> <em>Graft</em> would create directories and symbolic links for every file
  3411. and directory down to <tt>/usr/local/pkgs/perl-5.18.2/lib</tt>. The <tt>perl5</tt>
  3412. directory and anything below it would not be created. </p>
  3413. <hr width="25%">
  3414. <h3><a name="include">Including specific files and/or directories</a></h3>
  3415. <p> There may be the occasional need to include specific files and/or
  3416. directories in a directory, rather than the entire directory tree itself. An
  3417. example of such an occurrence would be the case where a package
  3418. contains a number of subdirectories, only one of which is required to
  3419. be <em>grafted</em>. </p>
  3420. <p> You can force <em>Graft</em> to only include any number of files and/or
  3421. directories in a package directory by creating the file </p>
  3422. <pre>
  3423. .graft-include
  3424. </pre>
  3425. <p> in the same directory. </p>
  3426. <p> <tt>.graft-include</tt> will contain a list of file and/or directory names
  3427. - one per line - of the files and/or directories you wish to include. </p>
  3428. <p> Consider the <em>a2ps</em> package for example. When installed it
  3429. contains the following directories: </p>
  3430. <pre>
  3431. /usr/local/pkgs/a2ps-4.13b/bin
  3432. /usr/local/pkgs/a2ps-4.13b/etc
  3433. /usr/local/pkgs/a2ps-4.13b/include
  3434. /usr/local/pkgs/a2ps-4.13b/info
  3435. /usr/local/pkgs/a2ps-4.13b/lib
  3436. /usr/local/pkgs/a2ps-4.13b/man
  3437. /usr/local/pkgs/a2ps-4.13b/share
  3438. </pre>
  3439. <p> The only directory you wish to <em>graft</em> is the <tt>bin</tt>
  3440. directory. You could place a <tt>.nograft</tt> file in each of the other
  3441. directories, <strong>OR</strong> you could create a single <tt>.graft-include</tt>
  3442. file in <tt>/usr/local/pkgs/a2ps-4.13b/.graft-include</tt>. This file would
  3443. contain </p>
  3444. <pre>
  3445. bin
  3446. </pre>
  3447. <p> Now only the <tt>bin</tt> directory will be <em>grafted</em>. </p>
  3448. <hr width="25%">
  3449. <h3><a name="exclude">Excluding specific files and/or directories</a></h3>
  3450. <p> There may be the occasional need to exclude specific files and/or
  3451. directories from a directory, rather than the entire directory itself. An
  3452. example of such an occurrence would be the case where files from different
  3453. packages have the same name. <em>Emacs</em> and <em>Xemacs</em> use the same
  3454. names for a number of their configuration files for example. </p>
  3455. <p> You can force <em>Graft</em> to exclude any number of files and/or
  3456. directories from a package directory by creating the file </p>
  3457. <pre>
  3458. .graft-exclude
  3459. </pre>
  3460. <p> in the same directory. </p>
  3461. <p> <tt>.graft-exclude</tt> will contain a list of file and/or directory names
  3462. - one per line - of the files and/or directories you wish to exclude. </p>
  3463. <p> For example, if you did not wish the file </p>
  3464. <pre>
  3465. /usr/local/pkgs/sudo-1.5.3/etc/sudoers
  3466. </pre>
  3467. <p> to be <em>grafted</em> as </p>
  3468. <pre>
  3469. /usr/local/etc/sudoers
  3470. </pre>
  3471. <p> but you did want </p>
  3472. <pre>
  3473. /usr/local/pkgs/sudo-1.5.3/etc/visudo
  3474. </pre>
  3475. <p> to be <em>grafted</em> as </p>
  3476. <pre>
  3477. /usr/local/etc/visudo
  3478. </pre>
  3479. <p> you would create the file </p>
  3480. <pre>
  3481. /usr/local/pkgs/sudo-1.5.3/etc/.graft-exclude
  3482. </pre>
  3483. <p> and ensure its contents contained the line: </p>
  3484. <pre>
  3485. sudoers
  3486. </pre>
  3487. <p> <strong>NOTE:</strong> Any entries made in a <tt>.graft-exclude</tt> file will
  3488. override the same entries made in a <tt>.graft-include</tt> file. That is,
  3489. if a file or directory name is listen in both a <tt>.graft-exclude</tt>
  3490. and a <tt>.graft-include</tt> file, it will be <strong>excluded</strong> from the
  3491. <em>graft</em>. </p>
  3492. <hr width="25%">
  3493. <h3><a name="config_dirs">Grafting configuration files</a></h3>
  3494. <p> Beginning with <em>Graft</em> 2.11 there is now the ability to treat a
  3495. package directory as a repository for configuration files. In this case you
  3496. would place a <tt>.graft-config</tt> file in the package directory and any
  3497. files in that directory would be <strong>copied</strong> to the target
  3498. directory. Files in conflict would also be copied but would have a default
  3499. suffix of <em>.new</em> to ensure the existing file is not clobbered.
  3500. Conflict discovery is achieved using a simple 32-bit CRC check. This
  3501. feature has been added to assist operating system distributors manage
  3502. system configuration files, specifically it was added at the request of the
  3503. maintainer of the <a href="http://www.dragora.org/">Dragora GNU/Linux</a>
  3504. distribution. </p>
  3505. <p> Consider the following example. You may wish to upgrade the
  3506. <em>openssh</em> server as part of an upgrade to your distribution. In
  3507. order to preserve any local user modifications to the relevant
  3508. configuration files you would add a <tt>.graft-config</tt> file to the
  3509. package as follows: </p>
  3510. <pre>
  3511. /usr/local/pkgs/openssh-server-6.61/etc/default/.graft-config
  3512. /usr/local/pkgs/openssh-server-6.61/etc/init.d/.graft-config
  3513. /usr/local/pkgs/openssh-server-6.61/etc/init/.graft-config
  3514. /usr/local/pkgs/openssh-server-6.61/etc/network/if-up.d/.graft-config
  3515. /usr/local/pkgs/openssh-server-6.61/etc/pam.d/.graft-config
  3516. /usr/local/pkgs/openssh-server-6.61/etc/ufw/applications.d/.graft-config
  3517. /usr/local/pkgs/openssh-server-6.61/lib/systemd/system/.graft-config
  3518. </pre>
  3519. <p> The other directories in the distribution would not require any control
  3520. files. </p>
  3521. <p> Imagine that the local administrator has made some changes to
  3522. <tt>/etc/pam.d/sshd</tt> such as adding additional authentication methods
  3523. to support two-factor authentication for example. As the distribution
  3524. maintainer you do not want to reverse this local change so when the local
  3525. administrator upgrades the distribution, <em>Graft</em>
  3526. <strong>copies</strong> the new <tt>/etc/pam.d/sshd</tt> file to
  3527. <tt>/etc/pam.d/sshd.new</tt> which allows the local administrator to merge
  3528. their changes with any new features supported by the upgrade. </p>
  3529. <p> To take full advantage of this feature you may need to explicitly set the
  3530. target directory as follows: </p>
  3531. <pre>
  3532. graft -i -t / openssh-server-6.61
  3533. </pre>
  3534. <hr width="25%">
  3535. <h3><a name="partial-graft">Grafting part of a package</a></h3>
  3536. <p> Some packages can be successfully used when only part of their
  3537. installation directory is <em>grafted</em>. Other packages are
  3538. recalcitrant and need some special hand holding which can only be
  3539. solved by <em>grafting</em> each section of the package separately. </p>
  3540. <p> The first scenario can be handled by either <tt>.nograft</tt> files or
  3541. partial <em>grafts</em>. Consider <em>Perl</em> version <em>5.18.2</em>.
  3542. When installed in its own directory </p>
  3543. <pre>
  3544. /usr/local/pkgs/perl-5.18.2
  3545. </pre>
  3546. <p> there are three subdirectories </p>
  3547. <pre>
  3548. drwxr-sr-x 2 psamuel bisg 512 Oct 30 1996 bin
  3549. drwxr-sr-x 3 psamuel bisg 512 Oct 30 1996 lib
  3550. drwxr-sr-x 4 psamuel bisg 512 Oct 30 1996 man
  3551. </pre>
  3552. <p> Everything in the <tt>lib</tt> directory is exclusive to <em>Perl</em>
  3553. and does not require <em>grafting</em>. Therefore, <em>perl-5.18.2</em> can
  3554. be <em>grafted</em> using either of the following two methods: </p>
  3555. <pre>
  3556. touch /usr/local/pkgs/perl-5.18.2/lib/.nograft
  3557. graft -i perl-5.18.2
  3558. </pre>
  3559. or
  3560. <pre>
  3561. graft -it /usr/local/bin perl-5.18.2/bin
  3562. graft -it /usr/local/man perl-5.18.2/man
  3563. </pre>
  3564. <p> Now let's consider a recalcitrant package - <em>ObjectStore</em> version
  3565. 4.0.2.a.0. When installed in </p>
  3566. <pre>
  3567. /usr/local/pkgs/ostore-4.0.2.a.0
  3568. </pre>
  3569. <p> the following files and directories are available: </p>
  3570. <pre>
  3571. -rwxrwxr-x 1 pauln one3 1089 Oct 31 1996 Copyright
  3572. drwxrwxrwx 8 pauln one3 512 Oct 2 1996 common
  3573. drwxrwxrwx 6 pauln one3 512 Oct 31 1996 sunpro
  3574. -rw-r----- 1 root one3 1900544 Apr 29 1997 txn.log
  3575. </pre>
  3576. <p> The executable programs that need to be <em>grafted</em> are in
  3577. <tt>sunpro/bin</tt> and the manual pages that need to be <em>grafted</em>
  3578. are in <tt>common/man</tt>. Everything else in the package does not
  3579. need to be <em>grafted</em>. If the entire package was to be
  3580. <em>grafted</em> the result would be two directories that are not in the
  3581. regular <strong>$PATH</strong> and <strong>$MANPATH</strong> environment variables - namely
  3582. <tt>/usr/local/common/man</tt> and <tt>/usr/local/sunpro/bin</tt>, plus a host of
  3583. other directories that are not relevant for <em>grafting</em>. No amount
  3584. of <tt>.nograft</tt> and <tt>.graft-exclude</tt> juggling will solve
  3585. this problem. </p>
  3586. <p> The solution is to use two partial <em>grafts</em>: </p>
  3587. <pre>
  3588. graft -it /usr/local/bin ostore-4.0.2.a.0/sunpro/bin
  3589. graft -it /usr/local/man ostore-4.0.2.a.0/common/bin
  3590. </pre>
  3591. <p> Using this approach, the correct executables and manual pages are
  3592. available without the need to <em>graft</em> unnecessary files and
  3593. directories. </p>
  3594. <hr width="25%">
  3595. <h3><a name="deleting-packages">Deleting and/or Upgrading
  3596. Packages</a></h3>
  3597. <p> If you wish to upgrade a package - let's assume you wish to upgrade
  3598. <em>kermit</em> from version 5A190 to version 6.0.192 - you'd follow
  3599. these steps. </p>
  3600. <p> Firstly, you'd compile and install <em>kermit-6.0.192</em> in </p>
  3601. <pre>
  3602. /usr/local/pkgs/kermit-6.0.192
  3603. </pre>
  3604. <p> Once you'd tested it to your satisfaction, you'd need to delete the
  3605. symbolic links to the current <em>grafted</em> version. You can check
  3606. which actions <em>Graft</em> will perform by executing: </p>
  3607. <pre>
  3608. graft -d -n kermit-5A190
  3609. </pre>
  3610. <p> You'll see output similar to </p>
  3611. <pre>
  3612. Uninstalling links from /usr/local to /usr/local/pkgs/kermit-5A190
  3613. Processing /usr/local/pkgs/kermit-5A190
  3614. Processing /usr/local/pkgs/kermit-5A190/bin
  3615. UNLINK /usr/local/bin/kermit
  3616. UNLINK /usr/local/bin/wart
  3617. Processing /usr/local/pkgs/kermit-5A190/man
  3618. Processing /usr/local/pkgs/kermit-5A190/man/man1
  3619. UNLINK /usr/local/man/man1/kermit.1
  3620. Processing /usr/local/pkgs/kermit-5A190/doc
  3621. UNLINK /usr/local/doc/ckccfg.doc
  3622. UNLINK /usr/local/doc/ckuins.doc
  3623. UNLINK /usr/local/doc/ckc190.upd
  3624. UNLINK /usr/local/doc/ckcker.upd
  3625. UNLINK /usr/local/doc/ckaaaa.hlp
  3626. UNLINK /usr/local/doc/ckuaaa.hlp
  3627. Processing /usr/local/pkgs/kermit-5A190/lib
  3628. UNLINK /usr/local/lib/ckedemo.ini
  3629. UNLINK /usr/local/lib/ckeracu.ini
  3630. UNLINK /usr/local/lib/ckermit.ini
  3631. UNLINK /usr/local/lib/ckermod.ini
  3632. UNLINK /usr/local/lib/cketest.ini
  3633. UNLINK /usr/local/lib/ckevt.ini
  3634. UNLINK /usr/local/lib/ckurzsz.ini
  3635. UNLINK /usr/local/lib/.testing
  3636. </pre>
  3637. <p> If you're happy with the output from the test deletion you can delete
  3638. the <em>grafted</em> package. Once again, you'll only see output if a
  3639. failure occurs unless you use one of the verbose options. </p>
  3640. <p> If you execute: </p>
  3641. <pre>
  3642. graft -dV kermit-5A190
  3643. </pre>
  3644. <p> you'll see: </p>
  3645. <pre>
  3646. Uninstalling links from /usr/local to /usr/local/pkgs/kermit-5A190
  3647. Processing /usr/local/pkgs/kermit-5A190
  3648. Processing /usr/local/pkgs/kermit-5A190/bin
  3649. UNLINK /usr/local/bin/kermit
  3650. UNLINK /usr/local/bin/wart
  3651. Processing /usr/local/pkgs/kermit-5A190/man
  3652. Processing /usr/local/pkgs/kermit-5A190/man/man1
  3653. UNLINK /usr/local/man/man1/kermit.1
  3654. Processing /usr/local/pkgs/kermit-5A190/doc
  3655. UNLINK /usr/local/doc/ckccfg.doc
  3656. UNLINK /usr/local/doc/ckuins.doc
  3657. UNLINK /usr/local/doc/ckc190.upd
  3658. UNLINK /usr/local/doc/ckcker.upd
  3659. UNLINK /usr/local/doc/ckaaaa.hlp
  3660. UNLINK /usr/local/doc/ckuaaa.hlp
  3661. EMPTY /usr/local/doc is now empty. Delete manually if necessary.
  3662. Processing /usr/local/pkgs/kermit-5A190/lib
  3663. UNLINK /usr/local/lib/ckedemo.ini
  3664. UNLINK /usr/local/lib/ckeracu.ini
  3665. UNLINK /usr/local/lib/ckermit.ini
  3666. UNLINK /usr/local/lib/ckermod.ini
  3667. UNLINK /usr/local/lib/cketest.ini
  3668. UNLINK /usr/local/lib/ckevt.ini
  3669. UNLINK /usr/local/lib/ckurzsz.ini
  3670. </pre>
  3671. <p> <strong>NOTE</strong>: In this case the existence of an empty directory has been
  3672. discovered. If <em>Graft</em> empties a directory during a package
  3673. deletion, it will either notify you or delete the directory depending
  3674. on the combination of variables in the <tt>Makefile</tt> and command
  3675. line options. It's probably better practise not to automatically
  3676. delete empty directories as they may be used by other packages - such
  3677. as lock file directories for example. </p>
  3678. <p> Now you can remove the <em>real</em> package contents. (You may not wish
  3679. to do this immediately as some legacy systems may depend on features
  3680. provided by the older version or you may feel the need for further
  3681. testing before feeling confident that the old version can be removed):
  3682. </p>
  3683. <pre>
  3684. rm -rf /usr/local/pkgs/kermit-5A190
  3685. </pre>
  3686. <p> Now you can <em>graft</em> the new version of <em>kermit</em>. Execute: </p>
  3687. <pre>
  3688. graft -i -n kermit-6.0.192
  3689. </pre>
  3690. <p> to ensure that the <em>grafting</em> will proceed without error. Once
  3691. you are satisfied that this is the case you can <em>graft</em> the new
  3692. package by executing: </p>
  3693. <pre>
  3694. graft -i kermit-6.0.192
  3695. </pre>
  3696. <hr width="25%">
  3697. <h3><a name="transitioning">Transitioning a package to <em>Graft</em>
  3698. control</a></h3>
  3699. <p> <em>Graft</em> can be used to easily transition a package from its
  3700. current installation in your target directory to a <em>grafted</em>
  3701. installation. </p>
  3702. <p> As an example, let's consider the package <em>weblint</em> version 1.017.
  3703. It consists of three files installed in: </p>
  3704. <pre>
  3705. /usr/local/bin/weblint
  3706. /usr/local/lib/global.weblintrc
  3707. /usr/local/man/man1/weblint.1
  3708. </pre>
  3709. <p> The first step is to create a new copy of the package in its own
  3710. directory: </p>
  3711. <pre>
  3712. /usr/local/pkgs/weblint-1.017
  3713. </pre>
  3714. <p> Ensure that any references to library files are now made to
  3715. <tt>/usr/local/pkgs/weblint-1.017/lib</tt> instead of <tt>/usr/local/lib</tt>.
  3716. </p>
  3717. <p> Test the new installation to ensure it behaves as expected. </p>
  3718. <p> Then prune the old files from <tt>/usr/local/*</tt> using: </p>
  3719. <pre>
  3720. graft -pV weblint-1.017
  3721. </pre>
  3722. <p> You'd expect to see output similar to: </p>
  3723. <pre>
  3724. Pruning files in /usr/local which conflict with /usr/local/pkgs/weblint-1.017
  3725. Processing /usr/local/pkgs/weblint-1.017
  3726. Processing /usr/local/pkgs/weblint-1.017/man
  3727. Processing /usr/local/pkgs/weblint-1.017/man/man1
  3728. RENAME /usr/local/man/man1/weblint.1
  3729. Processing /usr/local/pkgs/weblint-1.017/bin
  3730. RENAME /usr/local/bin/weblint
  3731. Processing /usr/local/pkgs/weblint-1.017/lib
  3732. RENAME /usr/local/lib/global.weblintrc
  3733. </pre>
  3734. <p> If you elected to delete conflicting files instead of renaming them
  3735. you'd use: </p>
  3736. <pre>
  3737. graft -pDV weblint-1.017
  3738. </pre>
  3739. <p> and you'd see output similar to: </p>
  3740. <pre>
  3741. Pruning files in /usr/local which conflict with /usr/local/pkgs/weblint-1.017
  3742. Processing /usr/local/pkgs/weblint-1.017
  3743. Processing /usr/local/pkgs/weblint-1.017/man
  3744. Processing /usr/local/pkgs/weblint-1.017/man/man1
  3745. UNLINK /usr/local/man/man1/weblint.1
  3746. Processing /usr/local/pkgs/weblint-1.017/bin
  3747. UNLINK /usr/local/bin/weblint
  3748. Processing /usr/local/pkgs/weblint-1.017/lib
  3749. UNLINK /usr/local/lib/global.weblintrc
  3750. </pre>
  3751. <p> Now the new version of <em>weblint</em> 1.017 can be <em>grafted</em> in
  3752. place: </p>
  3753. <pre>
  3754. graft -i weblint-1.017
  3755. </pre>
  3756. <p> The <em>grafted</em> version of <em>weblint</em> can now be tested. </p>
  3757. <p> If we renamed conflicting files, they can be removed once the
  3758. <em>grafted</em> <em>weblint</em> has been satisfactorily tested: </p>
  3759. <pre>
  3760. rm /usr/local/man/man1/weblint.1.pruned
  3761. rm /usr/local/bin/weblint.pruned
  3762. rm /usr/local/lib/global.weblintrc.pruned
  3763. </pre>
  3764. <hr width="25%">
  3765. <h3><a name="conflicts">Conflict Processing</a></h3>
  3766. <p> Occasionally <em>Graft</em> will fail to completely install a package. This
  3767. occurs because <em>Graft</em> encounters a conflict. A conflict is defined as
  3768. one of the following possibilities: </p>
  3769. <center>
  3770. <table summary="Conflcits" border=2 cellpadding=3>
  3771. <tr>
  3772. <th>
  3773. Package Object
  3774. </th>
  3775. <th>
  3776. Target Object
  3777. </th>
  3778. </tr>
  3779. <tr>
  3780. <td>
  3781. directory
  3782. </td>
  3783. <td>
  3784. not a directory
  3785. </td>
  3786. </tr>
  3787. <tr>
  3788. <td>
  3789. file
  3790. </td>
  3791. <td>
  3792. directory
  3793. </td>
  3794. </tr>
  3795. <tr>
  3796. <td>
  3797. file
  3798. </td>
  3799. <td>
  3800. file
  3801. </td>
  3802. </tr>
  3803. <tr>
  3804. <td>
  3805. file
  3806. </td>
  3807. <td>
  3808. symbolic link to something other than the package object
  3809. </td>
  3810. </tr>
  3811. </table>
  3812. </center>
  3813. <p> If <em>Graft</em> encounters such a conflict during the installation of a
  3814. package it will report the conflict and exit. </p>
  3815. <p> Resolving the conflict depends on the nature of the conflict and is
  3816. beyond the scope of this discussion - however most conflicts will
  3817. either be the result of attempting to <em>graft</em> a package on top of
  3818. the same package actually installed in the target directory or a file
  3819. name clash between two (or more) different packages. </p>
  3820. <p> Conflicts arising from the pre-existence of a package in the target
  3821. directory can be resolved using <em>graft</em>'s prune mechanism
  3822. described above in <a href="#transitioning">&quot;Transitioning a
  3823. package to <em>Graft</em> control&quot;</a>. </p>
  3824. <p> File name clash conflicts can be resolved by the use of either a
  3825. <a href="#bypass"><tt>.nograft</tt></a> or
  3826. <a href="#exclude"><tt>.graft-exclude</tt></a> file or by
  3827. <em>grafting</em> only part of a package as described above in
  3828. <a href="#partial-graft">&quot;Grafting part of a package&quot;</a>.
  3829. </p>
  3830. <p> If <em>Graft</em> encounters a conflict while deleting a package, it will
  3831. report the conflict and continue deleting the remainder of the package.
  3832. In this way <em>Graft</em> will delete as much of the package as
  3833. possible. Conflicts that arise during deletion will probably be the
  3834. result of an incorrectly installed package or the installation of other
  3835. components of the same package without the use of <em>Graft</em>. </p>
  3836. <p> Conflict messages are written to standard error. All other messages
  3837. are written to standard output. To quickly determine if a package will
  3838. have any conflicts when <em>grafted</em>, redirect standard output to
  3839. <tt>/dev/null</tt> </p>
  3840. <pre>
  3841. graft -i -n <em>package</em> &gt; /dev/null
  3842. </pre>
  3843. <p> If you don't see any output then you can safely assume that there will
  3844. be no conflicts when <em>grafting</em> this package. </p>
  3845. <p> See the comprehensive table above describing how
  3846. <a href="#precedence">conflicts are handled</a> for more details. </p>
  3847. <hr width="25%">
  3848. <h3><a name="exitstatus">Exit Status</a></h3>
  3849. <p> <em>Graft</em> will terminate with an exit status of either 0, 1, 2, 3 or 4
  3850. under the following conditions: </p>
  3851. <center>
  3852. <table summary="Exit Status" border=2 cellpadding=3>
  3853. <tr>
  3854. <th>
  3855. Exit Status
  3856. </th>
  3857. <th>
  3858. Condition
  3859. </th>
  3860. </tr>
  3861. <tr>
  3862. <td>
  3863. <center>
  3864. <strong>0</strong>
  3865. </center>
  3866. </td>
  3867. <td>
  3868. All operations succeeded.
  3869. </td>
  3870. </tr>
  3871. <tr>
  3872. <td>
  3873. <center>
  3874. <strong>1</strong>
  3875. </center>
  3876. </td>
  3877. <td>
  3878. A conflict occurred during installation.
  3879. </td>
  3880. </tr>
  3881. <tr>
  3882. <td>
  3883. <center>
  3884. <strong>2</strong>
  3885. </center>
  3886. </td>
  3887. <td>
  3888. Command line syntax was incorrect.
  3889. </td>
  3890. </tr>
  3891. <tr>
  3892. <td>
  3893. <center>
  3894. <strong>3</strong>
  3895. </center>
  3896. </td>
  3897. <td>
  3898. One or more packages listed on the command line does not
  3899. exist. Other valid packages listed on the command line were
  3900. processed correctly.
  3901. </td>
  3902. </tr>
  3903. <tr>
  3904. <td>
  3905. <center>
  3906. <strong>4</strong>
  3907. </center>
  3908. </td>
  3909. <td>
  3910. The log file <tt>/var/log/graft</tt> could not be updated. Usually a
  3911. result of a permission error. Any other error condition will
  3912. override this condition.
  3913. </td>
  3914. </tr>
  3915. </table>
  3916. </center>
  3917. <hr>
  3918. <h2><a name="other-pkg-tools">Using <em>Graft</em> with other package
  3919. management tools</a></h2>
  3920. <p> Most Unix vendors have released their own package management tools with
  3921. their operating systems. Examples of this are Solaris 2.<em>x</em> with its
  3922. <em>SVR4 Package Manager</em> <tt>pkgadd</tt>, RedHat Linux with its
  3923. <em>RedHat Package Manager</em> <tt>rpm</tt>, Ubuntu Linux (and other Debian
  3924. Linux derivatives) with its <tt>dpkg</tt> system and HP-UX 10.<em>x</em> with
  3925. its <tt>swinstall</tt> suite. <em>Graft</em> has been designed as an adjunct
  3926. to these package managers rather than a competitor. The author has used
  3927. <em>Graft</em> successfully with all of the operating systems mentioned here.
  3928. </p>
  3929. <ul>
  3930. <li> <p> Many useful packages available in the public domain and from
  3931. other commercial sources are not shipped with most flavours of
  3932. Unix. <em>Graft</em> can be used to maintain a rich package
  3933. environment beyond the set of packages provided by your vendor.
  3934. Vendor based packages can still be maintained using the vendor's
  3935. tools and <em>Graft</em> can be used to maintain your own packages.
  3936. </p>
  3937. <li> <p> The vendor based management tools are usually used to maintain
  3938. single instances of a package on each machine. It is often
  3939. difficult to have multiple versions of the same package coexisting
  3940. on the same machine. <em>Graft</em> can be used to maintain multiple
  3941. versions of a package to support legacy, production and development
  3942. requirements simultaneously. </p>
  3943. <li> <p> Another common problem with vendor supplied software is
  3944. the speed at which upgrades are available. The large vendors are not
  3945. known for providing quick fixes to many of their packages. (Notable
  3946. exceptions to this are the vendors of operating systems based on
  3947. open source software who can draw on the enormous number of users
  3948. who submit patches because the source code is available). Using
  3949. <em>Graft</em> you can obtain a working public domain version of
  3950. a package (if one exists of course) and install it in a different
  3951. location to the vendor copy. When the vendor releases a new version of
  3952. the package, it can be installed using the vendor's package management
  3953. tool and your <em>grafted</em> copy can be removed (only if the vendor's
  3954. version of the package is better than the public domain version). </p>
  3955. <li> <p> Sometimes, a vendor's package doesn't quite perform in the
  3956. manner you'd like. It may be making assumptions about your file
  3957. system(s) that are incorrect for your environment or it may not
  3958. have all the features you'd like. If an alternative package is
  3959. available - either in the public domain or from other commercial
  3960. sources - it can be installed and <em>grafted</em> accordingly. </p>
  3961. </ul>
  3962. <hr>
  3963. <h2><a name="availability">Availability</a></h2>
  3964. <p> The latest version of <em>Graft</em> should always be available from: </p>
  3965. <pre>
  3966. <a href="http://peters.gormand.com.au/Home/tools/graft">http://peters.gormand.com.au/Home/tools/graft</a>
  3967. </pre>
  3968. <hr>
  3969. <h2><a name="license">License</a></h2>
  3970. <p> <em>Graft</em> is licensed under the terms of the GNU General Public
  3971. License, Version 2, June 1991. </p>
  3972. <p> You should have received a copy of the GNU General Public License
  3973. along with this program; if not, write to the Free Software Foundation,
  3974. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or download
  3975. it from the Free Software Foundation's web site: </p>
  3976. <pre>
  3977. <a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>
  3978. <a href="http://www.gnu.org/copyleft/gpl.txt">http://www.gnu.org/copyleft/gpl.txt</a>
  3979. </pre>
  3980. <hr>
  3981. </body>
  3982. </html>
  3983. <!-- html code generated by txt2tags 2.6. (http://txt2tags.org) -->
  3984. <!-- cmdline: txt2tags -t html pkgmanagement.t2t -->
  3985. </BODY></HTML>