summaryrefslogtreecommitdiffstats
path: root/urpm/util.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-11-04 16:22:30 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-11-04 16:22:30 +0000
commit5ed8cc71bb4a24dcf6b8f0e1ea2b655c1fc24713 (patch)
tree58dea230537df4a31645a841cc6b87b87188b8a9 /urpm/util.pm
parenta0bd3573950dc7366957fbd15ff63591ef29af98 (diff)
downloadurpmi-5ed8cc71bb4a24dcf6b8f0e1ea2b655c1fc24713.tar
urpmi-5ed8cc71bb4a24dcf6b8f0e1ea2b655c1fc24713.tar.gz
urpmi-5ed8cc71bb4a24dcf6b8f0e1ea2b655c1fc24713.tar.bz2
urpmi-5ed8cc71bb4a24dcf6b8f0e1ea2b655c1fc24713.tar.xz
urpmi-5ed8cc71bb4a24dcf6b8f0e1ea2b655c1fc24713.zip
Factor some system()s
Diffstat (limited to 'urpm/util.pm')
-rw-r--r--urpm/util.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/urpm/util.pm b/urpm/util.pm
index eb2fc912..8abb816e 100644
--- a/urpm/util.pm
+++ b/urpm/util.pm
@@ -75,7 +75,17 @@ sub offset_pathname {
sub md5sum {
#- Use an external command to avoid depending on perl
my ($file) = @_;
- return( (split ' ', `md5sum '$file'`)[0] );
+ return((split ' ', `md5sum '$file'`)[0]);
+}
+
+sub copy {
+ my ($file, $dest) = @_;
+ !system("/bin/cp", "-p", "-R", $file, $dest);
+}
+
+sub move {
+ my ($file, $dest) = @_;
+ rename($file, $dest) or !system("/bin/mv", "-f", $file, $dest);
}
1;