Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore package-conflicts, when none of the "problematic" files actually exist #2168

Open
UnitedMarsupials opened this issue Jul 26, 2023 · 3 comments

Comments

@UnitedMarsupials
Copy link

It would seem reasonable, that, when the conflicting files do not actually exist on the filesystem, the installation should not fail. Instead of seeking, how to modify pkg's command line to "force" the installation, it may be easier to just delete the few problematic entries (when there are only a few, that is).

The below patch may be incomplete -- the same method may need extending to the config-files and directories -- but gives an idea, of what I mean...

--- libpkg/pkgdb.c      2023-07-12 03:48:26.000000000 -0400
+++ libpkg/pkgdb.c      2023-07-25 22:30:14.525498000 -0400
@@ -43,4 +43,5 @@
 #include <sys/param.h>
 #include <sys/mount.h>
+#include <sys/stat.h>
 
 #include <assert.h>
@@ -1671,4 +1672,6 @@
        while (pkg_files(pkg, &file) == EPKG_OK) {
                bool            permissive = false;
+               struct stat     sb;
+
                if (match_ucl_lists(file->path,
                    pkg_config_get("FILES_IGNORE_GLOB"),
@@ -1709,4 +1712,19 @@
                        ERROR_STMT_SQLITE(s, STMT(FILES_REPLACE));
                        goto cleanup;
+               }
+               if (stat(file->path, &sb) != 0) {
+                       switch (errno) {
+                       case ENOENT:
+                       case ENAMETOOLONG:
+                       case ELOOP:
+                               pkg_emit_error("%s-%s seems to conflict with %s-%s, "
+                                   "but the problematic %s does not exist, ignoring",
+                                   pkg->name, pkg->version, pkg2->name, pkg2->version,
+                                   file->path);
+                               pkg_free(pkg2);
+                               continue;
+                       default:
+                               warn("%s: stat", file->path);
+                       }
                }
                if (!forced) {
@igalic
Copy link

igalic commented Jul 26, 2023

In that circumstances would this be the case?

@UnitedMarsupials
Copy link
Author

In what circumstances would this be the case?

One example is when a family of related ports is rearranged, and trying to portupgrade them causes conflicts. Such as the multimedia/gstreamer1-plugins-ugly used to install a shared object, which is now provided by the multimedia/gstreamer1-plugins-bad...

@Jay-sanjay
Copy link

Hello everyone , I wanted to contribute to the freeBSD project , can someone assist me further for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants