diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-03-04 08:36:56 +0200 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-03-04 08:36:56 +0200 |
commit | a62dcf37c1d1ee2907e5e39759aa99259c458783 (patch) | |
tree | 501369316957cf772e291fb4e00918ebd09825b4 /src/database.c | |
parent | 457943f83e21bde7e6858884d25bc89934344a52 (diff) | |
download | apk-tools-a62dcf37c1d1ee2907e5e39759aa99259c458783.tar.gz apk-tools-a62dcf37c1d1ee2907e5e39759aa99259c458783.tar.bz2 apk-tools-a62dcf37c1d1ee2907e5e39759aa99259c458783.tar.xz apk-tools-a62dcf37c1d1ee2907e5e39759aa99259c458783.zip |
apk: --force to overwrite files
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c index 108c3ab..7e5b62e 100644 --- a/src/database.c +++ b/src/database.c @@ -1053,9 +1053,17 @@ static int apk_db_install_archive_entry(void *_ctx, if (file->diri != diri) { opkg = file->diri->pkg; if (opkg->name != pkg->name) { - apk_error("%s: Trying to overwrite %s owned by %s.\n", - pkg->name->name, ae->name, opkg->name->name); - return -1; + if (!apk_force) { + apk_error("%s: Trying to overwrite %s " + "owned by %s.\n", + pkg->name->name, ae->name, + opkg->name->name); + return -1; + } + apk_warning("%s: Trying to overwrite %s " + "owned by %s.\n", + pkg->name->name, ae->name, + opkg->name->name); } apk_db_file_change_owner(db, file, diri, |