diff options
author | Reinhard Kotucha <reinhard.kotucha@web.de> | 2008-11-08 16:12:43 +0000 |
---|---|---|
committer | Reinhard Kotucha <reinhard.kotucha@web.de> | 2008-11-08 16:12:43 +0000 |
commit | 02b72f3257a9e754cbeca266658c4bb8855c810e (patch) | |
tree | 527fc60f6dbffe7e82179be4f713cdebf850e2e0 /Master/tlpkg/TeXLive | |
parent | b4462104d6a3f21fd251fc9618c85af5c190ee01 (diff) |
TLUtils.pm: New function touch() added.
git-svn-id: svn://tug.org/texlive/trunk@11224 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index ecae24bfc46..0f6712e5775 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -40,6 +40,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::mkdirhier($path); TeXLive::TLUtils::rmtree($root, $verbose, $safe); TeXLive::TLUtils::copy($file, $target_dir); + TeXLive::TLUtils::touch(@files); TeXLive::TLUtils::download_file($path, $destination [, $progs ]); TeXLive::TLUtils::setup_programs($bindir, $platform); @@ -89,6 +90,7 @@ BEGIN { &mkdirhier &rmtree © + &touch &install_package &install_packages &make_var_skeleton @@ -748,6 +750,30 @@ sub copy { } } + +=pod + +=item C<touch(@files)> + +Update modification and access time of C<@files>. Non existent files +are created. + +=cut + +sub touch { + my @files=@_; + + foreach my $file (@_) { + if (-e $file) { + utime time, time, $file; + } else { + open TMP, ">>$file" && close TMP + or warn "Can't update timestamps of $file: $!\n"; + } + } +} + + =pod =item C<install_packages($from_tlpdb, $media, $to_tlpdb, $what, $opt_src, $opt_doc)> |