Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

fix: assert write permissions on gnome-shell copy #808

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

computercam
Copy link

Description

In systems with immutable package stores, the source files used when copying don't have write permissions by default. This creates an error that prevents the files from being removed or altered during the process of the shell theme being built.

Fixed this by creating a copy_function for copytree to set write permissions before performing copying or removing. Additionally I've changed it so that the file is removed if it exists before copying.

Fixes #799

Type of change

  • Bugfix (Change which fixes an issue)
  • New feature (Change which adds new functionality)
  • Enhancement (Change which slightly improves existing code)
  • Breaking change (This change will introduce incompatibility with existing functionality)

Testing

  • I have tested my changes and verified that they work as expected

How to test the changes

Build from source, open the application and go to the theming tab, click "apply" next to "Shell Engine Options. You should get a success message.

For those who are using nixos and want to test this, they can use the following package:

environment.systemPackages = [
  (pkgs.gradience.overrideAttrs {
    version = "0.8.0-beta1";
    src = fetchGit {
      url = "https://github.com/computercam/Gradience.git";
      ref = "nixos-gnome-shell-permissions-issues";
      rev = "881c9ed48b43d46b5d8ca7737f7476bd39134bc7";
      submodules = true;
    };
    propagatedBuildInputs = with pkgs.python3Packages; [
      anyascii
      jinja2
      lxml
      material-color-utilities
      pygobject3
      svglib
      yapsy
      libsass
    ];
  })
];

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome on Gradience. 🥳 We really appreciate your contribution. The core team will review your pull request as soon as possible. You can also join the Matrix room: https://matrix.to/#/#Gradience-space:envs.net or the Discord server: https://discord.com/invite/4njFDtfGEZ.

@tfuxu
Copy link
Member

tfuxu commented Aug 16, 2023

Interesting, if true, this PR could also fix issue #721 and other reports from Matrix chat. For now, I'm putting this PR to draft, as I'll be experimenting with other affected modules later.

@tfuxu tfuxu marked this pull request as draft August 16, 2023 14:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: PermissionError when shell themeing on 0.8.0-beta1 nixos
2 participants