summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib/file.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-04-22 13:58:44 +0000
committerjkh <jkh@FreeBSD.org>1995-04-22 13:58:44 +0000
commitd3abd00ffec4e327d8ad0d9d1401caf10752f449 (patch)
tree7aff6de9fe129eefedbbfe9af4b9488f6e43469c /usr.sbin/pkg_install/lib/file.c
parent631042660156d0f11cb143dc9a3fc9667a5705e2 (diff)
downloadFreeBSD-src-d3abd00ffec4e327d8ad0d9d1401caf10752f449.zip
FreeBSD-src-d3abd00ffec4e327d8ad0d9d1401caf10752f449.tar.gz
Export the min_free() function.
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 e2c2668..19470be 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 : "")) {
OpenPOWER on IntegriCloud