<i>[package require] is too slow</i> status still Open with 4 other changes
by
.
D 2012-04-25T19:40:15
J icomment If\swe\sassume\sthat\sthe\scontents\sof\sa\spackage\sdon't\schange,\sjust\sthat\snew\spackages\sare\sinstalled\s(each\sin\stheir\sown\sdirectory\stree)\sthen\swe\s*can*\sget\sa\sdecision\son\swhether\sto\srebuild\sthe\scache.\n\nLet\sthe\scache\sbe\sa\sdictionary,\sindexed\sby\snormalized\sfilename\swith\sone\sentry\sper\sdir\sseen\sin\s$auto_path\s(or\swhatever\spath\sis\sused),\sstored\sin\sthe\suser's\shome\sdirectory\s(or\sbelow;\sif\sthe\suser's\shome\sdirectory\sdoesn't\sexist\sor\sisn't\swritable,\swe\sjust\sdon't\scache;\ssimilarly,\sin\sa\ssafe\sinterp\swe\sdon't\suse\sthe\scache\seither,\sor\sat\sleast\snot\sunless\ssomeone\sfigures\sout\show\sto\smake\sa\ssafe\sversion\sof\sit).\sThen\sall\swe\sneed\sto\sdo\sis\sto\sstore\sthe\s[file\smtime]\sof\sthe\sdir\sand\scompare;\sif\sit\schanges,\sthat\smeans\ssomething's\sbeen\sadded\sor\sremoved\sand\swe\sshould\srebuild.\n\nThe\scache\scontents\sshould\sbe\stuples\sof\sexact-normalized-filename-of-pkgIndex.tcl\sand\scontents-of-that-pkgIndex.tcl;\sthat\swould\sbe\senough\sto\sallow\sus\sto\ssynthesize\ssourcing\sthe\sfile\swithout\shaving\sto\ssearch\sfor\sit\sand\sactually\ssource\sit.\sThat\s*should*\sbe\senough\sto\sboost\sloading.\n\nUsers\swho\sinsist\son\shaving\s/usr/lib\sin\stheir\sauto_path\sget\swhat's\sdue\sto\sthem\sfor\shaving\ssuch\sill-considered\sinstallations.\n\nProbably\sought\sto\salso\shave\sa\scommand\sto\sallow\sflushing\sof\sthe\swhole\scache\sor\sjust\sa\spart\sof\sit.\sJust\sin\scase\ssomeone\sneeds\ssomething\sother\sthan\swhat\scan\sbe\sdone\sconveniently.\n\nOpen\squestion:\sdoes\s[file\smtime\s$pathEntry]\swork\ssuitably\sfor\sthis\son\sWindows?\s(NB:\sremember\sthat\snot\sall\sentries\son\sthe\sauto_path\sexist.)\n\nInspiration\scode:\n\s\sforeach\sd\s$auto_path\s{if\s{[file\sexists\s$d]}\s{\n\s\s\s\s\s\sputs\s[file\snormalize\s$d]:[clock\sformat\s[file\smtime\s$d]]\n\s\s}}\n\n
J login dkf
J mimetype text/plain
J username dkf
K 3519865fffffffffffffffffffffffffffffffff
U dkf
Z f5b5b8d650cc3f5b2b363e98f28d80bb