aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/lib/file.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1995-04-22 13:58:44 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1995-04-22 13:58:44 +0000
commit3e1a18606d886d71c06157a70949e4ec1e27e4b2 (patch)
tree7aff6de9fe129eefedbbfe9af4b9488f6e43469c /usr.sbin/pkg_install/lib/file.c
parentcbf098db0e18b7374353b1fc511498c2f48f5c3b (diff)
Notes
Diffstat (limited to 'usr.sbin/pkg_install/lib/file.c')
-rw-r--r--usr.sbin/pkg_install/lib/file.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index e2c26688a0f5..19470be639a9 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: file.c,v 1.5 1993/09/18 03:39:48 jkh Exp $";
+static const char *rcsid = "$Id: file.c,v 1.6 1994/12/06 00:51:48 jkh Exp $";
#endif
/*
@@ -132,6 +132,19 @@ copy_file(char *dir, char *fname, char *to)
barf("Couldn't perform '%s'", cmd);
}
+void
+move_file(char *dir, char *fname, char *to)
+{
+ char cmd[FILENAME_MAX];
+
+ if (fname[0] == '/')
+ sprintf(cmd, "mv %s %s", fname, to);
+ else
+ sprintf(cmd, "mv %s/%s %s", dir, fname, to);
+ if (vsystem(cmd))
+ barf("Couldn't perform '%s'", cmd);
+}
+
/*
* Copy a hierarchy (possibly from dir) to the current directory, or
* if "to" is TRUE, from the current directory to a location someplace
@@ -174,7 +187,7 @@ unpack(char *pkg, char *flist)
if (cp) {
strcpy(suffix, cp + 1);
if (index(suffix, 'z') || index(suffix, 'Z'))
- strcpy(args, "z");
+ strcpy(args, "-z");
}
strcat(args, "xpf");
if (vsystem("tar %s %s %s", args, pkg, flist ? flist : "")) {