xbps-install: make -f preserve conf files; use it twice to overwrite all files.
This commit is contained in:
parent
7d8f0bb686
commit
5c1688944d
5
NEWS
5
NEWS
@ -1,5 +1,10 @@
|
||||
xbps-0.21 (???):
|
||||
|
||||
* xbps-install(8): the -f, --force flag will now preserve configuration
|
||||
files if they were modified, and only unpack files that have been
|
||||
modified when re-installing packages. If -f is specified twice (-ff)
|
||||
all package files will be overwritten from new package.
|
||||
|
||||
* Fix regression in xbps_fetch_file() when fetching files from HTTP
|
||||
servers that don't provide us enough details (file length, mtime, etc).
|
||||
|
||||
|
@ -47,7 +47,9 @@ usage(bool fail)
|
||||
" -C --config <file> Full path to configuration file\n"
|
||||
" -c --cachedir <dir> Full path to cachedir\n"
|
||||
" -d --debug Debug mode shown to stderr\n"
|
||||
" -f --force Force package installation\n"
|
||||
" -f --force Force package re-installation\n"
|
||||
" If specified twice, all files will be\n"
|
||||
" overwritten.\n"
|
||||
" -h --help Print help usage\n"
|
||||
" -n --dry-run Dry-run mode\n"
|
||||
" -R --repository <uri> Default repository to be used if config not set\n"
|
||||
@ -84,7 +86,7 @@ main(int argc, char **argv)
|
||||
struct xbps_handle xh;
|
||||
struct xferstat xfer;
|
||||
const char *rootdir, *cachedir, *conffile, *defrepo;
|
||||
int i, c, flags, rv;
|
||||
int i, c, flags, rv, fflag = 0;
|
||||
bool sync, yes, reinstall, drun, update;
|
||||
size_t maxcols;
|
||||
|
||||
@ -107,7 +109,9 @@ main(int argc, char **argv)
|
||||
flags |= XBPS_FLAG_DEBUG;
|
||||
break;
|
||||
case 'f':
|
||||
flags |= XBPS_FLAG_FORCE_INSTALL;
|
||||
fflag++;
|
||||
if (fflag > 1)
|
||||
flags |= XBPS_FLAG_FORCE_UNPACK;
|
||||
reinstall = true;
|
||||
break;
|
||||
case 'h':
|
||||
|
@ -1,4 +1,4 @@
|
||||
.Dd January 31, 2013
|
||||
.Dd February 2, 2013
|
||||
.Os Void Linux
|
||||
.Dt xbps-install 8
|
||||
.Sh NAME
|
||||
@ -59,7 +59,12 @@ Specifies a full path to the cache directory, where binary packages are stored.
|
||||
Enables extra debugging shown to stderr.
|
||||
.It Fl f, Fl -force
|
||||
Forcefully install target package even if another version is already installed,
|
||||
overwritting its package files.
|
||||
overwritting regular package files and symlinks (if they have been modified) but
|
||||
.Em preserving configuration files .
|
||||
If
|
||||
.Fl f
|
||||
is specified twice,
|
||||
.Em configuration files will also be overwritten .
|
||||
.It Fl h, Fl -help
|
||||
Show the help usage.
|
||||
.It Fl n, Fl -dry-run
|
||||
|
@ -64,7 +64,7 @@
|
||||
*/
|
||||
#define XBPS_PKGINDEX_VERSION "1.6"
|
||||
|
||||
#define XBPS_API_VERSION "20121215"
|
||||
#define XBPS_API_VERSION "20130202"
|
||||
|
||||
#ifndef XBPS_VERSION
|
||||
#define XBPS_VERSION "UNSET"
|
||||
@ -189,12 +189,12 @@
|
||||
#define XBPS_FLAG_DEBUG 0x00000040
|
||||
|
||||
/**
|
||||
* @def XBPS_FLAG_FORCE_INSTALL
|
||||
* @def XBPS_FLAG_FORCE_UNPACK
|
||||
* Force flag used in xbps_unpack_binary_pkg(). If set its package
|
||||
* files will be unpacked overwritting the current ones.
|
||||
* Must be set through the xbps_handle::flags member.
|
||||
*/
|
||||
#define XBPS_FLAG_FORCE_INSTALL 0x00000080
|
||||
#define XBPS_FLAG_FORCE_UNPACK 0x00000080
|
||||
|
||||
/**
|
||||
* @def XBPS_FETCH_CACHECONN
|
||||
|
@ -122,7 +122,7 @@ unpack_archive(struct xbps_handle *xhp,
|
||||
|
||||
euid = geteuid();
|
||||
|
||||
if (xhp->flags & XBPS_FLAG_FORCE_INSTALL)
|
||||
if (xhp->flags & XBPS_FLAG_FORCE_UNPACK)
|
||||
force = true;
|
||||
|
||||
if (xhp->unpack_cb != NULL) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user