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

Got issue while installing JavaScript dashset : rm no such file or directory. #62

Open
edi9999 opened this issue Sep 17, 2024 · 3 comments

Comments

@edi9999
Copy link

edi9999 commented Sep 17, 2024

It seems like some unicode character in the Javascript.docset causes an issue in the install script.

Reproduce with this script :

 \rm -rf ~/.local/share/dasht/docsets/JavaScript.tgz ~/.local/share/dasht/docsets/JavaScript.docset/ && dasht-docsets-install -f ^JavaScript$

Gives following output :

        JavaScript

--2024-09-17 09:42:50--  https://kapeli.com/feeds/JavaScript.tgz
Resolving kapeli.com (kapeli.com)... 23.92.22.81
Connecting to kapeli.com (kapeli.com)|23.92.22.81|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250885359 (239M) [application/x-tar]
Saving to: ‘/home/edgar/.local/share/dasht/docsets/JavaScript.tgz’

245000K .....                                                 100% 9.75T=16s

2024-09-17 09:43:07 (14.8 MB/s) - ‘/home/edgar/.local/share/dasht/docsets/JavaScript.tgz’ saved [250885359/250885359]

removed '/home/edgar/.local/share/dasht/docsets/JavaScript.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/aside_â'$'\302\200\302\224''_.mjs_versus_.html'
rm: cannot remove '/home/edgar/.local/share/dasht/docsets/JavaScript.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/aside_â\302\200\302\224_.mjs_versus_.html': No such file or directory
@edi9999
Copy link
Author

edi9999 commented Sep 17, 2024

The issue seems to happen in the following command (dasht-docsets-extract) :

  { find "$want" -print
    tar -t -f "$tgz" -z | sed -e "s|^[^/]*|$want|" -e 's|/$||'
  } | sort -r | uniq -c | sed -n 's/^ *1 //p' | while read -r arg; do
      if test -d "$arg"
      then rmdir "$arg"
      else rm -v "$arg"
      fi
  done

@edi9999
Copy link
Author

edi9999 commented Sep 17, 2024

The rm here is the one that fails.

@edi9999
Copy link
Author

edi9999 commented Sep 17, 2024

Changing it to this worked for me :

  # remove any stale files that were left behind by the previous extraction
  { find "$want" -print
    tar -t -f "$tgz" -z | sed -e "s|^[^/]*|$want|" -e 's|/$||'
  } | sort -r | uniq -c | sed -n 's/^ *1 //p' | while read -r arg; do
      if test -d "$arg"
      then rmdir "$arg"
      elif test -f "$arg"
      then
          rm -v "$arg"
      fi
  done

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

1 participant