headmelted / codebuilds

Community builds of Visual Studio Code for Chromebooks and Raspberry Pi
https://code.headmelted.com
MIT License
1.03k stars 56 forks source link

Dynamic dependency install, better GPG key install, and other minor stuff #93

Open pfeerick opened 4 years ago

pfeerick commented 4 years ago

Per the discussion that was happening in https://github.com/headmelted/codebuilds/issues/92, I've put my :moneybag: where my :open_mouth: is and done a PR :wink:

This PR introduces:

If adopted, this PR Resolves #92; Resolves #76; Resolves #71; Resolves #63.

Note: These changes are completely untested at this point in time (but have passed shellcheck testing), so aren't in a fit state to merge right of this second. I don't expect any breakage, but expectation and reality often don't see eye to eye ;) Testing will happen within the next few days.

I would like to make some other minor changes, but they are style changes so need discussion first. Shell scripts don't need trailing ; at the end of commands, so I would like to remove them where not required which. Also, I want to change to tab indentation, rather than whitespace indentation.

Key reasoning for both changes is to the make the script fractionally smaller, improve consistency, and reduce chance of confusion later down the path.

headmelted commented 4 years ago

Writing this on phone at the minute but will be in front of laptop later today though and hopefully get this merged then. Thanks for taking the time to put this together!

pfeerick commented 4 years ago

Sorry for the delay... next few days become a week! :-O Latest changes are mostly cosmetic, no errrors were introduced, or any further functional changes made. @headmelted Is there a pre or post-install script included in the deb file? I'm trying to pin down the cause of the (failing) mid-install attempt to install the GPG key, and refresh the apt-cache, as that should not be happening during the install process. When you look at the output below, the steps between Setting up code-oss and Processing triggers for mime-support (3.62) should not be happening, but I can't pin down exactly how the .deb package is constructed.

Otherwise, this is working quite well now. Tested against fresh unconfigured installs of Raspbian Strech and Buster, on a Raspberry Pi 3B+.

pi@raspberrypi:~ $ wget -q -O - https://raw.githubusercontent.com/pfeerick/codebuilds/dependencies/docs/installers/apt.sh | sudo bash
Architecture detected as armv7l...
Updating APT cache...
Update complete.
Installing dependencies:  apt-transport-https ca-certificates
Retrieving GPG key [headmelted] (https://packagecloud.io/headmelted/codebuilds/gpgkey)...
OK
Removing any previous entry to headmelted repository
Installing [headmelted] repository...
Refreshing APT cache again...
Repository install complete.
Installing Visual Studio Code from [stretch]...
Selecting previously unselected package code-oss.
(Reading database ... 93828 files and directories currently installed.)
Preparing to unpack .../code-oss_1.42.0-1575969827_armhf.deb ...
Unpacking code-oss (1.42.0-1575969827) ...
Setting up code-oss (1.42.0-1575969827) ...
Retrieving GPG key [headmelted] (https://packagecloud.io/headmelted/codebuilds/gpgkey)...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
gpg: no valid OpenPGP data found.
Removing any previous entry to headmelted repository
Installing [headmelted] repository...
Updating APT cache...
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Hit:3 https://packagecloud.io/headmelted/codebuilds/debian stretch InRelease
Reading package lists...
Done!
Processing triggers for mime-support (3.62) ...
Processing triggers for gnome-menus (3.31.4-3) ...
Processing triggers for desktop-file-utils (0.23-4) ...
Visual Studio Code install complete.
Installing any dependencies that may have been missed...
Missed dependency install complete.

Installation complete!

You can start code at any time by calling "code-oss" within a terminal.

A shortcut should also now be available in your desktop menus (depending on your distribution).

pi@raspberrypi:~ $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"