#!/usr/bin/env perl # $Id$ # Public domain. Originally written 2005, Karl Berry. # Check if a package in TL has any changes on CTAN. BEGIN { chomp ($mydir = `dirname $0`); # we are in Master/tlpkg/bin unshift (@INC, "$mydir/.."); } use TeXLive::TLConfig qw/$RelocPrefix $RelocTree/; use TeXLive::TLPOBJ; use TeXLive::TLPDB; use File::Basename; my $tlpdb; my $Master; our %OPT; # toptesi - reinstate after next upload, generated files out of sync # these packages should be up to date: my @TLP_working = qw( 12many 2up AkkTeX Asana-Math HA-prosper IEEEconf IEEEtran Type1fonts a0poster a2ping a4wide a5comb aastex abbr abc abstract abstyles accfonts achemso acmconf acmtrans acromake acronym active-conf addlines adobemapping adrconv adrlist advdate ae aeguill afthesis aguplus aiaa aichej akletter alg algorithm2e algorithmicx algorithms alnumsec alterqcm altfont ametsoc amsaddr amsfonts amslatex-primer amsldoc-it amsmath amsrefs amsthdoc-it animate anonchap antt answers ANUfinalexam anyfontsize anysize apa apacite apalike apalike2 appendix apl apprends-latex arabi arabtex arabxetex archaic arcs arev armenian around-the-bend arphic arrayjobx arsclassica arydshln asaetr ascii asciichart assignment astro asyfig asymptote-faq-zh-cn asymptote-by-example-zh-cn asymptote-manual-zh-cn attachfile auncial-new aurical authoraftertitle authorindex auto-pst-pdf autoarea automata autotab babel babelbib background bangtex barcodes barr bbcard bbding bbm bbm-macros bbold bclogo beamer beamer-FUBerlin beamer-tut-pt beamerposter beebe begriff bera betababel beton bez123 bezos bgreek bib-fr bibarts bibhtml biblatex biblatex-apa biblatex-chem biblatex-chicago-notes-df biblatex-dw biblatex-historian biblatex-nature biblatex-philosophy biblatex-science bibleref biblist bibtopic bibtopicprefix bibexport bibunits bidi bigfoot bigints binomexp biocon bizcard blacklettert1 blindtext blkarray block blockdraw_mp blowup boisik bold-extra boites boldtensors bookest booklet booktabs boolexpr bophook borceux bosisio boxedminipage boxhandler bpchem bpolynomial bracketkey braille braket breakcites breakurl bullcntr bundledoc bussproofs bytefield c-pascal cachepic calctab calligra calrsfs cancel capt-of captcont captdef caption carlisle carolmin-ps cases casyl catechis cbcoptic cbfonts cc-pl ccaption ccfonts ccicons cclicenses cd cd-cover cdpbundl cell cellspace censor changebar changelayout changepage changes chappg chapterfolder chbibref chem-journal chemarrow chembst chemcompounds chemcono chemstyle cherokee chess-problem-diagrams chessboard chessfss chicago chicago-annote chletter chngcntr circ circle circuitikz cite citeref cjhebrew cjk cjkpunct cjw classicthesis clefval cleveref clock clrscode cm-super cmap cmcyr cmdstring cmdtrack cmll cmpica codedoc codepage collref colordoc colorinfo colorsep colortab colortbl colorwav combelow combine combinedgraphics comma commath comment compactbib complexity comprehensive computational-complexity concmath concmath-fonts confproc constants context-account context-algorithmic context-bnf context-chromato context-construction-plan context-degrade context-fixme context-french context-fullpage context-games context-gnuplot context-letter context-lettrine context-lilypond context-mathsets context-notes-zh-cn context-ruby context-simplefonts context-simpleslides context-top-ten context-typearea context-typescripts context-vim cooking cookybooky cool coollist coolstr cooltooltips coordsys courier-scaled courseoutline coursepaper coverpage covington crop crossreference crossword crosswrd cryst csbulletin csquotes csvtools ctable ctex ctex-faq cursolatex cursor cuisine currfile currvita curve curve2e curves custom-bib cv cweb-latex cyklop cyrillic dancers dashbox dashrule dashundergaps datatool dateiliste datetime dblfloatfix dcpic de-macro decimal dehyph-exptl delimtxt diagmac2 dichokey digiconfigs din1505 dinat dingbat directory dirtree disser dk-bib dlfltxb dnaseq doc-pictex docmfp docmute doi doipubmed dot2texi dotarrow dotseqn dottex doublestroke dox dozenal dpfloat dprogress drac draftcopy draftwatermark dramatist dratex drv dtxgallery dtxtut duerer-latex duotenzor dvdcoll dviasm dviincl dvipdfmx-def dvipsconfig dyntree ean13isbn easy easylist ebong ebsthesis eCards ecc ecclesiastic economic ecv ed edmac edmargin ednotes eemeir eepic egameps egplot eiad eiad-ltx eijkhout elbioimp ellipsis elpres elsarticle elsevier elsevier-bib eltex elvish emptypage emulateapj emp encxvlna endfloat endheads endnotes engpron engrec engtlc enumitem envbig environ envlab epigrafica epigraph epiolmec eplain epsdice epsf epsincl epslatex-fr epspdf epspdfconversion epstopdf eqexam eqlist eqparbox errata es-tex-faq ESIEEcv erdc esdiff esint esint-type1 esk eskd eskdx eso-pic esvect estcpmm etaremune etex-pkg etextools ethiop ethiop-t1 etoolbox euenc eukdate euler eulervm euproposal euro europecv eurosans eurosym everypage exam examdesign examplep excludeonly exercise exp-testopt expdlist expl3 export expressg extarrows exteps extpfeil extract extsizes faktor fancybox fancyhdr fancynum fancypar fancyref fancytooltips fancyvrb FAQ-en fbs fc_arith featpost fenixpar feyn feynmf fge fig4latex figbas figflow filecontents filehook findhyph fink first-latex-doc fix2col fixfoot fixme fixpdfmag flabels flacards flagderiv flashmovie flippdf float floatrow flowfram fltpage fltpoint fmtcount fn2end fnbreak fncychap fncylab fnpara foekfont font-change fontch fontinst fontools fontspec fonttable fontwrap footbib footmisc footnpag forarray forloop formular fouridx fourier fouriernc fp fpl fragmaster fragments frame framed frankenstein frcursive free-math-font-survey frenchle fribrief frletter frontespizio ftcap ftnxtra fullblck fullpict functan fundus fwlw gaceta galois garrigues gastex gatech-thesis gauss gb4e gcard gchords gcite gene-logic genmisc genmpage gentium gentle geometry german germbib germkorr getfiledate gfsartemisia gfsbaskerville gfsbodoni gfscomplutum gfsdidot gfsneohellenic gfsporson gfssolomos ginpenc gloss glossaries gmdoc gmdoc-enhance gmeometric gmiflink gmutils gmverb gmverse gnuplottex gost graphics graphics-pln graphicx-psmin greek-inputenc greekdates greenpoint grfpaste grid gridset grverb gu guitar guitlogo hands hanging har2nat harmony harvard harvardkyoto harvmac hatching hc hep hepnames hepparticles hepthesis hepunits here hexgame hhtensor histogr historische-zeitschrift hitec hrlatex hvfloat hvindex hypdvips hyper hypernat hyperref hyperxmp hyph-utf8 hyphen-base hyphenat hyphenex hyplain ibygrk icsv idxlayout ieeepes ifmslide ifmtarg ifplatform iftex ifxetex ijmart ijqc imac image-gallery impatient impatient-fr import imtekda inconsolata inlinebib inlinedef insbox interactiveworkbook intro-scientific inversepath ionumbers iopart-num iso iso10303 isodate isodoc isomath isonums isorot isotope itnumpar iwona jablantile jeopardy jknapltx jneurosci jpsj junicode jura juraabbrev jurabib juramisc jurarsp js-misc kalender kastrup kerkis kerntest keycommand keystroke kix kixfont knitting knittingpattern knuth koma-script kpfonts l2picfaq l2tabu l2tabu-english l2tabu-french l2tabu-it l2tabu-spanish labbook labelcas labels lastpage latex latex-course latex-doc-ptr latex-notes-zh-cn latex-referenz latex-tabellen latex-tds latex-veryshortguide latex2e-help-texinfo latex2man latexcheat latexcheat-esmx latexcheat-ptbr latexdiff latexmk latexmp layouts lazylist lcd lcg lcyw leading leaflet ledmac leftidx lettrine lewis lexikon lfb lgreek lh libertine librarian libris limap linearA linegoal lineno linguex lipsum listbib listing listings listings-ext listliketab listofsymbols lithuanian liturg lkproof lm logic logical-markup-utils logpap lps lsc lshort-bulgarian lshort-chinese lshort-dutch lshort-english lshort-finnish lshort-french lshort-german lshort-italian lshort-japanese lshort-korean lshort-mongol lshort-persian lshort-polish lshort-portuguese lshort-slovak lshort-slovenian lshort-spanish lshort-thai lshort-turkish lshort-ukr lshort-vietnamese ltabptch ltxdockit ltxindex ltxmisc ltxnew lua-alt-getopt luainputenc lualibs luamplib luaotfload luatexbase luatextra lxfonts macqassign mafr magaz magyar mailing mailmerge makebarcode makebox makecell makecirc makecmds makedtx makeglos makeplot manuscript maple margbib marginnote marvosym mathabx mathcomp mathdots mathexam mathmode mathspec mattens maybemath mcaption mceinleger mcite mciteplus mdframed mdwtools memdesign memexsupp memoir MemoirChapStyles mentis menu metafont-beginners metago metalogo metaobj metaplot metatex metauml method metre mff mfnfss mfpic mfpic4ode mftinc mh mhchem mhequ mhs microtype midnight midpage minibox minipage-marginpar miniplot minitoc minted minutes mkgrkindex mkjobtexmf mkpattern mla-paper mlist mmap mnsymbol moderncv modref modroman mongolian-babel montex morefloats moresize moreverb movie15 mp3d mparhack mpman-ru ms msc msg mslapa mtgreek multenum multibbl multibib multicap multirow multibox multido multiobjective munich muthesis mwcls mxd mxedruli mylatexformat nag namespc natbib nath nature ncclatex ncctools needspace newcommand newfile newlfm newspaper newverbs nextpage nfssext-cfr niceframe nicetext nih nkarta noitcrul nolbreaks nomencl nomentbl nonfloat nopageno nostarch notes notes2bib notoccite nrc ntgclass ntheorem-vn numname numprint oberdiek ocgtools ocr-latex octavo ofs ogham oldlatin oldstyle onlyamsmath onrannual opcit optional ordinalpt orkhun ot-tableau othello oubraces outline overpic pagecont pagenote pagerange paper papercdcase papertex parallel paresse parrun passivetex patch patchcmd patgen2-tutorial pauldoc pax pbox pb-diagram pdf14 pdf-forms-tutorial-de pdf-forms-tutorial-en pdf-trans pdfcomment pdfcprot pdfcrop pdfjam pdfmarginpar pdfpages pdfscreen pdfslide pdfsync pdftex-def pdftricks pdfx perception perltex permute persian-bib petiteannonce pgf pgf-soroban pgf-umlsd pgfopts pgfplots phaistos philex philosophersimprint phonetic photo picinpar pict2e pictex pictex2 pigpen pinlabel pittetd pkfix pkfix-helper placeins placeins-plain plari plantslabels plates play plnfss plweb pmgraph pnas2009 poemscol polski polyglossia polynom polynomial polytable popupmenu poster-mac powerdot-FUBerlin ppr-prv pracjourn preprint presentations prettyref preview printlen proba probsoln procIAGssymp program properties protex protocol psbao pseudocode psfrag psfrag-italian psgo pslatex psnfss pspicture pst-2dplot pst-3d pst-3dplot pst-abspos pst-am pst-asr pst-bar pst-barcode pst-bezier pst-blur pst-bspline pst-calendar pst-circ pst-coil pst-cox pst-dbicons pst-diffraction pst-eps pst-eucl pst-exa pst-fill pst-fr3d pst-fractal pst-fun pst-func pst-gantt pst-geo pst-grad pst-infixplot pst-jtree pst-knot pst-labo pst-lens pst-light3d pst-magneticfield pst-math pst-mirror pst-node pst-ob3d pst-optexp pst-optic pst-osci pst-pad pst-pdgr pst-platon pst-plot pst-poly pst-pdf pst-qtree pst-sigsys pst-solides3d pst-soroban pst-spectra pst-slpe pst-stru pst-support pst-text pst-thick pst-tree pst-uml pst-vowel pst-vue3d pst2pdf pstool pstricks pstricks-add psu-thesis ptptex purifyeps pxfonts qcm qobitree qstest qsymbols qtree quotmark r_und_s randbild rangen rccol rcs rcs-multi rcsinfo recipe recipecard recycle refman refstyle regcount register relsize renditions resumemac revtex rjlparshap rmpage robustcommand robustindex romannum rotating rotfloat roundbox rsc rsfs rtkinenc rtklage ryethesis sageep sansmath sauerj sauterfonts savefnmark savesym savetrees scale scalebar schemabloc scientificpaper sciposter screenplay script sdrt sectionbox sectsty selectp semantic semaphor seminar semioneside seqsplit setspace seuthesis sf298 sffms sfg sfheaders sfmath sgame shadbox shade shadethm shapepar shipunov shorttoc show2e showdim showexpl showlabels shuffle SIstyle SIunits sidecap sides siggraph silence simplecv simplewick siunitx skak skaknew skeycommand skeyval slantsc slideshow smalltableof smartref snapshot songbook sort-by-letters soton soul spanish spanish-mx sparklines spie splines splitbib splitindex spotcolor spreadtab sprite spverbatim srcltx sseq ssqquote stack stage standalone statex2 staves stdclsdv stdpage steinmetz stellenbosch stex stix stringstrings struktex sttools stubs suanpan subdepth subeqn subeqnarray subfig subfigure subfloat substr subsupscripts sudoku sudokubundle sugconf supertabular susy svgcolor svn svn-multi svn-prov svninfo swebib syllogism syntax synproof syntrace synttree t-angles t2 Tabbing tableaux tablenotes tablists tablor tabls tabto-generic tabto-ltx tabularborder tabularcalc tabularew tabulary tabvar talk tamethebeast tdclock tdsfrmath technics ted templates-fenn templates-sommer tengwarscript tensor termcal termlist teubner tex-ewd tex-font-errors-cheatsheet tex-gyre tex-label texcount texdiff texdirflatten texilikechaps texilikecover texloganalyser texmate texments texpower texshade textcase textfit textopo textpath textpos thailatex theoremref thesis-titlepage-fhac thinsp thmbox thmtools threeparttable threeparttablex thumb thumbpdf thumby thuthesis ticket tikz-3dplot tikz-inet tikz-qtree tikz-timing timetable tipa titlefoot titlepages titlepic titleref titlesec titling tkz-doc tkz-linknodes tkz-orm tkz-tab tocbibind tocloft tocvsec2 todo todonotes tokenizer toolbox tools totcount totpages tracking trajan translator tree-dvips trfsigns trimspaces trivfloat trsym tufte-latex tugboat tugboat-plain turkmen turnstile twoinone twoup txfonts txfontsb type1cm typedref typehtml typogrid uaclasses uebungsblatt ucdavisthesis ucs ucthesis uhrzeit uiucthesis ulem ulqda ulsy umich-thesis uml umlaute umthesis umtypewriter underlin underscore undertilde unicode-math units unitsdef universa upmethodology upquote url urlbst ushort ut-thesis uwthesis vancouver variations varindex varisize varsfromjobname varwidth vaucanson-g vector velthuis venn venturisadf verbatimbox verbatimcopy verbdef verse version versions vertbars vhistory visualfaq vmargin vntex volumes vpe vruler vwcol vxu wadalab wallpaper warning warpcol widetable williams wordlike wrapfig wsuipa xargs xcolor xcomment xdoc xecjk xecolour xecyr xeindex xepersian xesearch xetex-def xetex-itrans xetex-pstricks xetexfontinfo xetexref xfor xgreek xifthen xkeyval xlop xltxtra xmpincl xnewcommand xoptarg xpackages xq xskak xstring xtab xtcapts xunicode xwatermark xyling xypdf xypic-tut-pt xytree yagusylo ydoc york-thesis youngtab yplan zed-csp zefonts ziffer zhmetrics zhspacing zwgetfdate zwpagelayout ); # these packages we do not expect to check: my @TLP_no_check = ( "afm2pl", # not on CTAN "aleph", # binary "amscls", # ams confused "amstex", # ams confused "asymptote", # binary "bibtex", # binary "bibtex8", # binary "ctib", # binary "ctie", # binary "cweb", # binary "dvi2tty", # binary "dvicopy", # binary "dvidvi", # binary "dviljk", # binary "dvipdfm", # binary "dvipdfmx", # binary "dvipng", # binary "dvipos", # binary "dvips", # binary "enctex", # binary "etex", # binary "fontname", # tl-update-auto "gnu-freefont", # only packed on CTAN "groff", # binary "gsftopk", # binary "ifluatex", # part of oberdiek "kpathsea", # binary "latex-bin", # binary "latexconfig", # we maintain "lcdftypetools", # binary "luatex", # binary "makeindex", # binary "metafont", # binary "metapost", # binary "mfware", # binary "mltex", # binary "omegaware", # binary "patgen", # binary "pdftex", # binary "powerdot", # stale generated files on CTAN "synctex", # binary "t1utils", # binary "tetex", # our sources "tex", # binary "tex4ht", # binary "texconfig", # our sources "texdoc", # binary "texinfo", # tl-update-auto "texlive.infra", # binary "texware", # binary "texworks", # binary "tie", # binary "ttfutils", # binary "xdvi", # binary "xetex", # binary "xetexconfig", # our sources "xindy", # binary ); exit (&main ()); sub main { chomp ($Master = `cd $mydir/../.. && pwd`); $tlpdb = TeXLive::TLPDB->new ("root" => $Master); die "Cannot find tlpdb in $Master!" unless defined $tlpdb; $OPT{"verbose"} = 0; if ($ARGV[0] eq "--verbose") { $OPT{"verbose"} = 1; shift @ARGV; } if ($ARGV[0] eq "--list-not-treated") { my @not_checked = (); for my $b (&normal_tlps ()) { if (! grep ($b eq $_, @TLP_working, @TLP_no_check)) { push (@not_checked, $b); } } print "" . (@not_checked+0) . " TL packages not checked against CTAN:\n"; print "@not_checked\n"; @ARGV = (); # no normal checks } elsif ($ARGV[0] eq "--check") { # check all/only those packages we have actually run through this mill. @ARGV = @TLP_working; } elsif ($ARGV[0] eq "--check-all") { @ARGV = &normal_tlps (); } my $errcount = 0; for my $tlp (@ARGV) { print "checking $tlp..." if $OPT{"verbose"}; $errcount += &do_tlp ($tlp); } return $errcount; } # gives a list with only the 'normal' packages, # that is, excluding meta-packages and binary packages # (and hyphen for the moment) # sub normal_tlps { my @normal; my $non_normal = `ls $Master/bin`; $non_normal =~ s/\n/\$|/g; $non_normal .= '^0+texlive|^bin-|^collection-|^scheme-|^texlive-|^hyphen-'; foreach ($tlpdb->list_packages) { push (@normal, $_) unless (/$non_normal/); } return @normal; } # Return 1 if package needs updating, 0 if ok. # sub do_tlp { my ($tlpn) = @_; my $needed = 0; my $tlp = $tlpdb->get_package($tlpn); if (!defined($tlp)) { warn "$0: no package $tlpn\n"; return 1; } chomp (my $ctan_dir = `$mydir/tlpkginfo --prepare '$tlpn'`); if (! $ctan_dir) { warn "$0: oops, no CTAN directory for $tlpn, fix fix\n"; return (); } my @tl_files = (); push @tl_files, $tlp->runfiles; push @tl_files, $tlp->docfiles; push @tl_files, $tlp->srcfiles; if ($tlp->relocated) { for (@tl_files) { s:^$RelocPrefix/:$RelocTree/:; } } # we don't push bin files. my @tl_basefiles = (); # compare with CTAN after the loop my @compared = (); for my $file (@tl_files) { (my $basefile = $file) =~ s,^.*/,,; #warn "checking file $file -> $basefile\n"; push (@tl_basefiles, $basefile); # no point yet in comparing our pdfs, we have generated too many. # revisit this someday to see how many of ours are actually different. # However, for lshort translations, the pdf is often the only thing # we have to compare. next if $file =~ /\.pdf$/ && $file !~ /short/; my $tl_file = "$Master/$file"; if (! -e $tl_file) { warn "$tl_file: TL file missing\n"; next; } chomp (my @ctan_files = `find $ctan_dir/ -name $basefile`); #warn "ctan find $basefile: @ctan_files\n"; # the trailing / is so if we happen to hit a symlink on CTAN, it'll # go through. next if @ctan_files > 1; # if more than one file by same name, skip my $ctan_file = $ctan_files[0]; #warn "ctan file is $ctan_file\n"; if (! -e $ctan_file) { # maybe it'll be there with a case change in the name chomp (@ctan_files = `find $ctan_dir/ -iname $basefile`); next if @ctan_files > 1; # if more than one file by same name, skip $ctan_file = $ctan_files[0]; if (! -e $ctan_file) { # we generate lots of files, eg perlmacros.sty, so might skip. warn "$ctan_file: CTAN file missing\n" if $ctan_file && $ctan_file !~ /(cfg|dvi|sty|tex)$/; next; } } push (@compared, $basefile); if (&files_differ ($tl_file, $ctan_file)) { print "# $tlpn\ndiff $ctan_file $tl_file\n"; $needed = 1; last unless $OPT{"all"}; } } # unfortunately, we cannot do this. There are many PDF's on CTAN # which have no sources or otherwise problematic for TL. Perhaps one # day we could use the %moreclean hash from ctan2tds as an additional # filter, i.e., put all those ctan2tds tables in an external file. # # # check for PDF files on CTAN that we don't have. # my @ctan_pdf_needed = (); # chomp (my @ctan_files = `find $ctan_dir -name \*.pdf`); # for my $cfile (@ctan_files) { # (my $base_cfile = $cfile) =~ s,^.*/,,; # if (! grep { $_ eq $base_cfile } @tl_basefiles) { # push (@ctan_pdf_needed, $base_cfile); # } # } # if (@ctan_pdf_needed) { # if (! $needed) { # # if this is the first thing needed (no diffs), print package name. # print "# $tlpn\n"; # $needed = 1; # } # print "# new on ctan: @ctan_pdf_needed\n"; # } if (@compared == 0) { warn "\n$tlpn: no files to compare in $ctan_dir, fixme!\n"; warn " (tl_files = @tl_files)\n"; warn " (ctan_files = @ctan_files)\n"; } elsif ($needed == 0) { print "ok\n" if $OPT{"verbose"}; } print ((@compared + 0) . " compared (@compared)\n") if $OPT{"verbose"}; # clean up the tmpdir possibly created from tlpkginfo --prepare. chomp (my $ctan_root = `$mydir/tlpkginfo --ctan-root`); if ($ctan_dir !~ m,^$ctan_root, && ! $OPT{"no-clean"}) { system ("rm -rf $ctan_dir"); } return $needed; } # 0 if files are the same, 1 if they are different. # sub files_differ { my ($tl_file,$ctan_file) = @_; #warn "comparing $ctan_file $tl_file\n"; return system ("$mydir/cmp-textfiles $ctan_file $tl_file"); } # vim: set ts=8 sw=2 expandtab: