Git Product home page Git Product logo

Comments (3)

ayasa520 avatar ayasa520 commented on May 28, 2024

ayasa520@fa8d6c2
After further improvement, I will create PR

from waydroid_script.

casualsnek avatar casualsnek commented on May 28, 2024

ayasa520@fa8d6c2 After further improvement, I will create PR

Maybe we could track the file during installation file and save them ? It will be easier to remove the file from package that got updated while the user had older installed ! Maintenance may also be easier as we won't have to make a list of files that got changed after a package update !
For clean uninstallation of houdini and other stuff using props, a unset_props method in general that takes each keys of app_props dict and does re.sub(f'^{prop_key}.*$', '', current_prop) would be enough too !

def unset_props(self):
    with open(os.path.join("/var/lib/waydroid/waydroid_base.prop"), "r") as propfile:
        prop_content = propfile.read()
        for key in self.apply_props:
            prop_content = re.sub(f'^{key}.*$', '', prop_content) # We may need to save value if prop already existed during install and we have backup for it's key/value and set the second parameter of re.sub to "  f'{key}:{old_value}'  "
    with open(os.path.join("/var/lib/waydroid/waydroid_base.prop"), "w") as propfile:
        propfile.write(prop_content)

from waydroid_script.

ayasa520 avatar ayasa520 commented on May 28, 2024

Maybe we could track the file during installation file and save them

If this saved file is accidentally deleted, the user will not be able to complete the uninstallation.

For clean uninstallation of houdini and other stuff using props, a unset_props method in general that takes each keys of app_props dict and does re.sub(f'^{prop_key}.*$', '', current_prop) would be enough too !

Yea, I did add this method. https://github.com/ayasa520/waydroid_script/blob/200e18bb0d03ce1cbdd88e9b28a95b8b2d526f80/stuffs/general.py#L74-L82

/system/etc/init/xxx.rc will still be executed after clearing the key-value pairs in prop file, so I think it's better to delete it completely

from waydroid_script.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.