RPi-Distro / raspberrypi-sys-mods

A collection of Raspberry Pi-sourced system configuration files and associated scripts
99 stars 36 forks source link

Create vscode repo dummy/block only when required #60

Closed MichaIng closed 2 years ago

MichaIng commented 2 years ago

Currently on fresh package installs/images the two vscode repo dummy files are created, which is somehow confusing and not required when the repository is not actually installed or has been manually removed.

On a fresh package install, the step is now skipped and each dummy file is created only to overwrite the existing file.

XECDesign commented 2 years ago

Yup, thanks for the nudge. Just confirmed that https://github.com/microsoft/vscode/pull/118826 has made it into all the vscode packages in our repo.

Although I think the logic I would prefer is just to remove the files if upgrading from a previous version and if they don't contain data.

MichaIng commented 2 years ago

Any alternative is fine with me, as long as a fresh image/install of raspberrypi-sys-mods does not create these dummy files where none were before. Cleanest would be probably to remove the files instead of overwriting them with empty redirect/comment. It could then even stay for fresh raspberrypi-sys-mods installs, as it can be seen as indicator that archive.raspberrypi.org installed and hence VSCode available without the MS repo.

XECDesign commented 2 years ago

Just made the change. Does that work for you?

MichaIng commented 2 years ago

@XECDesign I wasn't able to replicate, but one user ran into a permissions error while postinst tried to remove the key: https://github.com/RPi-Distro/raspberrypi-sys-mods/issues/5#issuecomment-1008364698

I downgraded the package, created an empty key file, did the upgrade, and the file was successfully removed. But not sure whether dpkg can fail in case of 4xx modes or so? EDIT: Works fine here as well with 0400 modes 🤔.