SetDirectory["C:\\drorbn\\AcademicPensieve\\2013-01\\CDMReview"]

FileNames["*.pdf"]

target = "CDMReview";
sources = Join[
{"CDMReview.tex", "defs.tex", "refs.tex"},
Complement[
FileNames["*.pdf"],
{"CDMReview.pdf", "CDMReview-130202.pdf", "CDMReview-PostSubmissionMods.pdf", "Proofs-130403.pdf", "Reply-130407.pdf"}
],
FileNames["*.fig"]
]

FileType[target<>".zip"]

Sort[FileDate /@ sources]  // Last

FileDate[target<>".zip"]

OrderedQ[{FileDate[target<>".zip"], Sort[FileDate /@ sources]  // Last}]

FileType[target]

dir=CreateDirectory[target]

If[FileType[target<>".zip"]===None || (
FileType[target<>".zip"] === File && OrderedQ[{FileDate[target<>".zip"], Sort[FileDate /@ sources]  // Last}]),
Print["Making ",target,".zip..."];
If[
FileType[target] === Directory,
DeleteDirectory[target, DeleteContents->True]
];
dir=CreateDirectory[target];
CopyFile[# , FileNameJoin[{dir, #}]]& /@ sources;
CopyFile[
FileNameJoin[{"../../Projects/dbnsymb/", "dbnsymb"<>#}],
FileNameJoin[{dir, "dbnsymb"<>#}]
]& /@ {".mf", ".sty"};
Export[
FileNameJoin[{dir, "dbnsymb"<>#}],
Import["http://www.math.toronto.edu/~drorbn/projects/dbnsymb/dbnsymb"<>#],
"Text"
]& /@ {".mf", ".sty"};
If[FileType[target<>".zip"] === File, DeleteFile[target<>".zip"]];
CreateArchive[dir, target<>".zip"];
DeleteDirectory[target, DeleteContents->True];
];

{"TitleNotes"->"
    This is the construction page for <a href=CDMReview.pdf>CDMReview.pdf</a>; all sources are at <a href=CDMReview.zip>CDMReview.zip</a>.
    <p>"}