[pacman-dev] [PATCH] sync: avoid checking file conflicts with --dbonly
Scratches my own itch from FS#25667 Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- lib/libalpm/sync.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 3817ec8..534499a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -1160,7 +1160,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) trans->state = STATE_COMMITING; /* fileconflict check */ - if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) { + if(!(trans->flags & (ALPM_TRANS_FLAG_FORCE|ALPM_TRANS_FLAG_DBONLY))) { EVENT(handle, ALPM_EVENT_FILECONFLICTS_START, NULL, NULL); _alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n"); -- 1.7.7.4
Scratches my own itch from FS#25667
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- lib/libalpm/sync.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 3817ec8..534499a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -1160,7 +1160,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) trans->state = STATE_COMMITING;
/* fileconflict check */ - if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) { + if(!(trans->flags & (ALPM_TRANS_FLAG_FORCE|ALPM_TRANS_FLAG_DBONLY))) { EVENT(handle, ALPM_EVENT_FILECONFLICTS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n");
This is good, if you want to install a dbonly package to own "orphan" files. This is not good, if an installed package already owns the conflicting file. Then it can happen that both foo and bar packages will contain the same file, and when you remove one of those packages, the other one will become corrupt. Btw, I don't know if this matters, this whole --dbonly stuff is quite hackish. NG
On Fri, Nov 25, 2011 at 04:17:12PM +0100, Nagy Gabor wrote:
Scratches my own itch from FS#25667
Signed-off-by: Dave Reisner <dreisner@archlinux.org> --- lib/libalpm/sync.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 3817ec8..534499a 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -1160,7 +1160,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) trans->state = STATE_COMMITING;
/* fileconflict check */ - if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) { + if(!(trans->flags & (ALPM_TRANS_FLAG_FORCE|ALPM_TRANS_FLAG_DBONLY))) { EVENT(handle, ALPM_EVENT_FILECONFLICTS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n");
This is good, if you want to install a dbonly package to own "orphan" files. This is not good, if an installed package already owns the conflicting file. Then it can happen that both foo and bar packages will contain the same file, and when you remove one of those packages, the other one will become corrupt. Btw, I don't know if this matters, this whole --dbonly stuff is quite hackish.
NG
Well, ideally, on -S --dbonly if there's a file conflict, the packages will also have a conflicts= (which will still be honored). Yes, this is all extremely hackish and shouldn't be used. Never the less, if you're performing an operation on the DB only, it really should be on the DB only. d
Am 25.11.2011 16:47, schrieb Dave Reisner:
Well, ideally, on -S --dbonly if there's a file conflict, the packages will also have a conflicts= (which will still be honored). Yes, this is all extremely hackish and shouldn't be used. Never the less, if you're performing an operation on the DB only, it really should be on the DB only.
Ideally, pacman would ignore file conflicts in the file system only if the files do not belong to any package. If the conflicting files belong to an installed package, it should still abort and require -f.
On Fri, Nov 25, 2011 at 10:19 AM, Thomas Bächler <thomas@archlinux.org> wrote:
Am 25.11.2011 16:47, schrieb Dave Reisner:
Well, ideally, on -S --dbonly if there's a file conflict, the packages will also have a conflicts= (which will still be honored). Yes, this is all extremely hackish and shouldn't be used. Never the less, if you're performing an operation on the DB only, it really should be on the DB only.
Ideally, pacman would ignore file conflicts in the file system only if the files do not belong to any package. If the conflicting files belong to an installed package, it should still abort and require -f.
Taking another quick look at this old patch. Given that --dbonly is probably used by 0.1% of our users, if that, I'm inclined to just apply the original patch. Yes, you could hose your database, but if you're even using dbonly, you are in a sense doing that anyway. I feel like --dbonly is an option from years ago that has lost its original usefulness (I'm not even sure what that was, to be honest). If it is only to fake having a package installed, wouldn't it be easier to have some sort of fake provision allowance in pacman.conf or something? FakeInstalled = python-random-module-from-pip=4.2.1 cpan-module=234 -Dan
participants (4)
-
Dan McGee
-
Dave Reisner
-
Nagy Gabor
-
Thomas Bächler