graft.html 121 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <title>Graft</title>
  5. </head>
  6. <body>
  7. <center>
  8. <h1><em>Graft</em> - a package management utility</h1>
  9. </center>
  10. <h4>Prepared by Peter Samuel
  11. <a href="mailto:peter.r.samuel@gmail.com"><tt>&lt;peter.r.samuel@gmail.com&gt;</tt></a></h4>
  12. <h4>$Revision: 2.16 $</h4>
  13. <h4>$Date: 2018/04/16 14:54:07 $</h4>
  14. <blockquote>
  15. <p> <em><strong>graft:</strong> To insert (a graft) in a branch or stem
  16. of another tree; to propagate by insertion in another stock; also, to
  17. insert a graft upon. To implant a portion of (living flesh or skin) in
  18. a lesion so as to form an organic union. To join (one thing) to another
  19. as if by grafting, so as to bring about a close union.</em> </p>
  20. </blockquote>
  21. <hr>
  22. <h2><a name="contents">Contents</a></h2>
  23. <ul>
  24. <li> <a href="#intro">Introduction</a>
  25. <li> <a href="#rationale">Rationale</a>
  26. <li> <a href="#research">Research</a>
  27. <li> <a href="#design">Design</a>
  28. <ul>
  29. <li> <a href="#precedence">Control file precedence &amp; conflict resolution</a>
  30. </ul>
  31. <li> <a href="#history">History</a>
  32. <li> <a href="#installation">Installation</a>
  33. <ul>
  34. <li> <a href="#rpm_and_deb">Creating RPM and DEB packages</a>
  35. <li> <a href="#gotchas">Grafting <em>Graft</em> and
  36. <em>Perl</em> - the bootstrap problem</a>
  37. </ul>
  38. <li> <a href="#using-graft">Using <em>Graft</em></a>
  39. <ul>
  40. <li> <a href="#compiling-packages">Compiling
  41. Packages</a>
  42. <li><a href="#usage"><em>Graft</em> command line
  43. options</a>
  44. <ol>
  45. <li><a href="#graft-i">Install</a>
  46. <li><a href="#graft-d">Delete</a>
  47. <li><a href="#graft-p">Prune</a>
  48. <li><a href="#graft-L">Information</a>
  49. </ol>
  50. <li> <a href="#testing">Testing the <em>Graft</em>
  51. Installation</a>
  52. <li> <a href="#installing-packages">Installing
  53. Packages</a>
  54. <li> <a href="#bypass">Bypassing package
  55. directories</a>
  56. <li> <a href="#include">Including specific files
  57. and/or directories</a>
  58. <li> <a href="#exclude">Excluding specific files
  59. and/or directories</a>
  60. <li> <a href="#config_dirs">Grafting configuration files</a>
  61. <li><a href="#partial-graft">Grafting part of a
  62. package</a>
  63. <li> <a href="#deleting-packages">Deleting and/or
  64. Upgrading Packages</a>
  65. <li><a href="#transitioning">Transitioning a package to
  66. <em>Graft</em> control</a>
  67. <li> <a href="#conflicts">Conflict Processing</a>
  68. <li> <a href="#exitstatus">Exit Status</a>
  69. </ul>
  70. <li> <a href="#other-pkg-tools">Using <em>Graft</em> with
  71. other package management tools</a>
  72. <li> <a href="#availability">Availability</a>
  73. <li> <a href="#license">License</a>
  74. </ul>
  75. <hr>
  76. <h2><a name="intro">Introduction</a></h2>
  77. <p> <em>Graft</em> provides a mechanism for managing multiple packages
  78. under a single directory hierarchy. It was inspired by both <em>Depot</em>
  79. (Carnegie Mellon University) and <em>Stow</em> (Bob Glickstein). </p>
  80. <p> For the purposes of this discussion a <em>package</em> is defined as
  81. a suite of programs and files that make up an individual product. For
  82. example, the <em>package</em> known as <em>gcc</em> consists of the compiler
  83. and preprocessor programs, include files, manual pages and any other
  84. associated file or program. The concept of a <em>package</em> should not be
  85. confused with some vendor's definitions that are - by this definition -
  86. actually collections of <em>packages</em>. </p>
  87. <p> Special thanks to Gordon Rowell, Charles Butcher, Charlie Brady,
  88. Robert Maldon and Matias A. Fonzo for design suggestions and contributions.
  89. </p>
  90. <hr>
  91. <h2><a name="rationale">Rationale</a></h2>
  92. <p> In any reasonably large environment, many software packages will be
  93. installed. The installation location for these packages usually follows
  94. one of three rationales - each with its own advantages and drawbacks: </p>
  95. <ol>
  96. <li> <p> Each package is isolated from all other packages by
  97. installing it into a self contained directory tree. All binaries,
  98. manual pages, library and configuration files are stored under
  99. a single directory tree. This directory tree contains NO other
  100. files which are not the exclusive domain of the package in
  101. question. </p>
  102. <p> This method makes package demarcation obvious. As each
  103. package is self contained, identification of any file within a
  104. package is immediately apparent. </p>
  105. <p> Multiple versions of packages can be installed fairly easily
  106. to accommodate acceptance testing of new versions and/or legacy
  107. systems. </p>
  108. <p> However, the use of individual package directories can
  109. lead to VERY long <strong>$PATH</strong> and <strong>$MANPATH</strong> environment
  110. variables. Some shells may not be able to handle such long
  111. variables. Whenever a new package is added, each user MUST
  112. update their <strong>$PATH</strong> and <strong>$MANPATH</strong> to make the package
  113. available. </p>
  114. <li> <p> Packages are installed under a common directory tree.
  115. Binaries for all packages are grouped in a single directory,
  116. manual pages for all packages in another directory and so on.
  117. </p>
  118. <p> This method eliminates the need for continually updating long
  119. <strong>$PATH</strong> variables for each user. As soon as a package is
  120. placed into the common '<tt>bin</tt>' directory it is immediately
  121. available to all users (after a shell rehash if necessary). </p>
  122. <p> However, when a package is to be updated it is often very
  123. difficult to isolate all the files related to a particular
  124. package if they are intermingled with unrelated files. </p>
  125. <li> <p> A combination of methods (1) and (2). </p>
  126. </ol>
  127. <p> In an effort to maximise the advantages and minimise the
  128. disadvantages, <em>Depot</em>, <em>Stow</em> and <em>Graft</em> adopt a similar
  129. philosophy: </p>
  130. <blockquote>
  131. <p> Packages are installed in self contained directory trees and
  132. symbolic links from a common area are made to the package files. </p>
  133. </blockquote>
  134. <p> This approach allows multiple versions of the same package to co-exist
  135. on the one system. One version is the commonly available version and
  136. symbolic links will be made to this version. New versions can be tested
  137. and once acceptable can replace the current commonly available version.
  138. Older versions can still be used for legacy systems by using the
  139. '<em>real</em>' path name to the package instead of the '<em>common</em>'
  140. path name. </p>
  141. <p> The size and complexity of environment variables such as <strong>$PATH</strong>
  142. and <strong>$MANPATH</strong> is minimised because only the common area is
  143. required. Any special cases can also be accommodated but these will
  144. usually be in the minority when compared with the number of commonly
  145. available packages. </p>
  146. <hr>
  147. <h2><a name="research">Research</a></h2>
  148. <p> <strong>Note:</strong> Development of <em>Graft</em> began in late 1996. The
  149. comments regarding the packages listed below reflect their functionality
  150. and behaviour at that time and may not necessarily reflect their current
  151. functionality and behaviour. </p>
  152. <p> As stated earlier, <em>Graft</em> was inspired by <em>Depot</em> and
  153. <em>Stow</em>. Both these systems were examined and finally rejected for
  154. the following reasons: </p>
  155. <dl>
  156. <dt> <em>Depot</em>
  157. <a href="ftp://ftp.andrew.cmu.edu/pub/depot/depot.tar.gz">ftp://ftp.andrew.cmu.edu/pub/depot/depot.tar.gz</a>
  158. <dd> <p> <em>Depot</em> is very flexible yet cumbersome. </p>
  159. <p> It requires a database file to be created which
  160. provides a snapshot of the current state of both the package
  161. repository and the <em>Depot</em> target. It is possible to
  162. inadvertently destroy the package repository if the database
  163. is damaged. </p>
  164. <p> <em>Depot</em> assumes &quot;<em>ownership</em>&quot; of the
  165. target area, making it almost impossible to accommodate
  166. packages that are not under the control of <em>Depot</em>.
  167. ("<em>Ownership</em>" in this case means that <em>Depot</em>
  168. assumes ALL files in the target area will be under the
  169. control of <em>Depot</em>. It does not imply that <em>Depot</em>
  170. modifies Unix file permissions). </p>
  171. <p> Because of <em>Depot</em>'s assumed <em>ownership</em> it is
  172. difficult for other packages not under the control of
  173. <em>Depot</em> to be placed in the same target area. </p>
  174. <p> <em>Depot</em> attempts to impose a fixed package repository
  175. relative to the package target. It assumes that all
  176. packages will be stored under
  177. '<tt><em>dir</em>/depot/<em>package</em></tt>' and the target
  178. will be '<tt><em>dir</em></tt>'. This can be overridden on
  179. the command line but the internals of <em>Depot</em> make
  180. this mechanism cumbersome. </p>
  181. <p> <em>Depot</em> is written in C and there are many source
  182. files in its distribution. Local modifications would be
  183. difficult to quickly implement and test. </p>
  184. <dt> <em>Stow</em>
  185. <a href="https://www.gnu.org/software/stow/">https://www.gnu.org/software/stow/</a>
  186. <dd> <p> <em>Stow</em> is a stateless system. It requires no
  187. database or configuration information. </p>
  188. <p> Like <em>Depot</em>, it assumes that the package repository
  189. will be stored under '<tt><em>dir</em>/stow/<em>package</em></tt>'
  190. and the target will be '<tt><em>dir</em></tt>'. This can be
  191. overridden on the command line and works well during the
  192. install phase. </p>
  193. <p> <em>Stow</em> assumes &quot;<em>ownership</em>&quot;
  194. of the target area, making it difficult to accommodate
  195. packages that are not under the control of <em>Stow</em>.
  196. ("<em>Ownership</em>" in this case means that <em>Stow</em>
  197. assumes ALL files in the target area will be under the
  198. control of <em>Stow</em>. It does not imply that <em>Stow</em>
  199. modifies Unix file permissions). </p>
  200. <p> Because of <em>Stow</em>'s assumed <em>ownership</em>
  201. it is difficult for other packages not under the control
  202. of <em>Stow</em> to be placed in the same target area. When
  203. deleting packages, <em>Stow</em> examines everything in the
  204. target directory - whether it is associated with the package
  205. it is trying to delete or not. This can be time consuming and
  206. potentially dangerous as empty directories are also removed
  207. - even empty directories that do not belong to the package
  208. being removed. </p>
  209. <p> <em>Stow</em> has a clever feature of <em>folding</em> and
  210. <em>unfolding</em> directories. It attempts to optimise the
  211. number of symbolic links by making links to directories if
  212. the directory is only associated with a single package. If
  213. at a later date <em>Stow</em> discovers another package that
  214. needs that directory it will <em>unfold</em> that directory
  215. into a collection of symbolic links to files rather than
  216. a single symbolic link to the directory. <em>Stow</em> will
  217. <em>fold</em> the directory when removing packages if the
  218. remainder of the directory is only concerned with a single
  219. package. While clever, this feature is probably a waste of
  220. time and effort. It means that the entire package target
  221. must be scanned to determine package ownership of links and
  222. as packages will usually be replaced by newer versions a
  223. directory <em>fold</em> will probably be short lived. </p>
  224. <p> <em>Stow</em> will sometimes miss potential conflicts when
  225. run in <em>show only</em> mode. The conflicts may occur when a
  226. directory is unfolded and will not show up in <em>show only</em>
  227. mode. </p>
  228. <p> <em>Stow</em>'s author suggests that packages be compiled
  229. such that they refer to files in the target location rather
  230. than the actual package installation directory. This approach
  231. precludes the use of multiple versions of packages with
  232. different configuration and/or library files. </p>
  233. <p> <em>Stow</em> is written in <em>Perl</em> and is only a
  234. few hundred lines of code so local modifications can be
  235. accommodated. However there are very few comments in the
  236. code which makes the process of modification difficult. </p>
  237. </dl>
  238. <p> Since the release of <em>Graft</em> 1.6, the existence of yet another
  239. packaging program has been brought to the author's attention. </p>
  240. <dl>
  241. <dt> <em>Encap</em>
  242. <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>
  243. <dd> <p> <em>Encap</em> grew out of work begun at the University
  244. of Illinois Champaign-Urbana. It has the same underlying
  245. philosophy as <em>Depot</em>, <em>Stow</em> and <em>Graft</em> -
  246. encapsulate packages into self contained directories and use
  247. symbolic links to make them visible in a common location. </p>
  248. <p> <em>Encap</em> uses a combination of a <em>csh</em> wrapper
  249. and a <em>Perl</em> program to accomplish its work. Like both
  250. <em>Depot</em> and <em>Stow</em>, <em>Encap</em> assumes that all
  251. compiled packages will live under a single directory hierarchy
  252. - by default '<tt><em>dir</em>/encap/<em>package</em></tt>'. It
  253. then attempts to create a symbolic link tree for ALL the
  254. packages under this area. There doesn't appear to be any
  255. easy way to support the quick addition or removal of a single
  256. package. </p>
  257. <p> A new release of <em>Encap</em> incorporating many new
  258. features was expected to be available in early 1997, however
  259. no release greater than version 1.2 has been forthcoming. </p>
  260. <p> One good feature of <em>Encap</em> is the ability to exclude
  261. specific files from the package tree. This concept has been
  262. incorporated into <em>Graft</em> 1.7 and above. </p>
  263. </dl>
  264. <p> Since the release of <em>Graft</em> 2.3, the existence of
  265. several another packaging programs have been brought to the author's
  266. attention. Rather than outline their features and whether or not the
  267. author feels they are superior (or inferior) to <em>Graft</em>, a reference
  268. to each package and a brief description is given and further research
  269. is left as an exercise for the reader: </p>
  270. <dl>
  271. <dt> <em>stowES</em>
  272. <dd>
  273. <pre>
  274. <a href="https://os.inf.tu-dresden.de/~adam/stowES/">https://os.inf.tu-dresden.de/~adam/stowES/</a>
  275. </pre>
  276. <p> &quot;<em>stowES (stow Enhancement Script) is
  277. a Perl script which tries to ease the use of the "stow"
  278. packaging program and software which can be compiled and
  279. installed with autoconf. It automates the compilation and
  280. installation of software packages and provides some useful
  281. functions to maintain your stow packages (e.g., list packages,
  282. check packages for integrity, etc.).</em>&quot; </p>
  283. <dt> <em>opt_depot</em>
  284. <dd>
  285. <pre>
  286. <a href="https://github.com/jonabbey/opt_depot">https://github.com/jonabbey/opt_depot</a>
  287. </pre>
  288. <p> &quot;<em>opt_depot is a suite of Perl scripts which makes
  289. it easy to manage installed software across a wide range
  290. of client systems. opt_depot makes it possible to keep all
  291. files associated with a program together in one directory,
  292. so installation and de-installation is simple. opt_depot is
  293. easy to manage, and provides a scheme for installing software
  294. in a truly portable fashion; packages may be installed locally
  295. on client systems, or kept in a central package archive for
  296. NFS access. </em>&quot;</p>
  297. <p> This site also has links to several other package
  298. management utilities, including <em>Graft</em>. </p>
  299. <dt> <em>relink</em>
  300. <dd>
  301. <pre>
  302. <a href="http://sourceforge.net/projects/relink/">http://sourceforge.net/projects/relink/</a>
  303. </pre>
  304. <p> &quot;<em>relink is a package management tool for
  305. organization and management of software packages. It should
  306. run on any UNIX platform that runs PERL. Similar tools
  307. include: rpm(REDHAT/Mandrake), pkgadd(Slackware/SUN),
  308. stow(GNU) and depot(CMU)</em>&quot; </p>
  309. <dt> <em>univSrcPkg</em>
  310. <dd>
  311. <pre>
  312. <a href="http://freecode.com/articles/the-universal-source-package">http://freecode.com/articles/the-universal-source-package</a>
  313. </pre>
  314. <p> <a href="mailto:bud@sistema.it">Bud Bruegger</a> has written
  315. a brief paper outlining his thoughts on a &quot;<em>Universal Source
  316. Package</em>&quot; solution. </p>
  317. <p> This site also has links to other package management
  318. programs and similar items of interest. </p>
  319. </dl>
  320. <hr>
  321. <h2><a name="design">Design</a></h2>
  322. <p> This brings us to <em>Graft</em>. <em>Graft</em> has been designed to
  323. use the best features of <em>Depot</em>, <em>Stow</em> and <em>Encap</em>
  324. while maintaining as simple a mechanism as possible. The principles of
  325. <em>Graft</em> are: </p>
  326. <ul>
  327. <li> <p> <em>Graft</em> will allow packages to be <em>grafted</em>
  328. from any directory to any other directory. Default
  329. <tt>installation</tt> and <tt>target</tt> directories will be
  330. used but can easily be overridden on the command line. </p>
  331. <li> <p> <em>Graft</em> will log its actions to a log file. The
  332. log file can be specified on the command line. If not specified
  333. on the command line a default log file will be used. </p>
  334. <li> <p> <em>Graft</em> will NOT create symbolic links to
  335. directories. If a directory does not exist in the target tree
  336. it will be created (with the same ownership and permissions as
  337. the original if desired). </p>
  338. <li> <p> <em>Graft</em> will create symbolic links with full
  339. pathnames rather than relative pathnames. This allows easy
  340. identification of true package locations and facilitates block
  341. movement of a target tree without the need for <em>Graft</em>
  342. deletion and re-installation. </p>
  343. <li> <p> <em>Graft</em> will cease installation of a package if a
  344. conflict arises. A conflict is defined as one of the following
  345. conditions: </p>
  346. <ul>
  347. <li> If the package object is a directory and the
  348. target object exists but is not a directory.
  349. <li> If the package object is not a directory and the
  350. target object exists and is not a symbolic link.
  351. <li> If the package object is not a directory and the
  352. target object exists and is a symbolic link to
  353. something other than the package object.
  354. <li> If the package directory contains a
  355. <tt>.graft-config</tt> file and the target object exists
  356. but does not match the 32-bit CRC of the package object.
  357. </ul>
  358. <li> <p> Installation conflicts will always be reported. Conflicts
  359. will be reported to standard error. </p>
  360. <li> <p> <em>Graft</em> will attempt to display all possible
  361. operations when asked, even when asked not to perform the
  362. operations. </p>
  363. <li> <p> <em>Graft</em> will not delete directories when
  364. uninstalling. <em>Graft</em> will print an appropriate message if an
  365. empty directory results and leave the deletion for the operator
  366. to perform outside the scope of <em>Graft</em>'s operations. This
  367. ensures that <em>place holder</em> directories that may be
  368. used by other packages are not inadvertently removed. This
  369. feature can be permanently disabled by setting a flag in the
  370. <tt>Makefile</tt>. It can also be temporarily disabled using a
  371. command line option. </p>
  372. <li> <p> <em>Graft</em> will continue to delete the remainder of
  373. a package after a conflict arises. This maximises the amount of
  374. deletion that can be performed. </p>
  375. <li> <p> Deletion conflicts will always be reported. Conflicts
  376. will be reported to standard error. </p>
  377. <li> <p> <em>Graft</em> will only concern itself with files
  378. relating to the package at hand. This will allow other packages
  379. to be placed in the target area without fear of intervention by
  380. <em>Graft</em>. </p>
  381. <li> <p> <em>Graft</em> will only allow the superuser to install
  382. or delete packages. This feature can be permanently disabled by
  383. setting a flag in the <tt>Makefile</tt> or it may be overridden
  384. by a command line option. </p>
  385. <li> <p> If the file <tt>.nograft</tt> exists in any package
  386. directory, <em>Graft</em> will bypass that directory and any
  387. subdirectories during installation. The name of this file is
  388. specified in the <tt>Makefile</tt>. </p>
  389. <li> <p> When installing a directory tree, if the file
  390. <tt>.graft-exclude</tt> exists in any package directory,
  391. <em>Graft</em> will assume that the file contains a list of
  392. file and/or directory names - one per line - which correspond
  393. to files and/or directories in the directory containing the
  394. <tt>.graft-exclude</tt> file. These files and/or directories
  395. will NOT be <em>grafted</em>. The name of this file is specified
  396. in the <tt>Makefile</tt>. </p>
  397. <p> The <tt>.nograft</tt> file takes priority over the
  398. <tt>.graft-exclude</tt> file. </p>
  399. <li> <p> When installing a directory tree, if the file
  400. <tt>.graft-include</tt> exists in any package directory,
  401. <em>Graft</em> will assume that the file contains a list of
  402. file and/or directory names - one per line - which correspond
  403. to files and/or directories in the directory containing the
  404. <tt>.graft-include</tt> file. ONLY the files and/or directories
  405. listed in the <tt>.graft-include</tt> will be <em>grafted</em>. The
  406. name of this file is specified in the <tt>Makefile</tt>. </p>
  407. <p> The <tt>.graft-exclude</tt> file takes priority over the
  408. <tt>.graft-include</tt> file. </p>
  409. <li> <p> When installing a directory tree, if the file
  410. <tt>.graft-config</tt> exists in a package directory, the contents
  411. of the directory will be <strong>copied</strong> to the target
  412. directory. If the target files exists and is in conflict with the
  413. package file then the package file will be copied into the target
  414. directory as <tt>file<em>.new</em></tt>. </p>
  415. <p> The <tt>.graft-include</tt> file takes priority over the
  416. <tt>.graft-config</tt> file. </p>
  417. <li> <p> If the file <tt>.nograft</tt> exists in any package
  418. directory, it will be ignored and <em>Graft</em> will continue
  419. processing the directory and any subdirectories during
  420. deletion. </p>
  421. <li> <p> If the file <tt>.graft-exclude</tt> exists in any
  422. package directory, its contents will be ignored and <em>Graft</em>
  423. will continue processing the directory and any subdirectories
  424. during deletion. </p>
  425. <li> <p> If the file <tt>.graft-include</tt> exists in any
  426. package directory, its contents will be ignored and <em>Graft</em>
  427. will continue processing the directory and any subdirectories
  428. during deletion. </p>
  429. <li> <p> If the file <tt>.graft-config</tt> exists in any
  430. package directory, during deletion matching files in the target
  431. directory will not be deleted however any
  432. <tt>file<em>.new</em></tt> files will be deleted. </p>
  433. <li> <p> As an aid to transitioning systems to <em>Graft</em>,
  434. <em>Graft</em> will allow conflicting files to be pruned. This
  435. pruning can take the form of a file rename or a file removal
  436. depending on either a <tt>Makefile</tt> flag or a command line
  437. option. If file removal is selected and the file is a non-empty
  438. directory, it will be renamed instead. </p>
  439. <li> <p> If the file <tt>.nograft</tt> exists in any package
  440. directory, it will be ignored and <em>Graft</em> will continue
  441. processing the directory and any subdirectories during
  442. pruning. </p>
  443. <li> <p> If the file <tt>.graft-exclude</tt> exists in any
  444. package directory, its contents will be ignored and <em>Graft</em>
  445. will continue processing the directory and any subdirectories
  446. during pruning. </p>
  447. <li> <p> If the file <tt>.graft-include</tt> exists in any
  448. package directory, its contents will be ignored and <em>Graft</em>
  449. will continue processing the directory and any subdirectories
  450. during pruning. </p>
  451. <li> <p> If the file <tt>.graft-config</tt> exists in any
  452. package directory, the files in the directory will be ignored
  453. during pruning. Sub-directories will continue to be processed
  454. appropriately. </p>
  455. </ul>
  456. <h3><a name="precedence">Control file precedence &amp; conflict resolution</a></h3>
  457. <p> As stated above, the various <em>Graft</em> control files have the
  458. following precedence, from highest to lowest: </p>
  459. <pre>
  460. .nograft &gt; .graft-exclude &gt; .graft-include &gt; .graft-config
  461. </pre>
  462. <p> The following table summarises the activities of <em>Graft</em> when
  463. various control files are present: </p>
  464. <center>
  465. <table summary="Control File Precedence" border=2 cellpadding=3>
  466. <tr>
  467. <th colspan=5>
  468. Install
  469. </th>
  470. </tr>
  471. <tr>
  472. <th>
  473. <em>Target</em>
  474. </th>
  475. <th>
  476. <em>.nograft</em>
  477. </th>
  478. <th>
  479. <em>.graft-exclude</em>
  480. </th>
  481. <th>
  482. <em>.graft-include</em>
  483. </th>
  484. <th>
  485. <em>.graft-config</em>
  486. </th>
  487. </tr>
  488. <tr>
  489. <td>
  490. does not exist
  491. </td>
  492. <td>
  493. IGNORE
  494. </td>
  495. <td>
  496. IGNORE
  497. </td>
  498. <td>
  499. SYMLINK
  500. </td>
  501. <td>
  502. COPY
  503. </td>
  504. </tr>
  505. <tr>
  506. <td>
  507. symlink to source
  508. </td>
  509. <td>
  510. IGNORE
  511. </td>
  512. <td>
  513. IGNORE
  514. </td>
  515. <td>
  516. NOP
  517. </td>
  518. <td>
  519. DELETE &amp; COPY
  520. </td>
  521. </tr>
  522. <tr>
  523. <td>
  524. symlink to other
  525. </td>
  526. <td>
  527. IGNORE
  528. </td>
  529. <td>
  530. IGNORE
  531. </td>
  532. <td>
  533. CONFLICT
  534. </td>
  535. <td>
  536. N/A
  537. </td>
  538. </tr>
  539. <tr>
  540. <td>
  541. symlink to other (crc match)
  542. </td>
  543. <td>
  544. N/A
  545. </td>
  546. <td>
  547. N/A
  548. </td>
  549. <td>
  550. N/A
  551. </td>
  552. <td>
  553. NOP
  554. </td>
  555. </tr>
  556. <tr>
  557. <td>
  558. symlink to other (crc diff)
  559. </td>
  560. <td>
  561. N/A
  562. </td>
  563. <td>
  564. N/A
  565. </td>
  566. <td>
  567. N/A
  568. </td>
  569. <td>
  570. COPY.new
  571. </td>
  572. </tr>
  573. <tr>
  574. <td>
  575. file
  576. </td>
  577. <td>
  578. IGNORE
  579. </td>
  580. <td>
  581. IGNORE
  582. </td>
  583. <td>
  584. CONFLICT
  585. </td>
  586. <td>
  587. N/A
  588. </td>
  589. </tr>
  590. <tr>
  591. <td>
  592. file (crc match)
  593. </td>
  594. <td>
  595. N/A
  596. </td>
  597. <td>
  598. N/A
  599. </td>
  600. <td>
  601. N/A
  602. </td>
  603. <td>
  604. NOP
  605. </td>
  606. </tr>
  607. <tr>
  608. <td>
  609. file (crc diff)
  610. </td>
  611. <td>
  612. N/A
  613. </td>
  614. <td>
  615. N/A
  616. </td>
  617. <td>
  618. N/A
  619. </td>
  620. <td>
  621. COPY.new
  622. </td>
  623. </tr>
  624. <tr>
  625. <td>
  626. not a file
  627. </td>
  628. <td>
  629. IGNORE
  630. </td>
  631. <td>
  632. IGNORE
  633. </td>
  634. <td>
  635. CONFLICT
  636. </td>
  637. <td>
  638. CONFLICT
  639. </td>
  640. </tr>
  641. <tr>
  642. <th colspan=5>
  643. Delete
  644. </th>
  645. </tr>
  646. <tr>
  647. <th>
  648. <em>Target</em>
  649. </th>
  650. <th>
  651. <em>.nograft</em>
  652. </th>
  653. <th>
  654. <em>.graft-exclude</em>
  655. </th>
  656. <th>
  657. <em>.graft-include</em>
  658. </th>
  659. <th>
  660. <em>.graft-config</em>
  661. </th>
  662. </tr>
  663. <tr>
  664. <td>
  665. does not exist
  666. </td>
  667. <td>
  668. NOP
  669. </td>
  670. <td>
  671. NOP
  672. </td>
  673. <td>
  674. NOP
  675. </td>
  676. <td>
  677. NOP
  678. </td>
  679. </tr>
  680. <tr>
  681. <td>
  682. symlink to source
  683. </td>
  684. <td>
  685. DELETE
  686. </td>
  687. <td>
  688. DELETE
  689. </td>
  690. <td>
  691. DELETE
  692. </td>
  693. <td>
  694. DELETE &amp; DELETE.new
  695. </td>
  696. </tr>
  697. <tr>
  698. <td>
  699. symlink to other
  700. </td>
  701. <td>
  702. CONFLICT
  703. </td>
  704. <td>
  705. CONFLICT
  706. </td>
  707. <td>
  708. CONFLICT
  709. </td>
  710. <td>
  711. N/A
  712. </td>
  713. </tr>
  714. <tr>
  715. <td>
  716. symlink to other (crc match)
  717. </td>
  718. <td>
  719. N/A
  720. </td>
  721. <td>
  722. N/A
  723. </td>
  724. <td>
  725. N/A
  726. </td>
  727. <td>
  728. DELETE.new
  729. </td>
  730. </tr>
  731. <tr>
  732. <td>
  733. symlink to other (crc diff)
  734. </td>
  735. <td>
  736. N/A
  737. </td>
  738. <td>
  739. N/A
  740. </td>
  741. <td>
  742. N/A
  743. </td>
  744. <td>
  745. NOP
  746. </td>
  747. </tr>
  748. <tr>
  749. <td>
  750. file
  751. </td>
  752. <td>
  753. NOTE
  754. </td>
  755. <td>
  756. NOTE
  757. </td>
  758. <td>
  759. CONFLICT
  760. </td>
  761. <td>
  762. N/A
  763. </td>
  764. </tr>
  765. <tr>
  766. <td>
  767. file (crc match)
  768. </td>
  769. <td>
  770. N/A
  771. </td>
  772. <td>
  773. N/A
  774. </td>
  775. <td>
  776. N/A
  777. </td>
  778. <td>
  779. DELETE.new
  780. </td>
  781. </tr>
  782. <tr>
  783. <td>
  784. file (crc diff)
  785. </td>
  786. <td>
  787. N/A
  788. </td>
  789. <td>
  790. N/A
  791. </td>
  792. <td>
  793. N/A
  794. </td>
  795. <td>
  796. NOP
  797. </td>
  798. </tr>
  799. <tr>
  800. <td>
  801. not a file
  802. </td>
  803. <td>
  804. CONFLICT
  805. </td>
  806. <td>
  807. CONFLICT
  808. </td>
  809. <td>
  810. CONFLICT
  811. </td>
  812. <td>
  813. CONFLICT
  814. </td>
  815. </tr>
  816. <tr>
  817. <th colspan=5>
  818. Prune
  819. </th>
  820. </tr>
  821. <tr>
  822. <th>
  823. <em>Target</em>
  824. </th>
  825. <th>
  826. <em>.nograft</em>
  827. </th>
  828. <th>
  829. <em>.graft-exclude</em>
  830. </th>
  831. <th>
  832. <em>.graft-include</em>
  833. </th>
  834. <th>
  835. <em>.graft-config</em>
  836. </th>
  837. </tr>
  838. <tr>
  839. <td>
  840. does not exist
  841. </td>
  842. <td>
  843. NOP
  844. </td>
  845. <td>
  846. NOP
  847. </td>
  848. <td>
  849. NOP
  850. </td>
  851. <td>
  852. N/A
  853. </td>
  854. </tr>
  855. <tr>
  856. <td>
  857. symlink to source
  858. </td>
  859. <td>
  860. NOP
  861. </td>
  862. <td>
  863. NOP
  864. </td>
  865. <td>
  866. NOP
  867. </td>
  868. <td>
  869. N/A
  870. </td>
  871. </tr>
  872. <tr>
  873. <td>
  874. symlink to other
  875. </td>
  876. <td>
  877. PRUNE
  878. </td>
  879. <td>
  880. PRUNE
  881. </td>
  882. <td>
  883. PRUNE
  884. </td>
  885. <td>
  886. N/A
  887. </td>
  888. </tr>
  889. <tr>
  890. <td>
  891. file
  892. </td>
  893. <td>
  894. PRUNE
  895. </td>
  896. <td>
  897. PRUNE
  898. </td>
  899. <td>
  900. PRUNE
  901. </td>
  902. <td>
  903. N/A
  904. </td>
  905. </tr>
  906. <tr>
  907. <td>
  908. not a file
  909. </td>
  910. <td>
  911. PRUNE
  912. </td>
  913. <td>
  914. PRUNE
  915. </td>
  916. <td>
  917. PRUNE
  918. </td>
  919. <td>
  920. N/A
  921. </td>
  922. </tr>
  923. </table>
  924. </center>
  925. <hr>
  926. <h2><a name="history">History</a></h2>
  927. <p> Development on <em>Graft</em> began in October 1996. The initial design
  928. used a configuration file to map the installed location of each package to
  929. its target directory (that is the directory in which the symbolic links
  930. would be created). Work proceeded at a regular pace and by November 1997
  931. <em>Graft</em> version <em>2.1</em> was released. In this, and all
  932. subsequent versions, the configuration file had been removed in favour of
  933. using default source and target directories. </p>
  934. <p> No further work was performed until September 2000 when the concept of
  935. bypassing or including files and directories using <tt>.nograft</tt> or
  936. <tt>.graft-include</tt> files was introduced in <em>Graft</em> version
  937. <em>2.3</em>. </p>
  938. <p> Again nothing changed until February 2002 when Rod Whitby identified a
  939. bug in the handling of <tt>.graft-include</tt> files. Several other users
  940. (Peter Bray, Robert Maldon and others) also reported some deprecation
  941. warnings when using <em>Graft</em> with <em>Perl</em> version
  942. <em>5.6.0</em>. <em>Graft</em> version <em>2.4</em> was the end of
  943. <em>Graft</em> development for over a decade. </p>
  944. <p> In May 2015 Matias A. Fonzo contacted the author wishing to use
  945. <em>Graft</em> in the
  946. <a href="http://www.dragora.org/">Dragora GNU/Linux</a>
  947. distribution. Matias' usage of <em>Graft</em> lead to <em>Graft</em>
  948. version <em>2.5</em> in June 2015 whereby the <tt>-P</tt> command line
  949. option was silently ignored if the effective user was not root. </p>
  950. <p> Since the release of <em>Graft</em> version <em>2.4</em> the author's
  951. <em>Perl</em> code had improved somewhat so <em>Graft</em> version
  952. <em>2.6</em> released in July 2015 represented a major clean up of coding
  953. style and internals. No new behaviours or features were added to the
  954. <em>2.6</em> release. </p>
  955. <p> Matias made some more suggestions and improvements up to and including
  956. <em>Graft</em> version <em>2.16</em> in April 2018. These changes added
  957. the <tt>.graft-config</tt> control file, the <tt>-r /rootdir</tt> option for
  958. specifying a new root directory, the <tt>-L</tt> option for displaying
  959. default locations as well as introducing some tighter controls on the
  960. messages and exit status of <em>Graft</em> under various conditions. </p>
  961. <hr>
  962. <h2><a name="installation">Installation</a></h2>
  963. <p> Before installing <em>Graft</em> you'll need <em>Perl</em>
  964. 5.<em>x</em>. <em>Graft</em> version 2.<em>x</em> requires features only
  965. available with <em>Perl</em> 5.<em>x</em> and will not run with
  966. <em>Perl</em> 4.<em>x</em>. </p>
  967. <p> Your operating system and its file system(s) should also support
  968. symbolic links. If you can't make symbolic links then you can't use
  969. <em>Graft</em>! <em>Graft</em> will exit gracefully if your version of
  970. <em>Perl</em> does not support symbolic links. It will also exit gracefully
  971. if you attempt to <em>graft</em> a package into a file system that does not
  972. support symbolic links - from a Linux <tt>ext4</tt> file system into an
  973. <tt>vfat</tt> file system for example. </p>
  974. <p> <em>Graft</em> has been written to ensure it uses <em>Perl</em> modules
  975. that are considered part of the core <em>Perl</em> distribution. However it
  976. may be possible that you're using a home grown installation of
  977. <em>Perl</em> or some distribution that doesn't have the same <em>Perl</em>
  978. modules as the author's development environment. </p>
  979. <p> If this is the case you'll see compile failures for the following modules
  980. if they are unavailable: </p>
  981. <pre>
  982. File::Basename
  983. Getopt::Long
  984. </pre>
  985. <p> You will not be able to install <em>Graft</em> until these modules are
  986. available. </p>
  987. <p> You may also see run-time failures when using <em>Graft</em> with
  988. <tt>.graft-config</tt> files if the following modules are unavailable: </p>
  989. <pre>
  990. Compress::Raw::Zlib (<em>used in install and delete modes</em>)
  991. File::Copy (<em>only used in install mode</em>)
  992. </pre>
  993. <p> If you don't have these modules and you do not intend to use
  994. <tt>.graft-config</tt> files then you can continue to use <em>Graft</em>
  995. without issue. </p>
  996. <p> Follow these instructions to install <em>Graft</em>: </p>
  997. <ol>
  998. <li> <p> Unpack the gzipped <em>Graft</em> distribution: </p>
  999. <pre>
  1000. gunzip -c graft-2.16.tar.gz | tar xvf -
  1001. </pre>
  1002. <li> <p> change directories to the <em>Graft</em> distribution
  1003. directory: </p>
  1004. <pre>
  1005. cd graft-2.16
  1006. </pre>
  1007. <li> <p> Create an writable version of the <tt>Makefile</tt> by
  1008. running the command </p>
  1009. <pre>
  1010. make -f Makefile.dist
  1011. </pre>
  1012. <p> You'll see output similar to </p>
  1013. <pre>
  1014. cp Makefile.dist Makefile
  1015. chmod 644 Makefile
  1016. ######################################################
  1017. # #
  1018. # You'll now need to modify the Makefile #
  1019. # variables to suit your local conditions. #
  1020. # #
  1021. ######################################################
  1022. make: *** [Makefile] Error 1
  1023. </pre>
  1024. <p> You can ignore the error message. That is just there to
  1025. prevent the creation of the <em>graft</em> executable before you've
  1026. made your site specific configurations to the <tt>Makefile</tt>.
  1027. </p>
  1028. <li> <p> Edit the <tt>Makefile</tt>. The following variables should be
  1029. modified to suit your local requirements: </p>
  1030. <dl>
  1031. <dt>
  1032. <pre>
  1033. <strong>PACKAGEDIR</strong> = /usr/local/pkgs
  1034. <strong>TARGETDIR</strong> = /usr/local
  1035. </pre>
  1036. <dd> <p> These two variables control your default
  1037. package <tt>installation</tt> and <tt>target</tt>
  1038. directories. Most sites will probably choose to
  1039. install packages under a common <tt>installation</tt>
  1040. directory and then <em>graft</em> them into a common
  1041. <tt>target</tt> directory. </p>
  1042. <p> If no specific <tt>target</tt> directory is
  1043. given on the command line, <em>Graft</em> will use
  1044. the default value specified by <strong>TARGETDIR</strong>. If
  1045. a <tt>target</tt> directory is given on the command
  1046. line but is not fully qualified, the value specified
  1047. by <strong>TARGETDIR</strong> will be prepended to the command
  1048. line argument. </p>
  1049. <p> Package names provided to <em>Graft</em> that are
  1050. not fully qualified will have the value specified
  1051. by <strong>PACKAGEDIR</strong> prepended to the command line
  1052. arguments. </p>
  1053. <dt>
  1054. <pre>
  1055. <strong>TOP</strong> = $(PACKAGEDIR)/graft-$(VERSION)
  1056. <strong>BIN</strong> = $(TOP)/bin
  1057. <strong>MAN</strong> = $(TOP)/man
  1058. <strong>DOC</strong> = $(TOP)/doc
  1059. </pre>
  1060. <dd> <p> There should be no need to modify these
  1061. values unless you wish to install <em>Graft</em> into
  1062. a directory that is different from your default
  1063. package installation directory. If you do modify
  1064. <strong>TOP</strong> you should not change the values of
  1065. <strong>BIN</strong>, <strong>MAN</strong> and <strong>DOC</strong>. If you feel
  1066. you must change these values then perhaps you've
  1067. misunderstood the concept behind <em>Graft</em> so a
  1068. re-read of this document may be in order. </p>
  1069. <dt>
  1070. <pre>
  1071. <strong>PERL</strong> = /usr/bin/perl
  1072. </pre>
  1073. <dd> <p> This variable refers to the location
  1074. of the <em>Perl</em> 5.<em>x</em> that will be used by
  1075. the <em>Graft</em> executable. If you plan on
  1076. <em>grafting</em> <em>Perl</em> then this value should
  1077. be the <em>grafted</em> location of <em>Perl</em>
  1078. rather than the installation location of <em>Perl</em>.
  1079. If you are using an operating system that comes with
  1080. <em>Perl</em> 5.<em>x</em> - such as RedHat or Ubuntu
  1081. Linux - then you don't need to worry about
  1082. <em>grafting</em> <em>Perl</em> so the value of
  1083. <strong>PERL</strong> should reflect its installed
  1084. location. </p>
  1085. <p> Most Unix, Linux and other Unix like operating
  1086. systems ship with <em>Perl</em> these days so
  1087. modifying this value is probably unnecessary. </p>
  1088. <dt>
  1089. <pre>
  1090. <strong>BUILDPERL</strong> = $(PERL)
  1091. </pre>
  1092. <dd> <p> <em>Perl</em> is required during the
  1093. <tt>make</tt>. You'll only need to change this if
  1094. the current installed location of <em>Perl</em> is
  1095. different to the future <em>grafted</em> location of
  1096. <em>Perl</em>. </p>
  1097. <dt>
  1098. <pre>
  1099. <strong>LOGFILE</strong> = /var/log/graft
  1100. </pre>
  1101. <dd> <p> <em>Graft</em> logs all of its actions to a log
  1102. file. Modify the value of <strong>LOGFILE</strong> to suit
  1103. your local needs. An alternative name can be
  1104. specified on the command line. </p>
  1105. <p> If you want logging disabled by default, set the
  1106. value of <strong>LOGFILE</strong> to <tt>/dev/null</tt>. </p>
  1107. <dt>
  1108. <pre>
  1109. <strong>GRAFT-IGNORE</strong> = .nograft
  1110. <strong>GRAFT-EXCLUDE</strong> = .graft-exclude
  1111. <strong>GRAFT-INCLUDE</strong> = .graft-include
  1112. <strong>GRAFT-CONFIG</strong> = .graft-config
  1113. </pre>
  1114. <dd> <p> These variables hold the names of the
  1115. special <em>Graft</em> files that control whether or
  1116. not subdirectories or files are <em>grafted</em>. If
  1117. you change these values, try to choose obvious names.
  1118. If you want the files to appear in a simple directory
  1119. listing, do not use file names that begin with a
  1120. dot &quot;.&quot; character. </p>
  1121. <dt>
  1122. <pre>
  1123. <strong>GRAFT-NEVER</strong> =
  1124. </pre>
  1125. <dd> <p> This variable holds the names of the
  1126. files and/or directories that should never be
  1127. <em>grafted</em>. Typically these may be source code
  1128. repositories as used by systems such as
  1129. <em>CVS</em>, or perhaps lockfiles. The default
  1130. value is empty but if you wish to specify values,
  1131. simply add them to the variable using only
  1132. whitespace as a separator. For example: </p>
  1133. <pre>
  1134. GRAFT-NEVER = CVS RCS SCCS .lock
  1135. </pre>
  1136. <dt>
  1137. <pre>
  1138. <strong>NEVERGRAFT</strong> = 0
  1139. </pre>
  1140. <dd> <p> If this variable is set to <strong>1</strong>,
  1141. the files and/or directories specified by
  1142. <strong>GRAFT-NEVER</strong> will be automatically excluded
  1143. from the <em>grafted</em> directory. </p>
  1144. <p> If this variable is set to <strong>0</strong>, the files
  1145. and/or directories specified by <strong>GRAFT-NEVER</strong>
  1146. will be not be excluded from the <em>grafted</em>
  1147. directory. </p>
  1148. <p> The sense of this value is reversed by use of
  1149. the <strong>-C</strong> command line option.
  1150. <p> The automatic exclusion is bypassed completely
  1151. if the <em>grafted</em> directory contains either
  1152. a <tt>.nograft</tt> or <tt>.graft-include</tt>
  1153. file. </p>
  1154. <dt>
  1155. <pre>
  1156. <strong>PRUNED-SUFFIX</strong> = .pruned
  1157. </pre>
  1158. <dd> <p> This variable sets the suffix name of
  1159. <em>pruned</em> files. <em>Pruned</em> files will be
  1160. renamed <em>filename</em><tt>.pruned</tt>. </p>
  1161. <dt>
  1162. <pre>
  1163. <strong>CONFIG-SUFFIX</strong> = .new
  1164. </pre>
  1165. <dd> <p> This variable sets the suffix name of configuration
  1166. files that will be copied to the target directory when
  1167. the target object is in conflict with the package
  1168. object. The files will be copied as
  1169. <em>filename</em><tt>.new</tt>. </p>
  1170. <dt>
  1171. <pre>
  1172. <strong>SUPERUSER</strong> = 1
  1173. </pre>
  1174. <dd> <p> If this variable is set to <strong>1</strong> only
  1175. the superuser can <em>install</em>, <em>delete</em>
  1176. or <em>prune</em> packages. This can be overridden
  1177. by the use of the <strong>-u</strong> command line
  1178. option. If this variable is set to <strong>0</strong>,
  1179. superuser privileges are not required and the
  1180. <strong>-u</strong> override command line option is
  1181. disabled. </p>
  1182. <p> If you are installing a private copy of
  1183. <em>Graft</em> to manage packages in your home
  1184. directory you should set <strong>SUPERUSER</strong> to
  1185. <strong>0</strong>. </p>
  1186. <p> If you're using <em>Graft</em> to manage a global
  1187. set of packages you should set <strong>SUPERUSER</strong>
  1188. to <strong>1</strong>. </p>
  1189. <dt>
  1190. <pre>
  1191. <strong>PRESERVEPERMS</strong> = 0
  1192. </pre>
  1193. <dd> <p> When <em>grafting</em> packages, <em>Graft</em>
  1194. will create new directories as required. By setting
  1195. <strong>PRESERVEPERMS</strong> to <strong>1</strong>,
  1196. the original user id, group id and file modes will be
  1197. carried over to the new directory. This variable is
  1198. used only if <strong>SUPERUSER</strong> is set to
  1199. <strong>1</strong>. The sense of this variable can be
  1200. reversed using the <strong>-P</strong> command line
  1201. option. </p>
  1202. <dt>
  1203. <pre>
  1204. <strong>DELETEOBJECTS</strong> = 0
  1205. </pre>
  1206. <dd> <p> When deleting <em>grafted</em> packages,
  1207. <em>Graft</em> may leave empty directories. Setting
  1208. <strong>DELETEOBJECTS</strong> to <strong>1</strong>
  1209. will allow <em>Graft</em> to delete these directories.
  1210. If <strong>DELETEOBJECTS</strong> is <strong>0</strong>
  1211. then <em>Graft</em> will display an appropriate message
  1212. reminding the user that a directory has been emptied.
  1213. The sense of this variable can be reversed using the
  1214. <strong>-D</strong> command line option. </p>
  1215. <p> It's probably not good practise to set this value
  1216. to <strong>1</strong> as some directories may be used
  1217. as place holders by a number of different packages. If
  1218. the value is set to <strong>0</strong> deletion of
  1219. directories can be forced via the <strong>-D</strong>
  1220. command line option. </p>
  1221. <p> When pruning packages, <em>graft</em> can either
  1222. remove conflicting files or rename them. If
  1223. <strong>DELETEOBJECTS</strong> is set to
  1224. <strong>1</strong> the default prune action will be to
  1225. delete conflicting objects. If
  1226. <strong>DELETEOBJECTS</strong> is set to
  1227. <strong>0</strong> the default prune action will be to
  1228. rename conflicting objects. The sense of this variable
  1229. can be reversed using the <strong>-D</strong> command
  1230. line option. </p>
  1231. </dl>
  1232. <p> Save your changes and exit from the editor. </p>
  1233. <li> <p> Remove any existing executables by running: </p>
  1234. <pre>
  1235. make clean
  1236. </pre>
  1237. <p> You should see output similar to: </p>
  1238. <pre>
  1239. rm -f graft
  1240. </pre>
  1241. <li> <p> Create the <em>Graft</em> executable by running: </p>
  1242. <pre>
  1243. make
  1244. </pre>
  1245. <p> You should see output similar to: </p>
  1246. <pre>
  1247. /usr/bin/perl -wc graft.pl
  1248. graft.pl syntax OK
  1249. sed \
  1250. -e 's#xCONFIG-SUFFIXx#.new#g' \
  1251. -e 's#xDELETEOBJECTSx#0#g' \
  1252. -e 's#xGRAFT-CONFIGx#.graft-config#g' \
  1253. -e 's#xGRAFT-EXCLUDEx#.graft-exclude#g' \
  1254. -e 's#xGRAFT-IGNOREx#.nograft#g' \
  1255. -e 's#xGRAFT-INCLUDEx#.graft-include#g' \
  1256. -e 's#xGRAFT-NEVERx##g' \
  1257. -e 's#xLOGFILEx#/var/log/graft#g' \
  1258. -e 's#xNEVERGRAFTx#0#g' \
  1259. -e 's#xPACKAGEDIRx#/usr/local/pkgs#g' \
  1260. -e 's#xPERLx#/usr/bin/perl#g' \
  1261. -e 's#xPRESERVEPERMSx#0#g' \
  1262. -e 's#xPRUNED-SUFFIXx#.pruned#g' \
  1263. -e 's#xSUPERUSERx#1#g' \
  1264. -e 's#xTARGETDIRx#/usr/local#g' \
  1265. &lt; graft.pl &gt; graft
  1266. chmod +x graft
  1267. /usr/bin/perl -wc graft
  1268. graft syntax OK
  1269. if [ -n &quot;&quot; ]; \
  1270. then \
  1271. AUTOIGNORE=1; \
  1272. else \
  1273. AUTOIGNORE=0; \
  1274. fi; \
  1275. sed \
  1276. -e &quot;s#xAUTOIGNOREx#$AUTOIGNORE#g&quot; \
  1277. -e 's#xCONFIG-SUFFIXx#.new#g' \
  1278. -e 's#xDELETEOBJECTSx#0#g' \
  1279. -e 's#xDOCx#/usr/local/pkgs/graft-2.16/doc#g' \
  1280. -e 's#xGRAFT-CONFIGx#.graft-config#g' \
  1281. -e 's#xGRAFT-EXCLUDEx#.graft-exclude#g' \
  1282. -e 's#xGRAFT-IGNOREx#.nograft#g' \
  1283. -e 's#xGRAFT-INCLUDEx#.graft-include#g' \
  1284. -e 's#xGRAFT-NEVERx##g' \
  1285. -e 's#xLOGFILEx#/var/log/graft#g' \
  1286. -e 's#xNEVERGRAFTx#0#g' \
  1287. -e 's#xPACKAGEDIRx#/usr/local/pkgs#g' \
  1288. -e 's#xPERLx#/usr/bin/perl#g' \
  1289. -e 's#xPRESERVEPERMSx#0#g' \
  1290. -e 's#xPRUNED-SUFFIXx#.pruned#g' \
  1291. -e 's#xSUPERUSERx#1#g' \
  1292. -e 's#xTARGETDIRx#/usr/local#g' \
  1293. -e 's#xVERSIONx#2.16#g' \
  1294. &lt; graft.man &gt; graft.1
  1295. </pre>
  1296. <li> <p> If you're using the <em>automounter</em> under Solaris
  1297. 2.<em>x</em>, the installation process may not be able to directly
  1298. create the directory specified by <strong>TOP</strong>. If this is the case
  1299. then manually create this directory using whatever procedures
  1300. are appropriate for your operating system. </p>
  1301. <p> For example, if the <tt>/usr/local</tt> mount point is under the
  1302. control of the <em>automounter</em> via an entry in the
  1303. <tt>auto_pkgs</tt> map: </p>
  1304. <pre>
  1305. * nfshost:/export/sparc-SunOS-5.5.1/usr/local/&amp;
  1306. </pre>
  1307. <p> you'll need to create the <em>Graft</em> installation directory
  1308. by executing the following command on the machine <em>nfshost</em>:
  1309. </p>
  1310. <pre>
  1311. mkdir /export/sparc-SunOS-5.5.1/usr/local/pkgs/graft-2.16
  1312. </pre>
  1313. <li> <p> Install the <em>Graft</em> executable, manual page and
  1314. documentation by executing: </p>
  1315. <pre>
  1316. make install
  1317. </pre>
  1318. <p> You should see output similar to: </p>
  1319. <pre>
  1320. mkdir -p /usr/local/pkgs/graft-2.16/bin
  1321. cp graft /usr/local/pkgs/graft-2.16/bin
  1322. for i in graft.1; \
  1323. do \
  1324. manpage=`basename $i`; \
  1325. man=`expr $i : '.*\.\(.\)'`; \
  1326. mkdir -p /usr/local/pkgs/graft-2.16/man/man$man; \
  1327. cp $i /usr/local/pkgs/graft-2.16/man/man$man/$manpage; \
  1328. chmod 644 /usr/local/pkgs/graft-2.16/man/man$man/$manpage; \
  1329. done
  1330. for i in graft.html graft.pdf graft.ps graft.txt; \
  1331. do \
  1332. mkdir -p /usr/local/pkgs/graft-2.16/doc; \
  1333. cp doc/$i /usr/local/pkgs/graft-2.16/doc; \
  1334. chmod 644 /usr/local/pkgs/graft-2.16/doc/$i; \
  1335. touch /usr/local/pkgs/graft-2.16/doc/.nograft; \
  1336. done
  1337. </pre>
  1338. </ol>
  1339. <p> <em>Graft</em> is now installed and ready to be used. </p>
  1340. <p> <strong>NOTE:</strong> If you make changes to your <em>Graft</em> installation at a
  1341. later date, please run the following commands: </p>
  1342. <pre>
  1343. make clean
  1344. make install
  1345. </pre>
  1346. <p> Failure to do this may result in a <em>Graft</em> manual page that does
  1347. NOT reflect your current configuration. </p>
  1348. <h3><a name="rpm_and_deb">Creating RPM and DEB packages</a></h3>
  1349. <p> Beginning with <em>Graft</em> 2.11 there is now the ability to create
  1350. RPM and Debian installation packages. Obviously you'll need one or more of
  1351. the <em>rpmbuild</em> and <em>dpkg-deb</em> packages installed on your
  1352. system. </p>
  1353. <p> After editing the <tt>Makefile</tt> to suit your environment simply run
  1354. the appropriate <tt>make</tt> command to create the binary installation
  1355. package in the current directory: </p>
  1356. <pre>
  1357. make rpm
  1358. </pre>
  1359. <p> or </p>
  1360. <pre>
  1361. make deb
  1362. </pre>
  1363. <p> The creation of these packages is somewhat experimental. Please let the
  1364. author know if you have issues. </p>
  1365. <hr>
  1366. <h3><a name="gotchas">Grafting <em>Graft</em> and <em>Perl</em> - the
  1367. bootstrap problem</a></h3>
  1368. <p> <strong>If you are using an operating system that comes with <em>Perl</em>
  1369. 5.<em>x</em> - such as RedHat or Ubuntu Linux - then you don't need to worry
  1370. about <em>grafting</em> <em>Perl</em>, so this section can be ignored.</strong> </p>
  1371. <p> <strong>However if you are a creator of an operating system
  1372. distribution then this section may be relevant.</strong> </p>
  1373. <p> Embedded into the <em>Graft</em> executable is the location of the
  1374. <em>Perl</em> executable. If you've understood the concept behind
  1375. <em>Graft</em> then this location may be the <em>grafted</em> location of
  1376. <em>Perl</em> rather than the true location of <em>Perl</em>. </p>
  1377. <p> This presents a dilemma when you come to <em>graft</em> both <em>Graft</em>
  1378. and <em>Perl</em>. You can't run the <em>grafted</em> location of the
  1379. <em>Graft</em> executable because it doesn't exist yet, and you can't run
  1380. the real location of the <em>Graft</em> executable because <em>Perl</em>
  1381. hasn't been <em>grafted</em> yet. </p>
  1382. <p> Assuming that <em>Graft</em> and <em>Perl</em> are installed in </p>
  1383. <pre>
  1384. /usr/local/pkgs/graft-2.16
  1385. /usr/local/pkgs/perl-5.18.2
  1386. </pre>
  1387. <p> you can resolve this dilemma by executing the following commands:
  1388. </p>
  1389. <pre>
  1390. /usr/local/pkgs/perl-5.18.2/bin/perl /usr/local/pkgs/graft-2.16/bin/graft -i graft-2.16
  1391. /usr/local/pkgs/perl-5.18.2/bin/perl /usr/local/pkgs/graft-2.16/bin/graft -i perl-5.18.2
  1392. </pre>
  1393. <p> This will <em>graft</em> both <em>Graft</em> and <em>Perl</em> from the
  1394. default package installation directory (as specified by
  1395. <strong>PACKAGEDIR</strong> in the <tt>Makefile</tt>) into your default target
  1396. directory (as specified by <strong>TARGETDIR</strong> in the <tt>Makefile</tt>).
  1397. </p>
  1398. <p> If you don't wish to use the default directories you can use the
  1399. following commands to <em>graft</em> the packages into <tt>/pkgs</tt>
  1400. instead of <tt>/usr/local</tt> for example: </p>
  1401. <pre>
  1402. /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
  1403. /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
  1404. </pre>
  1405. <p> Now both <em>Graft</em> and <em>Perl</em> have been <em>grafted</em> and any
  1406. other package can be <em>grafted</em> by executing the simpler command:
  1407. </p>
  1408. <pre>
  1409. graft -i <em>package</em>
  1410. </pre>
  1411. <p> The <em>Graft</em> distribution includes a program called
  1412. <tt>graftBootStrap.sh</tt> which allows you to easily <em>graft</em> both
  1413. <em>Graft</em> and <em>Perl</em>. It can be found in the <em>contrib</em>
  1414. directory of the distribution. Thanks to Gordon Rowell for providing it.</p>
  1415. <p> You may also find the <tt>-L</tt> command line option to be useful to
  1416. programmatically determine where <em>Graft</em> expects to find
  1417. <em>Perl</em> along with the default locations of its log file, target and
  1418. package directories. See the <a href="#graft-L">Information</a> section
  1419. below for details. </p>
  1420. <hr>
  1421. <h2><a name="using-graft">Using <em>Graft</em></a></h2>
  1422. <h3><a name="compiling-packages">Compiling Packages</a></h3>
  1423. <p> Any packages you wish to place under the control of <em>Graft</em> should
  1424. be compiled and installed in such a way that any package dependent
  1425. files are referenced with the ACTUAL package installation directory
  1426. rather than the common area in which <em>Graft</em> will be creating
  1427. symbolic links. For example, ensure that <em>Perl</em> version
  1428. <em>5.18.2</em> is looking for its library files in
  1429. <tt>/usr/local/pkgs/perl-5.18.2/lib/perl5</tt> instead of
  1430. <tt>/usr/local/lib/perl5</tt>. This approach will allow you to easily
  1431. separate multiple versions of the same package without any problems. </p>
  1432. <hr width="25%">
  1433. <h3><a name="usage"><em>Graft</em> command line options</a></h3>
  1434. <p> All of the details concerning actions, package locations and target
  1435. directories are passed to <em>Graft</em> on the command line.
  1436. (<em>Graft</em> 1.<em>x</em> used a configuration file. This has now been
  1437. deprecated in favour of a log file). </p>
  1438. <p> <em>Graft</em>'s command line options can be summarised as: </p>
  1439. <pre>
  1440. graft -i [-P|u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  1441. graft -d [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  1442. graft -p [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  1443. graft -L
  1444. </pre>
  1445. <p> <em>Graft</em> has four basic actions: </p>
  1446. <ol>
  1447. <li> <p> <a name="graft-i"><strong>Install</strong></a> </p>
  1448. <pre>
  1449. graft -i [-C] [-P|u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  1450. </pre>
  1451. <dl>
  1452. <dt> <strong>-i</strong>
  1453. <dd>
  1454. <p> Install symbolic links from the package
  1455. installation directory to the target directory.
  1456. Requires superuser privileges if
  1457. <strong>SUPERUSER</strong> was set to <strong>1</strong> in the
  1458. <tt>Makefile</tt>. </p>
  1459. <dt> <strong>-C</strong>
  1460. <dd>
  1461. <p> If <strong>NEVERGRAFT</strong> was set to <strong>1</strong>
  1462. in the <tt>Makefile</tt>, disable the automatic
  1463. exclusion of files and/or directories whose
  1464. names exactly match the values specified by
  1465. <strong>GRAFT-NEVER</strong> in the <tt>Makefile</tt>. </p>
  1466. <p> If <strong>NEVERGRAFT</strong> was set to <strong>0</strong>
  1467. in the <tt>Makefile</tt>, force the automatic
  1468. exclusion of files and/or directories whose
  1469. names exactly match the values specified by
  1470. <strong>GRAFT-NEVER</strong> in the <tt>Makefile</tt>. </p>
  1471. <p> Can only be used with the -i option. </p>
  1472. <p> This option is ignored for each <em>grafted</em>
  1473. directory, if the directory contains a
  1474. <tt>.nograft</tt> or <tt>.graft-include</tt>
  1475. file. </p>
  1476. <p> The <em>Graft</em> manual page will correctly
  1477. reflect the behaviour of this option based on the
  1478. values specified in the <tt>Makefile</tt>. If there
  1479. are no objects specified for
  1480. <strong>GRAFT-NEVER</strong> then this option will
  1481. be silently ignored and will not appear in the help
  1482. message nor in the manual page. </p>
  1483. <dt> <strong>-P</strong>
  1484. <dd>
  1485. <p> Preserve modes and ownerships when creating new
  1486. directories or copying files if
  1487. <strong>PRESERVEPERMS</strong> was set to
  1488. <strong>0</strong> in the <tt>Makefile</tt>. Do not
  1489. preserve modes and ownerships if the option is not
  1490. provided on the command line. </p>
  1491. <p> Do not preserve modes and ownerships when
  1492. creating new directories or copying files if
  1493. <strong>PRESERVEPERMS</strong> was set to
  1494. <strong>1</strong> in the <tt>Makefile</tt>.
  1495. Preserve modes and ownerships if the option is not
  1496. provided on the command line. </p>
  1497. <p> Cannot be used with the <strong>-u</strong> option. </p>
  1498. <p> This option will be silently ignored if the
  1499. effective user of <em>Graft</em> is not root. </p>
  1500. <p> The <em>Graft</em> manual page will correctly
  1501. reflect the behaviour of this option based on the
  1502. values specified in the <tt>Makefile</tt>. This
  1503. option will be silently ignored and will not appear
  1504. in the help message nor in the manual page if
  1505. <strong>SUPERUSER</strong> was set to
  1506. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  1507. <dt> <strong>-u</strong>
  1508. <dd>
  1509. <p> Superuser privileges are not required when
  1510. installing packages. </p>
  1511. <p> Cannot be used with the <strong>-P</strong> option. </p>
  1512. <p> This option is only available if
  1513. <strong>SUPERUSER</strong> was set to
  1514. <strong>1</strong> in the <tt>Makefile</tt>. </p>
  1515. <p> The <em>Graft</em> manual page will correctly
  1516. reflect the behaviour of this option based on the
  1517. values specified in the <tt>Makefile</tt>. This
  1518. option will be silently ignored and will not appear
  1519. in the help message nor in the manual page if
  1520. <strong>SUPERUSER</strong> was set to
  1521. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  1522. <dt> <strong>-l <em>log</em></strong>
  1523. <dd>
  1524. <p> Specify an alternate log file instead of the
  1525. default specified by <strong>LOGFILE</strong> in the
  1526. <tt>Makefile</tt>. No logging is performed if
  1527. the <strong>-n</strong> option is used. </p>
  1528. <p> Log entries have the form: </p>
  1529. <pre>
  1530. 878790215 1.10+ I /usr/local/pkgs/cpio-2.4.2 /usr/local
  1531. 878888916 2.1 I /usr/local/pkgs/gzip-1.2.4 /usr/local
  1532. 878888916 2.1 IC /usr/local/pkgs/gzip-1.2.4/bin/gzip invalid symlink
  1533. </pre>
  1534. <p> This shows that a development version of
  1535. <em>graft</em> (1.10+) was used to install
  1536. symbolic links from <tt>/usr/local/pkgs/cpio-2.4.2</tt>
  1537. to <tt>/usr/local</tt>. A new version of
  1538. <em>graft</em> (2.1) was used to install symbolic
  1539. links from <tt>/usr/local/pkgs/gzip-1.2.4</tt> to
  1540. <tt>/usr/local</tt>. The <tt>IC</tt> entry indicates
  1541. that a conflict occurred during this
  1542. installation - the file <tt>/usr/local/pkgs/bin/gzip</tt>
  1543. was a symbolic link to something other than
  1544. <tt>/usr/local/pkgs/gzip-1.2.4/bin/gzip</tt>. </p>
  1545. <dt> <strong>-n</strong>
  1546. <dd>
  1547. <p> List actions but do not perform them. Implies
  1548. the very verbose option. Does not require
  1549. superuser privileges regardless of the value of
  1550. <strong>SUPERUSER</strong> in the <tt>Makefile</tt>. </p>
  1551. <dt> <strong>-v</strong>
  1552. <dd>
  1553. <p> Be verbose. </p>
  1554. <dt> <strong>-V</strong>
  1555. <dd>
  1556. <p> Be very verbose. </p>
  1557. <dt> <strong>-r <em>/rootdir</em></strong>
  1558. <dd>
  1559. <p> Use the fully qualified named directory as the
  1560. root directory for all graft operations. The source
  1561. directory, target directory and log file will all
  1562. be relative to this specific directory. </p>
  1563. <p> Can only be used by the superuser. </p>
  1564. <dt> <strong>-s</strong>
  1565. <dd>
  1566. <p> <em>Stow</em>/<em>Depot</em> compatibility mode.
  1567. Infer the <em>Graft</em> target directory from
  1568. each package installation directory in the
  1569. manner of <em>Stow</em> and <em>Depot</em>. </p>
  1570. <p> Target directory is the <tt>dirname</tt> of the
  1571. <tt>dirname</tt> of the package installation
  1572. directory. (Yes that really is two
  1573. <tt>dirname</tt>s). So if the package
  1574. installation directory is </p>
  1575. <pre>
  1576. /usr/local/depot/gzip-1.2.4
  1577. </pre>
  1578. <p> the package will be <em>grafted</em> into
  1579. </p>
  1580. <pre>
  1581. /usr/local
  1582. </pre>
  1583. <p> Cannot be used with the <strong>-t</strong> option. </p>
  1584. <dt> <strong>-t <em>target</em></strong>
  1585. <dd>
  1586. <p> Override the default <em>graft</em> target
  1587. directory with <strong><em>target</em></strong>. The value
  1588. of <strong><em>target</em></strong> must be a fully
  1589. qualified directory and it must exist. </p>
  1590. <p> Cannot be used with the <strong>-s</strong> option. </p>
  1591. <dt> <strong>package</strong>
  1592. <dd>
  1593. <p> Install the named package. If <strong>package</strong> is
  1594. a fully qualified directory, use it as the
  1595. package installation directory. If
  1596. <strong>package</strong> is not a fully qualified
  1597. directory, prepend it with the value of
  1598. <strong>PACKAGEDIR</strong> as specified in the
  1599. <tt>Makefile</tt>. </p>
  1600. </dl>
  1601. <hr width="10%">
  1602. <li> <p> <a name="graft-d"><strong>Delete</strong></a> </p>
  1603. <pre>
  1604. graft -d [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  1605. </pre>
  1606. <dl>
  1607. <dt> <strong>-d</strong>
  1608. <dd>
  1609. <p> Delete symbolic links from the package target
  1610. directory to the package installation
  1611. directory. Requires superuser privileges if
  1612. <strong>SUPERUSER</strong> was set to <strong>1</strong> in the
  1613. <tt>Makefile</tt>. </p>
  1614. <dt> <strong>-D</strong>
  1615. <dd>
  1616. <p> Delete empty directories if
  1617. <strong>DELETEOBJECTS</strong> was set to <strong>0</strong> in the
  1618. <tt>Makefile</tt>. If the option is not
  1619. provided on the command line, notify the user
  1620. that a directory has been emptied. </p>
  1621. <p> Do not delete empty directories if
  1622. <strong>DELETEOBJECTS</strong> was set to <strong>1</strong> in the
  1623. <tt>Makefile</tt>. Notify the user that a
  1624. directory has been emptied. If the option is
  1625. not provided on the command line, delete empty
  1626. directories. </p>
  1627. <p> The <em>Graft</em> manual page will correctly
  1628. reflect the behaviour of this option based on the
  1629. values specified in the <tt>Makefile</tt>. </p>
  1630. <dt> <strong>-u</strong>
  1631. <dd>
  1632. <p> Superuser privileges are not required when
  1633. deleting packages. </p>
  1634. <p> This option is only available if
  1635. <strong>SUPERUSER</strong> was set to
  1636. <strong>1</strong> in the <tt>Makefile</tt>. </p>
  1637. <p> The <em>Graft</em> manual page will correctly
  1638. reflect the behaviour of this option based on the
  1639. values specified in the <tt>Makefile</tt>. This
  1640. option will be silently ignored and will not appear
  1641. in the help message nor in the manual page if
  1642. <strong>SUPERUSER</strong> was set to
  1643. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  1644. <dt> <strong>-l <em>log</em></strong>
  1645. <dd>
  1646. <p> Specify an alternate log file instead of the
  1647. default specified by <strong>LOGFILE</strong> in the
  1648. <tt>Makefile</tt>. No logging is performed if
  1649. the <strong>-n</strong> option is used. </p>
  1650. <p> Log entries have the form: </p>
  1651. <pre>
  1652. 879126278 1.10+ D /usr/local/pkgs/weblint-1.017 /usr/local
  1653. 879126278 1.10+ DC /usr/local/pkgs/weblint-1.017/bin/weblint file exists
  1654. 879126278 1.10+ DC /usr/local/pkgs/weblint-1.017/man/man1/weblint.1 file exists
  1655. </pre>
  1656. <p> This shows that a development version of
  1657. <em>graft</em> (1.10+) was used to delete
  1658. symbolic links from <tt>/usr/local</tt> to
  1659. <tt>/usr/local/pkgs/weblint-1.017</tt>. The <tt>DC</tt>
  1660. entries indicate that conflicts occurred during
  1661. this action - the files
  1662. <tt>/usr/local/bin/weblint</tt> and
  1663. <tt>/usr/local/man/man1/weblint.1</tt> already
  1664. exist. </p>
  1665. <dt> <strong>-n</strong>
  1666. <dd>
  1667. <p> List actions but do not perform them. Implies
  1668. the very verbose option. Does not require
  1669. superuser privileges regardless of the value of
  1670. <strong>SUPERUSER</strong> in the <tt>Makefile</tt>. </p>
  1671. <dt> <strong>-v</strong>
  1672. <dd>
  1673. <p> Be verbose. </p>
  1674. <dt> <strong>-V</strong>
  1675. <dd>
  1676. <p> Be very verbose. </p>
  1677. <dt> <strong>-r <em>/rootdir</em></strong>
  1678. <dd>
  1679. <p> Use the fully qualified named directory as the
  1680. root directory for all graft operations. The source
  1681. directory, target directory and log file will all
  1682. be relative to this specific directory. </p>
  1683. <p> Can only be used by the superuser. </p>
  1684. <dt> <strong>-s</strong>
  1685. <dd>
  1686. <p> <em>Stow</em>/<em>Depot</em> compatibility mode.
  1687. Infer the <em>Graft</em> target directory from
  1688. each package installation directory in the
  1689. manner of <em>Stow</em> and <em>Depot</em>. </p>
  1690. <p> Target directory is the <tt>dirname</tt> of the
  1691. <tt>dirname</tt> of the package installation
  1692. directory. (Yes that really is two
  1693. <tt>dirname</tt>s). So if the package
  1694. installation directory is </p>
  1695. <pre>
  1696. /usr/local/depot/gzip-1.2.4
  1697. </pre>
  1698. <p> the package will be <em>grafted</em> into
  1699. </p>
  1700. <pre>
  1701. /usr/local
  1702. </pre>
  1703. <p> Cannot be used with the <strong>-t</strong> option. </p>
  1704. <dt> <strong>-t <em>target</em></strong>
  1705. <dd>
  1706. <p> Override the default <em>graft</em> target
  1707. directory with <strong><em>target</em></strong>. The value
  1708. of <strong><em>target</em></strong> must be a fully
  1709. qualified directory and it must exist. </p>
  1710. <p> Cannot be used with the <strong>-s</strong> option. </p>
  1711. <dt> <strong>package</strong>
  1712. <dd>
  1713. <p> Delete the named package. If <strong>package</strong> is
  1714. a fully qualified directory, use it as the
  1715. package installation directory. If
  1716. <strong>package</strong> is not a fully qualified
  1717. directory, prepend it with the value of
  1718. <strong>PACKAGEDIR</strong> as specified in the
  1719. <tt>Makefile</tt>. </p>
  1720. </dl>
  1721. <hr width="10%">
  1722. <li> <p> <a name="graft-p"><strong>Prune</strong></a> </p>
  1723. <pre>
  1724. graft -p [-D] [-u] [-l log] [-n] [-v|V] [-r /rootdir] [-s|-t target] package(s)
  1725. </pre>
  1726. <dl>
  1727. <dt> <strong>-p</strong>
  1728. <dd>
  1729. <p> Prune objects (files, links or directories)
  1730. from the package target directory that are in
  1731. conflict with the package installation
  1732. directory. Requires superuser privileges if
  1733. <strong>SUPERUSER</strong> was set to <strong>1</strong> in the
  1734. <tt>Makefile</tt>. </p>
  1735. <dt> <strong>-D</strong>
  1736. <dd>
  1737. <p> Remove conflicting objects if
  1738. <strong>DELETEOBJECTS</strong> was set to <strong>0</strong> in the
  1739. <tt>Makefile</tt>. Rename conflicting objects
  1740. as <tt><em>object</em>.pruned</tt> if the option
  1741. is not provided on the command line. </p>
  1742. <p> Rename conflicting objects to
  1743. <tt><em>object</em>.pruned</tt> if
  1744. <strong>DELETEOBJECTS</strong> was set to <strong>1</strong> in the
  1745. <tt>Makefile</tt>. Remove conflicting objects
  1746. if the option is not provided in the command
  1747. line. </p>
  1748. <p> If a directory is to be removed and it is not
  1749. empty, it will be renamed as
  1750. <tt><em>dir</em>.pruned</tt> and a suitable
  1751. warning message will be given regardless of the
  1752. sense of this flag. </p>
  1753. <p> The <em>Graft</em> manual page will correctly
  1754. reflect the behaviour of this option based on the
  1755. values specified in the <tt>Makefile</tt>. </p>
  1756. <dt> <strong>-u</strong>
  1757. <dd>
  1758. <p> Superuser privileges are not required when
  1759. pruning packages. </p>
  1760. <p> This option is only available if
  1761. <strong>SUPERUSER</strong> was set to
  1762. <strong>1</strong> in the <tt>Makefile</tt>. </p>
  1763. <p> The <em>Graft</em> manual page will correctly
  1764. reflect the behaviour of this option based on the
  1765. values specified in the <tt>Makefile</tt>. This
  1766. option will be silently ignored and will not appear
  1767. in the help message nor in the manual page if
  1768. <strong>SUPERUSER</strong> was set to
  1769. <strong>0</strong> in the <tt>Makefile</tt>. </p>
  1770. <dt> <strong>-l <em>log</em></strong>
  1771. <dd>
  1772. <p> Specify an alternate log file instead of the
  1773. default specified by <strong>LOGFILE</strong> in the
  1774. <tt>Makefile</tt>. No logging is performed if
  1775. the <strong>-n</strong> option is used. </p>
  1776. <p> Log entries have the form: </p>
  1777. <pre>
  1778. 879126283 1.10+ P /usr/local/pkgs/weblint-1.017 /usr/local
  1779. </pre>
  1780. <p> This shows that a development version of
  1781. <em>graft</em> (1.10+) was used to delete objects
  1782. from <tt>/usr/local</tt> that were in conflict with
  1783. <tt>/usr/local/pkgs/weblint-1.017</tt>. </p>
  1784. <dt> <strong>-n</strong>
  1785. <dd>
  1786. <p> List actions but do not perform them. Implies
  1787. the very verbose option. Does not require
  1788. superuser privileges regardless of the value of
  1789. <strong>SUPERUSER</strong> in the <tt>Makefile</tt>. </p>
  1790. <dt> <strong>-v</strong>
  1791. <dd>
  1792. <p> Be verbose. </p>
  1793. <dt> <strong>-V</strong>
  1794. <dd>
  1795. <p> Be very verbose. </p>
  1796. <dt> <strong>-r <em>/rootdir</em></strong>
  1797. <dd>
  1798. <p> Use the fully qualified named directory as the
  1799. root directory for all graft operations. The source
  1800. directory, target directory and log file will all
  1801. be relative to this specific directory. </p>
  1802. <p> Can only be used by the superuser. </p>
  1803. <dt> <strong>-s</strong>
  1804. <dd>
  1805. <p> <em>Stow</em>/<em>Depot</em> compatibility mode.
  1806. Infer the <em>Graft</em> target directory from
  1807. each package installation directory in the
  1808. manner of <em>Stow</em> and <em>Depot</em>. </p>
  1809. <p> Target directory is the <tt>dirname</tt> of the
  1810. <tt>dirname</tt> of the package installation
  1811. directory. (Yes that really is two
  1812. <tt>dirname</tt>s). So if the package
  1813. installation directory is </p>
  1814. <pre>
  1815. /usr/local/depot/gzip-1.2.4
  1816. </pre>
  1817. <p> the package will be <em>grafted</em> into
  1818. </p>
  1819. <pre>
  1820. /usr/local
  1821. </pre>
  1822. <p> Cannot be used with the <strong>-t</strong> option. </p>
  1823. <dt> <strong>-t <em>target</em></strong>
  1824. <dd>
  1825. <p> Override the default <em>graft</em> target
  1826. directory with <strong><em>target</em></strong>. The value
  1827. of <strong><em>target</em></strong> must be a fully
  1828. qualified directory and it must exist. </p>
  1829. <p> Cannot be used with the <strong>-s</strong> option. </p>
  1830. <dt> <strong>package</strong>
  1831. <dd>
  1832. <p> Prune the named package. If <strong>package</strong> is
  1833. a fully qualified directory, use it as the
  1834. package installation directory. If
  1835. <strong>package</strong> is not a fully qualified
  1836. directory, prepend it with the value of
  1837. <strong>PACKAGEDIR</strong> as specified in the
  1838. <tt>Makefile</tt>. </p>
  1839. </dl>
  1840. <li> <p> <a name="graft-L"><strong>Information</strong></a> </p>
  1841. <pre>
  1842. graft -L
  1843. </pre>
  1844. <dl>
  1845. <dt> <strong>-L</strong>
  1846. <dd>
  1847. <p> This is a special mode and it overrides all
  1848. other command line arguments. When present
  1849. <strong>graft</strong> will display the
  1850. <strong>default</strong> locations for Perl, the
  1851. graft log file, the target directory, and the
  1852. package directory in a form suitable for creating
  1853. environment variables for Bourne like shells. The
  1854. output will appear on <strong>STDOUT</strong> as
  1855. follows: </p>
  1856. <pre>
  1857. GRAFT_PERL=/usr/bin/perl
  1858. GRAFT_LOGFILE=/var/log/graft
  1859. GRAFT_TARGETDIR=/usr/local
  1860. GRAFT_PACKAGEDIR=/usr/local/pkgs
  1861. </pre>
  1862. <p> You can set these environment variables using
  1863. one of the following methods. </p>
  1864. <pre>
  1865. eval "$(graft -L)" # modern shells such as bash, zsh etc
  1866. eval "`graft -L`" # older shells such as sh etc
  1867. </pre>
  1868. </dl>
  1869. </ol>
  1870. <hr width="25%">
  1871. <h3><a name="testing">Testing the <em>Graft</em> Installation</a></h3>
  1872. <p> Before creating the symbolic links from the target directory to
  1873. the package directory, you may wish to see what actions <em>Graft</em>
  1874. will perform. Execute the following command: </p>
  1875. <pre>
  1876. graft -i -n <em>package-name</em>
  1877. </pre>
  1878. <p> The <tt>-i</tt> option tells <em>Graft</em> to install the package and
  1879. the <tt>-n</tt> option tells <em>Graft</em> to report on its actions
  1880. without actually performing them. The default <em>Graft</em> target
  1881. directory will be used and the package installation directory will be
  1882. taken from the fully qualified package argument or the default value
  1883. will be prepended to the package argument if it is not fully qualified.
  1884. </p>
  1885. <p> <em>Graft</em> will report on the following actions: </p>
  1886. <ul>
  1887. <li> <p> Installing links to <em>package-location</em> in
  1888. <em>package-target</em> </p>
  1889. <p> Indicates the real package location and its <em>grafted</em>
  1890. target. </p>
  1891. <li> <p> Processing <em>package-directory</em> </p>
  1892. <p> Indicates which package directory is being processed. </p>
  1893. <li> <p> MKDIR <em>dirname</em> </p>
  1894. <p> This destination directory will be created. </p>
  1895. <li> <p> SYMLINK <em>dest-package-file</em> -&gt; <em>package-file</em>
  1896. </p>
  1897. <p> This symbolic link will be created. </p>
  1898. <li> <p> NOP <em>string</em> </p>
  1899. <p> No action was necessary for this package object. </p>
  1900. <li> <p> BYPASS <em>dirname</em> - .nograft file found</p>
  1901. <p> This directory contains a file called <tt>.nograft</tt> so its
  1902. contents and any subdirectories will be bypassed by
  1903. <em>Graft</em>. </p>
  1904. <li> <p> READING include file
  1905. <em>package-dir</em><tt>/.graft-include</tt> </p>
  1906. <p> The directory currently being processed by <em>Graft</em>
  1907. contains a file called <tt>.graft-include</tt> which contains
  1908. a list of file and/or directory names from the directory that
  1909. should only be <em>grafted</em>. The contents of this file are
  1910. being read by <em>Graft</em>. </p>
  1911. <li> <p> INCLUDE file <em>package-file</em> - listed in
  1912. <em>package-dir</em><tt>/.graft-include</tt> </p>
  1913. <p> The file name mentioned in this message appears in the
  1914. <em>.graft-include</em> file and the file exists in the directory
  1915. currently being processed. It will be <tt>grafted</tt>. </p>
  1916. <li> <p> IGNORE file <em>package-file</em> - not listed in
  1917. <em>package-dir</em><tt>/.graft-include</tt> </p>
  1918. <p> The file name mentioned in this message does not appear in the
  1919. <em>.graft-include</em> file and the file exists in the directory
  1920. currently being processed. It will not be <tt>grafted</tt>. </p>
  1921. <li> <p> INCLUDE directory <em>package-directory</em> - listed in
  1922. <em>package-dir</em><tt>/.graft-include</tt> </p>
  1923. <p> The directory name mentioned in this message appears
  1924. in the <em>.graft-include</em> file and the directory exists
  1925. in the directory currently being processed. It will be
  1926. <tt>grafted</tt>. </p>
  1927. <li> <p> IGNORE directory <em>package-file</em> - not listed in
  1928. <em>package-dir</em><tt>/.graft-include</tt> </p>
  1929. <p> The directory name mentioned in this message does not
  1930. appear in the <em>.graft-include</em> file and the directory
  1931. exists in the directory currently being processed. It will not
  1932. be <tt>grafted</tt>. </p>
  1933. <li> <p> READING exclude file
  1934. <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  1935. <p> The directory currently being processed by <em>Graft</em>
  1936. contains a file called <tt>.graft-exclude</tt> which contains
  1937. a list of file and/or directory names from the directory that
  1938. should not be <em>grafted</em>. The contents of this file are
  1939. being read by <em>Graft</em>. </p>
  1940. <li> <p> IGNORE include file
  1941. <em>package-dir</em><tt>/.graft-include</tt>, overridden by exclude
  1942. file <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  1943. <p> The directory currently being processed by <em>Graft</em>
  1944. contains a file called <tt>.graft-exclude</tt> as well as a file
  1945. called <tt>.graft-include</tt>. The <tt>.graft-exclude</tt>
  1946. file takes precedence over the <tt>.graft-include</tt> file,
  1947. so the latter file will be ignored. </p>
  1948. <li> <p> EXCLUDE file <em>package-file</em> - listed in
  1949. <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  1950. <p> The file name mentioned in this message appears in the
  1951. <em>.graft-exclude</em> file and the file exists in the directory
  1952. currently being processed. It will not be <tt>grafted</tt>. </p>
  1953. <li> <p> EXCLUDE directory <em>package-directory</em> - listed in
  1954. <em>package-dir</em><tt>/.graft-exclude</tt> </p>
  1955. <p> The directory name mentioned in this message appears
  1956. in the <em>.graft-exclude</em> file and the directory exists
  1957. in the directory currently being processed. It will not be
  1958. <tt>grafted</tt>. </p>
  1959. <li> <p> CONFLICT <em>message</em> </p>
  1960. <p> <em>Graft</em> could not successfully process a package object.
  1961. One of the following conditions was encountered: </p>
  1962. <ul>
  1963. <li> The package object is a directory and the
  1964. target object exists but it not a directory.
  1965. <li> The package object is not a directory and the
  1966. target object exists and is not a symbolic
  1967. link.
  1968. <li> The package object is not a directory and the
  1969. target object exists and is a symbolic link to
  1970. something other than the package object.
  1971. </ul>
  1972. <p> Conflicts are ALWAYS reported on standard error. If you wish
  1973. to see if the installation of a package will have any
  1974. conflicts, you can execute: </p>
  1975. <pre>
  1976. graft -i -n <em>package-name</em> &gt; /dev/null
  1977. </pre>
  1978. <p> Only <tt>CONFLICT</tt> messages will be displayed. If nothing
  1979. is displayed then you can safely conclude that this package
  1980. can be installed using <em>Graft</em> without any conflicts.
  1981. </p>
  1982. </ul>
  1983. <p> If you were to test the installation of the <em>kermit-5A190</em>
  1984. package you would execute the command: </p>
  1985. <pre>
  1986. graft -i -n kermit-5A190
  1987. </pre>
  1988. You should see output resembling:
  1989. <pre>
  1990. Installing links to /usr/local/pkgs/kermit-5A190 in /usr/local
  1991. Processing /usr/local/pkgs/kermit-5A190
  1992. SYMLINK /usr/local/README -&gt; /usr/local/pkgs/kermit-5A190/README
  1993. NOP /usr/local/pkgs/kermit-5A190/bin and /usr/local/bin are both directories
  1994. Processing /usr/local/pkgs/kermit-5A190/bin
  1995. SYMLINK /usr/local/bin/kermit -&gt; /usr/local/pkgs/kermit-5A190/bin/kermit
  1996. SYMLINK /usr/local/bin/wart -&gt; /usr/local/pkgs/kermit-5A190/bin/wart
  1997. NOP /usr/local/pkgs/kermit-5A190/man and /usr/local/man are both directories
  1998. Processing /usr/local/pkgs/kermit-5A190/man
  1999. NOP /usr/local/pkgs/kermit-5A190/man/man1 and /usr/local/man/man1 are both directories
  2000. Processing /usr/local/pkgs/kermit-5A190/man/man1
  2001. SYMLINK /usr/local/man/man1/kermit.1 -&gt; /usr/local/pkgs/kermit-5A190/man/man1/kermit.1
  2002. MKDIR /usr/local/doc
  2003. Processing /usr/local/pkgs/kermit-5A190/doc
  2004. SYMLINK /usr/local/doc/ckccfg.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckccfg.doc
  2005. SYMLINK /usr/local/doc/ckuins.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuins.doc
  2006. SYMLINK /usr/local/doc/ckc190.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckc190.upd
  2007. SYMLINK /usr/local/doc/ckcker.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckcker.upd
  2008. SYMLINK /usr/local/doc/ckaaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckaaaa.hlp
  2009. SYMLINK /usr/local/doc/ckuaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuaaa.hlp
  2010. NOP /usr/local/pkgs/kermit-5A190/lib and /usr/local/lib are both directories
  2011. Processing /usr/local/pkgs/kermit-5A190/lib
  2012. SYMLINK /usr/local/lib/ckedemo.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckedemo.ini
  2013. SYMLINK /usr/local/lib/ckeracu.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckeracu.ini
  2014. SYMLINK /usr/local/lib/ckermit.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermit.ini
  2015. SYMLINK /usr/local/lib/ckermod.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermod.ini
  2016. SYMLINK /usr/local/lib/cketest.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/cketest.ini
  2017. SYMLINK /usr/local/lib/ckevt.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckevt.ini
  2018. SYMLINK /usr/local/lib/ckurzsz.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckurzsz.ini
  2019. </pre>
  2020. <p> This output shows you that most of the directories already exist
  2021. (indicated by the <tt>NOP</tt> flags). A symbolic link will be created
  2022. in the relevant target directory to each of the files in the
  2023. <em>kermit-5A190</em> package. One directory exists in the
  2024. <em>kermit-5A190</em> package that does not exist in the target -
  2025. <tt>doc</tt>. This directory will be created by <em>Graft</em>. </p>
  2026. <p> <strong>NOTE</strong>: If you are using the <em>automounter</em> you may not be
  2027. able to create the directory <tt>/usr/local/doc</tt>. You'll have to create
  2028. the directory on the NFS server under the file system in which it
  2029. really lives. You should be familiar with the peculiarities of the
  2030. <em>automounter</em> and your specific site configuration before creating
  2031. any directories directly under mount points used by the
  2032. <em>automounter</em>. </p>
  2033. <hr width="25%">
  2034. <h3><a name="installing-packages">Installing Packages</a></h3>
  2035. <p> Once you have ensured that <em>Graft</em> will perform the correct
  2036. actions, you can execute: </p>
  2037. <pre>
  2038. graft -i <em>package-name</em>
  2039. </pre>
  2040. <p> So to install <em>kermit</em> you would execute: </p>
  2041. <pre>
  2042. graft -i kermit-5A190
  2043. </pre>
  2044. <p> There will be no output from <em>Graft</em> unless it encounters a
  2045. conflict. If you wish to see more information you can specify one of
  2046. the verbose flags. For a minimum of output you can execute: </p>
  2047. <pre>
  2048. graft -i -v kermit-5A190
  2049. </pre>
  2050. <p> You should see the following output: </p>
  2051. <pre>
  2052. Processing /usr/local/pkgs/kermit-5A190
  2053. Processing /usr/local/pkgs/kermit-5A190/bin
  2054. Processing /usr/local/pkgs/kermit-5A190/man
  2055. Processing /usr/local/pkgs/kermit-5A190/man/man1
  2056. Processing /usr/local/pkgs/kermit-5A190/doc
  2057. Processing /usr/local/pkgs/kermit-5A190/lib
  2058. </pre>
  2059. <p> If you choose the very verbose option by executing: </p>
  2060. <pre>
  2061. graft -i -V kermit-5A190
  2062. </pre>
  2063. <p> the output will be the same as that when the <tt>-n</tt> option was
  2064. used, however this time <em>Graft</em> will actually create the symbolic
  2065. links. </p>
  2066. <pre>
  2067. Installing links to /usr/local/pkgs/kermit-5A190 in /usr/local
  2068. Processing /usr/local/pkgs/kermit-5A190
  2069. SYMLINK /usr/local/README -&gt; /usr/local/pkgs/kermit-5A190/README
  2070. NOP /usr/local/pkgs/kermit-5A190/bin and /usr/local/bin are both directories
  2071. Processing /usr/local/pkgs/kermit-5A190/bin
  2072. SYMLINK /usr/local/bin/kermit -&gt; /usr/local/pkgs/kermit-5A190/bin/kermit
  2073. SYMLINK /usr/local/bin/wart -&gt; /usr/local/pkgs/kermit-5A190/bin/wart
  2074. NOP /usr/local/pkgs/kermit-5A190/man and /usr/local/man are both directories
  2075. Processing /usr/local/pkgs/kermit-5A190/man
  2076. NOP /usr/local/pkgs/kermit-5A190/man/man1 and /usr/local/man/man1 are both directories
  2077. Processing /usr/local/pkgs/kermit-5A190/man/man1
  2078. SYMLINK /usr/local/man/man1/kermit.1 -&gt; /usr/local/pkgs/kermit-5A190/man/man1/kermit.1
  2079. NOP /usr/local/pkgs/kermit-5A190/doc and /usr/local/doc are both directories
  2080. Processing /usr/local/pkgs/kermit-5A190/doc
  2081. SYMLINK /usr/local/doc/ckccfg.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckccfg.doc
  2082. SYMLINK /usr/local/doc/ckuins.doc -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuins.doc
  2083. SYMLINK /usr/local/doc/ckc190.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckc190.upd
  2084. SYMLINK /usr/local/doc/ckcker.upd -&gt; /usr/local/pkgs/kermit-5A190/doc/ckcker.upd
  2085. SYMLINK /usr/local/doc/ckaaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckaaaa.hlp
  2086. SYMLINK /usr/local/doc/ckuaaa.hlp -&gt; /usr/local/pkgs/kermit-5A190/doc/ckuaaa.hlp
  2087. NOP /usr/local/pkgs/kermit-5A190/lib and /usr/local/lib are both directories
  2088. Processing /usr/local/pkgs/kermit-5A190/lib
  2089. SYMLINK /usr/local/lib/ckedemo.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckedemo.ini
  2090. SYMLINK /usr/local/lib/ckeracu.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckeracu.ini
  2091. SYMLINK /usr/local/lib/ckermit.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermit.ini
  2092. SYMLINK /usr/local/lib/ckermod.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckermod.ini
  2093. SYMLINK /usr/local/lib/cketest.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/cketest.ini
  2094. SYMLINK /usr/local/lib/ckevt.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckevt.ini
  2095. SYMLINK /usr/local/lib/ckurzsz.ini -&gt; /usr/local/pkgs/kermit-5A190/lib/ckurzsz.ini
  2096. </pre>
  2097. <p> <strong>NOTE</strong>: In this case the <tt>/usr/local/doc</tt> directory was not
  2098. created by <em>Graft</em> because <tt>/usr/local</tt> is a mount point
  2099. controlled by the <em>automounter</em>. The <tt>doc</tt> directory was
  2100. created manually prior to executing <em>Graft</em>. </p>
  2101. <hr width="25%">
  2102. <h3><a name="bypass">Bypassing package directories</a></h3>
  2103. <p> You may have the need to place only part of a package under the control
  2104. of <em>Graft</em>. Examples of such occasions may be: </p>
  2105. <ul>
  2106. <li> <p> The contents of one package conflict with another package.
  2107. For example <tt>/usr/local/pkgs/gcc-2.7.2.1/lib/libiberty.a</tt> and
  2108. <tt>/usr/local/pkgs/gdb-4.16/lib/libiberty.a</tt>. </p>
  2109. <li> <p> A package directory is obviously the exclusive domain of
  2110. the package and no benefit will be gained by creating symbolic
  2111. links to its files. For example
  2112. <tt>/usr/local/pkgs/perl-5.18.2/lib/perl5</tt>. </p>
  2113. <p> <strong>NOTE</strong>: This will ONLY work if you originally compiled and
  2114. installed the package such that it refers to its files by their
  2115. '<em>real</em>' pathnames and NOT by the virtual pathnames
  2116. provided by <em>Graft</em>. </p>
  2117. </ul>
  2118. <p> You can force <em>Graft</em> to bypass a directory by creating the file </p>
  2119. <pre>
  2120. <em>package-name/dir/dir/</em>.nograft
  2121. </pre>
  2122. <p> Using the second example above, if you were to create the file: </p>
  2123. <pre>
  2124. /usr/local/pkgs/perl-5.18.2/lib/perl5/.nograft
  2125. </pre>
  2126. <p> <em>Graft</em> would create directories and symbolic links for every file
  2127. and directory down to <tt>/usr/local/pkgs/perl-5.18.2/lib</tt>. The <tt>perl5</tt>
  2128. directory and anything below it would not be created. </p>
  2129. <hr width="25%">
  2130. <h3><a name="include">Including specific files and/or directories</a></h3>
  2131. <p> There may be the occasional need to include specific files and/or
  2132. directories in a directory, rather than the entire directory tree itself. An
  2133. example of such an occurrence would be the case where a package
  2134. contains a number of subdirectories, only one of which is required to
  2135. be <em>grafted</em>. </p>
  2136. <p> You can force <em>Graft</em> to only include any number of files and/or
  2137. directories in a package directory by creating the file </p>
  2138. <pre>
  2139. .graft-include
  2140. </pre>
  2141. <p> in the same directory. </p>
  2142. <p> <tt>.graft-include</tt> will contain a list of file and/or directory names
  2143. - one per line - of the files and/or directories you wish to include. </p>
  2144. <p> Consider the <em>a2ps</em> package for example. When installed it
  2145. contains the following directories: </p>
  2146. <pre>
  2147. /usr/local/pkgs/a2ps-4.13b/bin
  2148. /usr/local/pkgs/a2ps-4.13b/etc
  2149. /usr/local/pkgs/a2ps-4.13b/include
  2150. /usr/local/pkgs/a2ps-4.13b/info
  2151. /usr/local/pkgs/a2ps-4.13b/lib
  2152. /usr/local/pkgs/a2ps-4.13b/man
  2153. /usr/local/pkgs/a2ps-4.13b/share
  2154. </pre>
  2155. <p> The only directory you wish to <em>graft</em> is the <tt>bin</tt>
  2156. directory. You could place a <tt>.nograft</tt> file in each of the other
  2157. directories, <strong>OR</strong> you could create a single <tt>.graft-include</tt>
  2158. file in <tt>/usr/local/pkgs/a2ps-4.13b/.graft-include</tt>. This file would
  2159. contain </p>
  2160. <pre>
  2161. bin
  2162. </pre>
  2163. <p> Now only the <tt>bin</tt> directory will be <em>grafted</em>. </p>
  2164. <hr width="25%">
  2165. <h3><a name="exclude">Excluding specific files and/or directories</a></h3>
  2166. <p> There may be the occasional need to exclude specific files and/or
  2167. directories from a directory, rather than the entire directory itself. An
  2168. example of such an occurrence would be the case where files from different
  2169. packages have the same name. <em>Emacs</em> and <em>Xemacs</em> use the same
  2170. names for a number of their configuration files for example. </p>
  2171. <p> You can force <em>Graft</em> to exclude any number of files and/or
  2172. directories from a package directory by creating the file </p>
  2173. <pre>
  2174. .graft-exclude
  2175. </pre>
  2176. <p> in the same directory. </p>
  2177. <p> <tt>.graft-exclude</tt> will contain a list of file and/or directory names
  2178. - one per line - of the files and/or directories you wish to exclude. </p>
  2179. <p> For example, if you did not wish the file </p>
  2180. <pre>
  2181. /usr/local/pkgs/sudo-1.5.3/etc/sudoers
  2182. </pre>
  2183. <p> to be <em>grafted</em> as </p>
  2184. <pre>
  2185. /usr/local/etc/sudoers
  2186. </pre>
  2187. <p> but you did want </p>
  2188. <pre>
  2189. /usr/local/pkgs/sudo-1.5.3/etc/visudo
  2190. </pre>
  2191. <p> to be <em>grafted</em> as </p>
  2192. <pre>
  2193. /usr/local/etc/visudo
  2194. </pre>
  2195. <p> you would create the file </p>
  2196. <pre>
  2197. /usr/local/pkgs/sudo-1.5.3/etc/.graft-exclude
  2198. </pre>
  2199. <p> and ensure its contents contained the line: </p>
  2200. <pre>
  2201. sudoers
  2202. </pre>
  2203. <p> <strong>NOTE:</strong> Any entries made in a <tt>.graft-exclude</tt> file will
  2204. override the same entries made in a <tt>.graft-include</tt> file. That is,
  2205. if a file or directory name is listen in both a <tt>.graft-exclude</tt>
  2206. and a <tt>.graft-include</tt> file, it will be <strong>excluded</strong> from the
  2207. <em>graft</em>. </p>
  2208. <hr width="25%">
  2209. <h3><a name="config_dirs">Grafting configuration files</a></h3>
  2210. <p> Beginning with <em>Graft</em> 2.11 there is now the ability to treat a
  2211. package directory as a repository for configuration files. In this case you
  2212. would place a <tt>.graft-config</tt> file in the package directory and any
  2213. files in that directory would be <strong>copied</strong> to the target
  2214. directory. Files in conflict would also be copied but would have a default
  2215. suffix of <em>.new</em> to ensure the existing file is not clobbered.
  2216. Conflict discovery is achieved using a simple 32-bit CRC check. This
  2217. feature has been added to assist operating system distributors manage
  2218. system configuration files, specifically it was added at the request of the
  2219. maintainer of the <a href="http://www.dragora.org/">Dragora GNU/Linux</a>
  2220. distribution. </p>
  2221. <p> Consider the following example. You may wish to upgrade the
  2222. <em>openssh</em> server as part of an upgrade to your distribution. In
  2223. order to preserve any local user modifications to the relevant
  2224. configuration files you would add a <tt>.graft-config</tt> file to the
  2225. package as follows: </p>
  2226. <pre>
  2227. /usr/local/pkgs/openssh-server-6.61/etc/default/.graft-config
  2228. /usr/local/pkgs/openssh-server-6.61/etc/init.d/.graft-config
  2229. /usr/local/pkgs/openssh-server-6.61/etc/init/.graft-config
  2230. /usr/local/pkgs/openssh-server-6.61/etc/network/if-up.d/.graft-config
  2231. /usr/local/pkgs/openssh-server-6.61/etc/pam.d/.graft-config
  2232. /usr/local/pkgs/openssh-server-6.61/etc/ufw/applications.d/.graft-config
  2233. /usr/local/pkgs/openssh-server-6.61/lib/systemd/system/.graft-config
  2234. </pre>
  2235. <p> The other directories in the distribution would not require any control
  2236. files. </p>
  2237. <p> Imagine that the local administrator has made some changes to
  2238. <tt>/etc/pam.d/sshd</tt> such as adding additional authentication methods
  2239. to support two-factor authentication for example. As the distribution
  2240. maintainer you do not want to reverse this local change so when the local
  2241. administrator upgrades the distribution, <em>Graft</em>
  2242. <strong>copies</strong> the new <tt>/etc/pam.d/sshd</tt> file to
  2243. <tt>/etc/pam.d/sshd.new</tt> which allows the local administrator to merge
  2244. their changes with any new features supported by the upgrade. </p>
  2245. <p> To take full advantage of this feature you may need to explicitly set the
  2246. target directory as follows: </p>
  2247. <pre>
  2248. graft -i -t / openssh-server-6.61
  2249. </pre>
  2250. <hr width="25%">
  2251. <h3><a name="partial-graft">Grafting part of a package</a></h3>
  2252. <p> Some packages can be successfully used when only part of their
  2253. installation directory is <em>grafted</em>. Other packages are
  2254. recalcitrant and need some special hand holding which can only be
  2255. solved by <em>grafting</em> each section of the package separately. </p>
  2256. <p> The first scenario can be handled by either <tt>.nograft</tt> files or
  2257. partial <em>grafts</em>. Consider <em>Perl</em> version <em>5.18.2</em>.
  2258. When installed in its own directory </p>
  2259. <pre>
  2260. /usr/local/pkgs/perl-5.18.2
  2261. </pre>
  2262. <p> there are three subdirectories </p>
  2263. <pre>
  2264. drwxr-sr-x 2 psamuel bisg 512 Oct 30 1996 bin
  2265. drwxr-sr-x 3 psamuel bisg 512 Oct 30 1996 lib
  2266. drwxr-sr-x 4 psamuel bisg 512 Oct 30 1996 man
  2267. </pre>
  2268. <p> Everything in the <tt>lib</tt> directory is exclusive to <em>Perl</em>
  2269. and does not require <em>grafting</em>. Therefore, <em>perl-5.18.2</em> can
  2270. be <em>grafted</em> using either of the following two methods: </p>
  2271. <pre>
  2272. touch /usr/local/pkgs/perl-5.18.2/lib/.nograft
  2273. graft -i perl-5.18.2
  2274. </pre>
  2275. or
  2276. <pre>
  2277. graft -it /usr/local/bin perl-5.18.2/bin
  2278. graft -it /usr/local/man perl-5.18.2/man
  2279. </pre>
  2280. <p> Now let's consider a recalcitrant package - <em>ObjectStore</em> version
  2281. 4.0.2.a.0. When installed in </p>
  2282. <pre>
  2283. /usr/local/pkgs/ostore-4.0.2.a.0
  2284. </pre>
  2285. <p> the following files and directories are available: </p>
  2286. <pre>
  2287. -rwxrwxr-x 1 pauln one3 1089 Oct 31 1996 Copyright
  2288. drwxrwxrwx 8 pauln one3 512 Oct 2 1996 common
  2289. drwxrwxrwx 6 pauln one3 512 Oct 31 1996 sunpro
  2290. -rw-r----- 1 root one3 1900544 Apr 29 1997 txn.log
  2291. </pre>
  2292. <p> The executable programs that need to be <em>grafted</em> are in
  2293. <tt>sunpro/bin</tt> and the manual pages that need to be <em>grafted</em>
  2294. are in <tt>common/man</tt>. Everything else in the package does not
  2295. need to be <em>grafted</em>. If the entire package was to be
  2296. <em>grafted</em> the result would be two directories that are not in the
  2297. regular <strong>$PATH</strong> and <strong>$MANPATH</strong> environment variables - namely
  2298. <tt>/usr/local/common/man</tt> and <tt>/usr/local/sunpro/bin</tt>, plus a host of
  2299. other directories that are not relevant for <em>grafting</em>. No amount
  2300. of <tt>.nograft</tt> and <tt>.graft-exclude</tt> juggling will solve
  2301. this problem. </p>
  2302. <p> The solution is to use two partial <em>grafts</em>: </p>
  2303. <pre>
  2304. graft -it /usr/local/bin ostore-4.0.2.a.0/sunpro/bin
  2305. graft -it /usr/local/man ostore-4.0.2.a.0/common/bin
  2306. </pre>
  2307. <p> Using this approach, the correct executables and manual pages are
  2308. available without the need to <em>graft</em> unnecessary files and
  2309. directories. </p>
  2310. <hr width="25%">
  2311. <h3><a name="deleting-packages">Deleting and/or Upgrading
  2312. Packages</a></h3>
  2313. <p> If you wish to upgrade a package - let's assume you wish to upgrade
  2314. <em>kermit</em> from version 5A190 to version 6.0.192 - you'd follow
  2315. these steps. </p>
  2316. <p> Firstly, you'd compile and install <em>kermit-6.0.192</em> in </p>
  2317. <pre>
  2318. /usr/local/pkgs/kermit-6.0.192
  2319. </pre>
  2320. <p> Once you'd tested it to your satisfaction, you'd need to delete the
  2321. symbolic links to the current <em>grafted</em> version. You can check
  2322. which actions <em>Graft</em> will perform by executing: </p>
  2323. <pre>
  2324. graft -d -n kermit-5A190
  2325. </pre>
  2326. <p> You'll see output similar to </p>
  2327. <pre>
  2328. Uninstalling links from /usr/local to /usr/local/pkgs/kermit-5A190
  2329. Processing /usr/local/pkgs/kermit-5A190
  2330. Processing /usr/local/pkgs/kermit-5A190/bin
  2331. UNLINK /usr/local/bin/kermit
  2332. UNLINK /usr/local/bin/wart
  2333. Processing /usr/local/pkgs/kermit-5A190/man
  2334. Processing /usr/local/pkgs/kermit-5A190/man/man1
  2335. UNLINK /usr/local/man/man1/kermit.1
  2336. Processing /usr/local/pkgs/kermit-5A190/doc
  2337. UNLINK /usr/local/doc/ckccfg.doc
  2338. UNLINK /usr/local/doc/ckuins.doc
  2339. UNLINK /usr/local/doc/ckc190.upd
  2340. UNLINK /usr/local/doc/ckcker.upd
  2341. UNLINK /usr/local/doc/ckaaaa.hlp
  2342. UNLINK /usr/local/doc/ckuaaa.hlp
  2343. Processing /usr/local/pkgs/kermit-5A190/lib
  2344. UNLINK /usr/local/lib/ckedemo.ini
  2345. UNLINK /usr/local/lib/ckeracu.ini
  2346. UNLINK /usr/local/lib/ckermit.ini
  2347. UNLINK /usr/local/lib/ckermod.ini
  2348. UNLINK /usr/local/lib/cketest.ini
  2349. UNLINK /usr/local/lib/ckevt.ini
  2350. UNLINK /usr/local/lib/ckurzsz.ini
  2351. UNLINK /usr/local/lib/.testing
  2352. </pre>
  2353. <p> If you're happy with the output from the test deletion you can delete
  2354. the <em>grafted</em> package. Once again, you'll only see output if a
  2355. failure occurs unless you use one of the verbose options. </p>
  2356. <p> If you execute: </p>
  2357. <pre>
  2358. graft -dV kermit-5A190
  2359. </pre>
  2360. <p> you'll see: </p>
  2361. <pre>
  2362. Uninstalling links from /usr/local to /usr/local/pkgs/kermit-5A190
  2363. Processing /usr/local/pkgs/kermit-5A190
  2364. Processing /usr/local/pkgs/kermit-5A190/bin
  2365. UNLINK /usr/local/bin/kermit
  2366. UNLINK /usr/local/bin/wart
  2367. Processing /usr/local/pkgs/kermit-5A190/man
  2368. Processing /usr/local/pkgs/kermit-5A190/man/man1
  2369. UNLINK /usr/local/man/man1/kermit.1
  2370. Processing /usr/local/pkgs/kermit-5A190/doc
  2371. UNLINK /usr/local/doc/ckccfg.doc
  2372. UNLINK /usr/local/doc/ckuins.doc
  2373. UNLINK /usr/local/doc/ckc190.upd
  2374. UNLINK /usr/local/doc/ckcker.upd
  2375. UNLINK /usr/local/doc/ckaaaa.hlp
  2376. UNLINK /usr/local/doc/ckuaaa.hlp
  2377. EMPTY /usr/local/doc is now empty. Delete manually if necessary.
  2378. Processing /usr/local/pkgs/kermit-5A190/lib
  2379. UNLINK /usr/local/lib/ckedemo.ini
  2380. UNLINK /usr/local/lib/ckeracu.ini
  2381. UNLINK /usr/local/lib/ckermit.ini
  2382. UNLINK /usr/local/lib/ckermod.ini
  2383. UNLINK /usr/local/lib/cketest.ini
  2384. UNLINK /usr/local/lib/ckevt.ini
  2385. UNLINK /usr/local/lib/ckurzsz.ini
  2386. </pre>
  2387. <p> <strong>NOTE</strong>: In this case the existence of an empty directory has been
  2388. discovered. If <em>Graft</em> empties a directory during a package
  2389. deletion, it will either notify you or delete the directory depending
  2390. on the combination of variables in the <tt>Makefile</tt> and command
  2391. line options. It's probably better practise not to automatically
  2392. delete empty directories as they may be used by other packages - such
  2393. as lock file directories for example. </p>
  2394. <p> Now you can remove the <em>real</em> package contents. (You may not wish
  2395. to do this immediately as some legacy systems may depend on features
  2396. provided by the older version or you may feel the need for further
  2397. testing before feeling confident that the old version can be removed):
  2398. </p>
  2399. <pre>
  2400. rm -rf /usr/local/pkgs/kermit-5A190
  2401. </pre>
  2402. <p> Now you can <em>graft</em> the new version of <em>kermit</em>. Execute: </p>
  2403. <pre>
  2404. graft -i -n kermit-6.0.192
  2405. </pre>
  2406. <p> to ensure that the <em>grafting</em> will proceed without error. Once
  2407. you are satisfied that this is the case you can <em>graft</em> the new
  2408. package by executing: </p>
  2409. <pre>
  2410. graft -i kermit-6.0.192
  2411. </pre>
  2412. <hr width="25%">
  2413. <h3><a name="transitioning">Transitioning a package to <em>Graft</em>
  2414. control</a></h3>
  2415. <p> <em>Graft</em> can be used to easily transition a package from its
  2416. current installation in your target directory to a <em>grafted</em>
  2417. installation. </p>
  2418. <p> As an example, let's consider the package <em>weblint</em> version 1.017.
  2419. It consists of three files installed in: </p>
  2420. <pre>
  2421. /usr/local/bin/weblint
  2422. /usr/local/lib/global.weblintrc
  2423. /usr/local/man/man1/weblint.1
  2424. </pre>
  2425. <p> The first step is to create a new copy of the package in its own
  2426. directory: </p>
  2427. <pre>
  2428. /usr/local/pkgs/weblint-1.017
  2429. </pre>
  2430. <p> Ensure that any references to library files are now made to
  2431. <tt>/usr/local/pkgs/weblint-1.017/lib</tt> instead of <tt>/usr/local/lib</tt>.
  2432. </p>
  2433. <p> Test the new installation to ensure it behaves as expected. </p>
  2434. <p> Then prune the old files from <tt>/usr/local/*</tt> using: </p>
  2435. <pre>
  2436. graft -pV weblint-1.017
  2437. </pre>
  2438. <p> You'd expect to see output similar to: </p>
  2439. <pre>
  2440. Pruning files in /usr/local which conflict with /usr/local/pkgs/weblint-1.017
  2441. Processing /usr/local/pkgs/weblint-1.017
  2442. Processing /usr/local/pkgs/weblint-1.017/man
  2443. Processing /usr/local/pkgs/weblint-1.017/man/man1
  2444. RENAME /usr/local/man/man1/weblint.1
  2445. Processing /usr/local/pkgs/weblint-1.017/bin
  2446. RENAME /usr/local/bin/weblint
  2447. Processing /usr/local/pkgs/weblint-1.017/lib
  2448. RENAME /usr/local/lib/global.weblintrc
  2449. </pre>
  2450. <p> If you elected to delete conflicting files instead of renaming them
  2451. you'd use: </p>
  2452. <pre>
  2453. graft -pDV weblint-1.017
  2454. </pre>
  2455. <p> and you'd see output similar to: </p>
  2456. <pre>
  2457. Pruning files in /usr/local which conflict with /usr/local/pkgs/weblint-1.017
  2458. Processing /usr/local/pkgs/weblint-1.017
  2459. Processing /usr/local/pkgs/weblint-1.017/man
  2460. Processing /usr/local/pkgs/weblint-1.017/man/man1
  2461. UNLINK /usr/local/man/man1/weblint.1
  2462. Processing /usr/local/pkgs/weblint-1.017/bin
  2463. UNLINK /usr/local/bin/weblint
  2464. Processing /usr/local/pkgs/weblint-1.017/lib
  2465. UNLINK /usr/local/lib/global.weblintrc
  2466. </pre>
  2467. <p> Now the new version of <em>weblint</em> 1.017 can be <em>grafted</em> in
  2468. place: </p>
  2469. <pre>
  2470. graft -i weblint-1.017
  2471. </pre>
  2472. <p> The <em>grafted</em> version of <em>weblint</em> can now be tested. </p>
  2473. <p> If we renamed conflicting files, they can be removed once the
  2474. <em>grafted</em> <em>weblint</em> has been satisfactorily tested: </p>
  2475. <pre>
  2476. rm /usr/local/man/man1/weblint.1.pruned
  2477. rm /usr/local/bin/weblint.pruned
  2478. rm /usr/local/lib/global.weblintrc.pruned
  2479. </pre>
  2480. <hr width="25%">
  2481. <h3><a name="conflicts">Conflict Processing</a></h3>
  2482. <p> Occasionally <em>Graft</em> will fail to completely install a package. This
  2483. occurs because <em>Graft</em> encounters a conflict. A conflict is defined as
  2484. one of the following possibilities: </p>
  2485. <center>
  2486. <table summary="Conflcits" border=2 cellpadding=3>
  2487. <tr>
  2488. <th>
  2489. Package Object
  2490. </th>
  2491. <th>
  2492. Target Object
  2493. </th>
  2494. </tr>
  2495. <tr>
  2496. <td>
  2497. directory
  2498. </td>
  2499. <td>
  2500. not a directory
  2501. </td>
  2502. </tr>
  2503. <tr>
  2504. <td>
  2505. file
  2506. </td>
  2507. <td>
  2508. directory
  2509. </td>
  2510. </tr>
  2511. <tr>
  2512. <td>
  2513. file
  2514. </td>
  2515. <td>
  2516. file
  2517. </td>
  2518. </tr>
  2519. <tr>
  2520. <td>
  2521. file
  2522. </td>
  2523. <td>
  2524. symbolic link to something other than the package object
  2525. </td>
  2526. </tr>
  2527. </table>
  2528. </center>
  2529. <p> If <em>Graft</em> encounters such a conflict during the installation of a
  2530. package it will report the conflict and exit. </p>
  2531. <p> Resolving the conflict depends on the nature of the conflict and is
  2532. beyond the scope of this discussion - however most conflicts will
  2533. either be the result of attempting to <em>graft</em> a package on top of
  2534. the same package actually installed in the target directory or a file
  2535. name clash between two (or more) different packages. </p>
  2536. <p> Conflicts arising from the pre-existence of a package in the target
  2537. directory can be resolved using <em>graft</em>'s prune mechanism
  2538. described above in <a href="#transitioning">&quot;Transitioning a
  2539. package to <em>Graft</em> control&quot;</a>. </p>
  2540. <p> File name clash conflicts can be resolved by the use of either a
  2541. <a href="#bypass"><tt>.nograft</tt></a> or
  2542. <a href="#exclude"><tt>.graft-exclude</tt></a> file or by
  2543. <em>grafting</em> only part of a package as described above in
  2544. <a href="#partial-graft">&quot;Grafting part of a package&quot;</a>.
  2545. </p>
  2546. <p> If <em>Graft</em> encounters a conflict while deleting a package, it will
  2547. report the conflict and continue deleting the remainder of the package.
  2548. In this way <em>Graft</em> will delete as much of the package as
  2549. possible. Conflicts that arise during deletion will probably be the
  2550. result of an incorrectly installed package or the installation of other
  2551. components of the same package without the use of <em>Graft</em>. </p>
  2552. <p> Conflict messages are written to standard error. All other messages
  2553. are written to standard output. To quickly determine if a package will
  2554. have any conflicts when <em>grafted</em>, redirect standard output to
  2555. <tt>/dev/null</tt> </p>
  2556. <pre>
  2557. graft -i -n <em>package</em> &gt; /dev/null
  2558. </pre>
  2559. <p> If you don't see any output then you can safely assume that there will
  2560. be no conflicts when <em>grafting</em> this package. </p>
  2561. <p> See the comprehensive table above describing how
  2562. <a href="#precedence">conflicts are handled</a> for more details. </p>
  2563. <hr width="25%">
  2564. <h3><a name="exitstatus">Exit Status</a></h3>
  2565. <p> <em>Graft</em> will terminate with an exit status of either 0, 1, 2, 3 or 4
  2566. under the following conditions: </p>
  2567. <center>
  2568. <table summary="Exit Status" border=2 cellpadding=3>
  2569. <tr>
  2570. <th>
  2571. Exit Status
  2572. </th>
  2573. <th>
  2574. Condition
  2575. </th>
  2576. </tr>
  2577. <tr>
  2578. <td>
  2579. <center>
  2580. <strong>0</strong>
  2581. </center>
  2582. </td>
  2583. <td>
  2584. All operations succeeded.
  2585. </td>
  2586. </tr>
  2587. <tr>
  2588. <td>
  2589. <center>
  2590. <strong>1</strong>
  2591. </center>
  2592. </td>
  2593. <td>
  2594. A conflict occurred during installation.
  2595. </td>
  2596. </tr>
  2597. <tr>
  2598. <td>
  2599. <center>
  2600. <strong>2</strong>
  2601. </center>
  2602. </td>
  2603. <td>
  2604. Command line syntax was incorrect.
  2605. </td>
  2606. </tr>
  2607. <tr>
  2608. <td>
  2609. <center>
  2610. <strong>3</strong>
  2611. </center>
  2612. </td>
  2613. <td>
  2614. One or more packages listed on the command line does not
  2615. exist. Other valid packages listed on the command line were
  2616. processed correctly.
  2617. </td>
  2618. </tr>
  2619. <tr>
  2620. <td>
  2621. <center>
  2622. <strong>4</strong>
  2623. </center>
  2624. </td>
  2625. <td>
  2626. The log file <tt>/var/log/graft</tt> could not be updated. Usually a
  2627. result of a permission error. Any other error condition will
  2628. override this condition.
  2629. </td>
  2630. </tr>
  2631. </table>
  2632. </center>
  2633. <hr>
  2634. <h2><a name="other-pkg-tools">Using <em>Graft</em> with other package
  2635. management tools</a></h2>
  2636. <p> Most Unix vendors have released their own package management tools with
  2637. their operating systems. Examples of this are Solaris 2.<em>x</em> with its
  2638. <em>SVR4 Package Manager</em> <tt>pkgadd</tt>, RedHat Linux with its
  2639. <em>RedHat Package Manager</em> <tt>rpm</tt>, Ubuntu Linux (and other Debian
  2640. Linux derivatives) with its <tt>dpkg</tt> system and HP-UX 10.<em>x</em> with
  2641. its <tt>swinstall</tt> suite. <em>Graft</em> has been designed as an adjunct
  2642. to these package managers rather than a competitor. The author has used
  2643. <em>Graft</em> successfully with all of the operating systems mentioned here.
  2644. </p>
  2645. <ul>
  2646. <li> <p> Many useful packages available in the public domain and from
  2647. other commercial sources are not shipped with most flavours of
  2648. Unix. <em>Graft</em> can be used to maintain a rich package
  2649. environment beyond the set of packages provided by your vendor.
  2650. Vendor based packages can still be maintained using the vendor's
  2651. tools and <em>Graft</em> can be used to maintain your own packages.
  2652. </p>
  2653. <li> <p> The vendor based management tools are usually used to maintain
  2654. single instances of a package on each machine. It is often
  2655. difficult to have multiple versions of the same package coexisting
  2656. on the same machine. <em>Graft</em> can be used to maintain multiple
  2657. versions of a package to support legacy, production and development
  2658. requirements simultaneously. </p>
  2659. <li> <p> Another common problem with vendor supplied software is
  2660. the speed at which upgrades are available. The large vendors are not
  2661. known for providing quick fixes to many of their packages. (Notable
  2662. exceptions to this are the vendors of operating systems based on
  2663. open source software who can draw on the enormous number of users
  2664. who submit patches because the source code is available). Using
  2665. <em>Graft</em> you can obtain a working public domain version of
  2666. a package (if one exists of course) and install it in a different
  2667. location to the vendor copy. When the vendor releases a new version of
  2668. the package, it can be installed using the vendor's package management
  2669. tool and your <em>grafted</em> copy can be removed (only if the vendor's
  2670. version of the package is better than the public domain version). </p>
  2671. <li> <p> Sometimes, a vendor's package doesn't quite perform in the
  2672. manner you'd like. It may be making assumptions about your file
  2673. system(s) that are incorrect for your environment or it may not
  2674. have all the features you'd like. If an alternative package is
  2675. available - either in the public domain or from other commercial
  2676. sources - it can be installed and <em>grafted</em> accordingly. </p>
  2677. </ul>
  2678. <hr>
  2679. <h2><a name="availability">Availability</a></h2>
  2680. <p> The latest version of <em>Graft</em> should always be available from: </p>
  2681. <pre>
  2682. <a href="http://peters.gormand.com.au/Home/tools/graft">http://peters.gormand.com.au/Home/tools/graft</a>
  2683. </pre>
  2684. <hr>
  2685. <h2><a name="license">License</a></h2>
  2686. <p> <em>Graft</em> is licensed under the terms of the GNU General Public
  2687. License, Version 2, June 1991. </p>
  2688. <p> You should have received a copy of the GNU General Public License
  2689. along with this program; if not, write to the Free Software Foundation,
  2690. Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, or download
  2691. it from the Free Software Foundation's web site: </p>
  2692. <pre>
  2693. <a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>
  2694. <a href="http://www.gnu.org/copyleft/gpl.txt">http://www.gnu.org/copyleft/gpl.txt</a>
  2695. </pre>
  2696. <hr>
  2697. </body>
  2698. </html>