diff options
author | jkh <jkh@FreeBSD.org> | 1997-07-01 06:13:51 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-07-01 06:13:51 +0000 |
commit | ee55475a0f2a0c7391240ed7c9adc2b5a6e10a94 (patch) | |
tree | 0bc137577fb61dd8c8d58f35374873f1f35c4526 /usr.sbin/pkg_install/lib/plist.c | |
parent | 3f044120cdb6253359462b5085756fca82a23d1c (diff) | |
download | FreeBSD-src-ee55475a0f2a0c7391240ed7c9adc2b5a6e10a94.zip FreeBSD-src-ee55475a0f2a0c7391240ed7c9adc2b5a6e10a94.tar.gz |
Change the naming conventions for preserve'd files and also document
the option in pkg_create. Now preserved files start with a . and are
named .<filename>.<pkgname>.backup so that their purpose is more clear.
Note that just using the preserve option without proper pkg_deps
is also foolish since packages being deleted in the incorrect order with
preserve on can generate some odd results.
Diffstat (limited to 'usr.sbin/pkg_install/lib/plist.c')
-rw-r--r-- | usr.sbin/pkg_install/lib/plist.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c index 8440e3c..58907b3 100644 --- a/usr.sbin/pkg_install/lib/plist.c +++ b/usr.sbin/pkg_install/lib/plist.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: plist.c,v 1.20 1997/06/29 10:41:49 jkh Exp $"; +static const char *rcsid = "$Id: plist.c,v 1.21 1997/06/30 03:15:40 jkh Exp $"; #endif /* @@ -414,13 +414,10 @@ delete_package(Boolean ign_err, Boolean nukedirs, Package *pkg) whinge("Unable to completely remove file '%s'", tmp); fail = FAIL; } - if (preserve) { - if (!name) - whinge("preserve set but no package name supplied!"); - else { - char tmp2[FILENAME_MAX]; + if (preserve && name) { + char tmp2[FILENAME_MAX]; - snprintf(tmp2, FILENAME_MAX, "%s.%s", tmp, name); + if (make_preserve_name(tmp2, FILENAME_MAX, name, tmp)) { if (fexists(tmp2)) { if (rename(tmp2, tmp)) whinge("preserve: Unable to restore %s as %s, errno = %d", tmp2, tmp, errno); |