casualsnek / waydroid_script

Python Script to add OpenGapps, Magisk, libhoudini translation library and libndk translation library to waydroid !
GNU General Public License v3.0
1.5k stars 144 forks source link

The script can't find resetprop if it isn't run from within it's directory. #101

Open niobium93 opened 1 year ago

niobium93 commented 1 year ago

The waydroid-script-git AUR package installs waydroid_script into /opt/waydroid-script/ and symlinks main.py to /usr/bin/waydroid-extras. This mostly seems to work, but when running the script from any random directory it sometimes fails like this: sudo waydroid-extras install libndk

INFO: Downloading libndktranslation.zip now to /home/andrius/.cache/waydroid-script/downloads/libndktranslation.zip .....
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 14.4M/14.4M [00:00<00:00, 21.5MiB/s]
INFO: Extracting /home/andrius/.cache/waydroid-script/downloads/libndktranslation.zip to /tmp/libndkunpack
INFO: Copying libndk library files ...
Traceback (most recent call last):
  File "/usr/bin/waydroid-extras", line 343, in <module>
    main()
  File "/usr/bin/waydroid-extras", line 336, in main
    args.func(args)
  File "/usr/bin/waydroid-extras", line 107, in install_app
    item.install()
  File "/opt/waydroid-script/stuff/general.py", line 180, in install
    self.add_props()
  File "/opt/waydroid-script/stuff/general.py", line 76, in add_props
    shutil.copy(os.path.join(
  File "/usr/lib/python3.11/shutil.py", line 419, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.11/shutil.py", line 256, in copyfile
    with open(src, 'rb') as fsrc:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './bin/x86_64/resetprop'

cd /opt/waydroid-script is a workaround, but it would be nice if the script could find it's own location and find dependencies based on that.

austinrojers commented 1 year ago

Yup, same issue here. But it works after the first time we run it from /opt/waydroid-script/ directory.