Skip to content

File Exists Error when in odd state #66

@drewbitt

Description

@drewbitt

Issue

❯ pkgm install mpv
error: Uncaught (in promise) AlreadyExists: File exists (os error 17): symlink '/opt/freedesktop.org/fontconfig/v2.14.1/share/fontconfig/conf.avail/65-nonlatin.conf' -> '/Users/drewbitt/.local/pkgs/freedesktop.org/fontconfig/v2.14.1/etc/fonts/conf.d/65-nonlatin.conf'
  Deno.symlinkSync(src, dst);
       ^
    at Object.symlinkSync (ext:deno_fs/30_fs.js:504:3)
    at symlink_with_overwrite (file:///opt/homebrew/bin/pkgm:500:8)
    at processEntry (file:///opt/homebrew/bin/pkgm:375:7)
    at eventLoopTick (ext:core/01_core.js:178:7)
    at async processEntry (file:///opt/homebrew/bin/pkgm:363:9)
    at async processEntry (file:///opt/homebrew/bin/pkgm:363:9)
    at async processEntry (file:///opt/homebrew/bin/pkgm:363:9)
    at async processEntry (file:///opt/homebrew/bin/pkgm:363:9)
    at async mirror_directory (file:///opt/homebrew/bin/pkgm:350:3)
    at async install (file:///opt/homebrew/bin/pkgm:153:5)

~ took 4s

Scenario

  • I had pkgm installed version of mpv in ~/.local/bin, but it was when pkgm was older, it did not detect it with list. I wanted a newer version. I ran rm ~/.local/bin/mpv
  • Installed it back pkgm install mpv. Looked and instead of installing just mpv, it put like 50 new binaries in ~/.local/bin of its dependencies.
  • Unacceptable. Just removing mpv did not remove all the extras, so I did a rm -rf ~/.local/bin
  • Can no longer install mpv, even after wiping much of my ~/.local and starting over.

After rm -rf ~/.local/pkgs/freedesktop.org/fontconfig and rm -rf /Users/drewbitt/.local/etc/fonts/conf.d/` I can finally get

error: Uncaught (in promise) Error: Directory not empty (os error 66): remove '/Users/drewbitt/.local/pkgs/pcre.org/v2'
    Deno.removeSync(dst);
         ^
    at Object.removeSync (ext:deno_fs/30_fs.js:247:3)
    at symlink_with_overwrite (file:///opt/homebrew/bin/pkgm:498:10)
    at create_v_symlinks (file:///opt/homebrew/bin/pkgm:452:5)
    at eventLoopTick (ext:core/01_core.js:178:7)
    at async install (file:///opt/homebrew/bin/pkgm:162:5)
    at async file:///opt/homebrew/bin/pkgm:65:20

Final fix

rm -rf ~/.local/pkgs/freedesktop.org/fontconfig
rm -rf /Users/drewbitt/.local/etc/fonts/conf.d/
rm -rf ~/.local/pkgs/pcre.org

Please recover from this state, which may be odd, but until #43 may come up. I don't want these extras in my ~./local/bin at all, though.

Side note

❯ pkgm install mpv
/Users/drewbitt/.local/bin/bzip2recover
/Users/drewbitt/.local/bin/bzmore
/Users/drewbitt/.local/bin/bzgrep
/Users/drewbitt/.local/bin/bzdiff
/Users/drewbitt/.local/bin/bunzip2

Still a bunch of stuff I don't want

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions