[Antergos and Manjaro support] [Download latest detect_linux.sh if bundled script returns unknown] [Display error message if OS is detected as unknown]

This commit is contained in:
2019-07-28 21:12:40 -05:00
parent ba14f36d32
commit f996bb4a74
7 changed files with 67 additions and 21 deletions

View File

@@ -1,4 +1,12 @@
# Changelog # # Changelog #
## 1.0.6 ##
* Additional Linux distribution support:
* Antergos
* Manjaro
* Download latest `detect_linux.sh` if bundled script returns `unknown`
* Display error message if OS is detected as `unknown`
## 1.0.5 ## ## 1.0.5 ##
* \#29: Mounts aren't being detected properly when switching releases * \#29: Mounts aren't being detected properly when switching releases
* Display window when dependencies are missing * Display window when dependencies are missing

View File

@@ -9,15 +9,17 @@ Repertory allows you to mount Sia and/or SiaPrime blockchain storage solutions v
* SiaPrime >=1.4.0 * SiaPrime >=1.4.0
## Downloads ## ## Downloads ##
* **Repertory UI v1.0.5 Linux 64-bit** [<Primary\>](https://pixeldrain.com/u/ZqKqdZq7) [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.5_linux_x86_64.AppImage) * **Repertory UI v1.0.6 Linux 64-bit** [<Primary\>]() [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.6_linux_x86_64.AppImage)
* NOTE: Linux distributions require `fuse` and `libfuse` to be installed. * NOTE: Linux distributions require `fuse` and `libfuse` to be installed.
* **Repertory UI v1.0.5 OS X 64-bit** [<Primary\>](https://pixeldrain.com/u/h5vrCdcf) [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.5_mac.dmg) * **Repertory UI v1.0.6 OS X 64-bit** [<Primary\>]() [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.6_mac.dmg)
* **Repertory UI v1.0.5 Windows 64-bit** [<Primary\>](https://pixeldrain.com/u/q0yXuEPl) [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.5_win.exe) * **Repertory UI v1.0.6 Windows 64-bit** [<Primary\>]() [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.6_win.exe)
## Supported Platforms ## ## Supported Platforms ##
* OS X 64-bit * OS X 64-bit
* Windows 64-bit * Windows 64-bit
* Linux 64-bit Distributions: * Linux 64-bit Distributions:
* Antergos
* Uses `Ubuntu 18.10` binaries for compatibility
* Arch Linux * Arch Linux
* Bodhi 5.0.0 * Bodhi 5.0.0
* CentOS 7 * CentOS 7
@@ -29,6 +31,8 @@ Repertory allows you to mount Sia and/or SiaPrime blockchain storage solutions v
* Fedora 30 * Fedora 30
* Linux Mint 19 * Linux Mint 19
* Linux Mint 19.1 * Linux Mint 19.1
* Manjaro
* Uses `Ubuntu 18.10` binaries for compatibility
* OpenSUSE Leap 15.0 * OpenSUSE Leap 15.0
* OpenSUSE Leap 15.1 * OpenSUSE Leap 15.1
* OpenSUSE Tumbleweed * OpenSUSE Tumbleweed

View File

@@ -67,6 +67,9 @@ elif [ -f /etc/os-release ]; then
. /etc/os-release . /etc/os-release
if [ "$ID" == "arch" ]; then if [ "$ID" == "arch" ]; then
DISTNAME=arch DISTNAME=arch
elif [ "$ID" == "antergos" ] || [ "$ID" == "manjaro" ]; then
DISTNAME=ubuntu
DISTVER=18.10
elif [ "$ID" == "opensuse-leap" ]; then elif [ "$ID" == "opensuse-leap" ]; then
if [ "$VERSION_ID" == "15.0" ]; then if [ "$VERSION_ID" == "15.0" ]; then
DISTNAME=opensuse DISTNAME=opensuse

View File

@@ -650,29 +650,48 @@ ipcMain.on(Constants.IPC_Get_Config_Template, (event, data) => {
}); });
ipcMain.on(Constants.IPC_Get_Platform, (event) => { ipcMain.on(Constants.IPC_Get_Platform, (event) => {
const sendResponse = (appPlatform, platform) => {
event.sender.send(Constants.IPC_Get_Platform_Reply, {
AppPlatform: appPlatform,
Platform: platform,
});
};
const platform = os.platform(); const platform = os.platform();
if (platform === 'linux') { if (platform === 'linux') {
const scriptFile = path.join(os.tmpdir(), 'repertory_detect_linux.sh'); const scriptFile = path.join(os.tmpdir(), 'repertory_detect_linux.sh');
fs.writeFileSync(scriptFile, detectScript); fs.writeFileSync(scriptFile, detectScript);
helpers helpers
.executeScript(scriptFile) .executeScript(scriptFile)
.then(data => { .then(data => {
event.sender.send(Constants.IPC_Get_Platform_Reply, { let appPlatform = data.replace(/(\r\n|\n|\r)/gm,"");
AppPlatform: data.replace(/(\r\n|\n|\r)/gm,""), if (appPlatform === 'unknown') {
Platform: platform, helpers
}); .downloadFile(Constants.LINUX_DETECT_SCRIPT_URL, scriptFile, null, err => {
if (err) {
sendResponse(appPlatform, platform);
} else {
helpers
.executeScript(scriptFile)
.then(data => {
appPlatform = data.replace(/(\r\n|\n|\r)/gm, "");
sendResponse(appPlatform, platform);
}) })
.catch(() => { .catch(() => {
event.sender.send(Constants.IPC_Get_Platform_Reply, { sendResponse(appPlatform, platform);
AppPlatform: platform,
Platform: platform,
}); });
}
}); });
} else { } else {
event.sender.send(Constants.IPC_Get_Platform_Reply, { sendResponse(appPlatform, platform);
AppPlatform: platform, }
Platform: platform, })
.catch(() => {
sendResponse(platform, platform);
}); });
} else {
sendResponse(platform, platform);
} }
}); });

View File

@@ -2,6 +2,7 @@ import React from 'react';
import './App.css'; import './App.css';
import Box from './components/UI/Box/Box'; import Box from './components/UI/Box/Box';
import Configuration from './containers/Configuration/Configuration'; import Configuration from './containers/Configuration/Configuration';
import {checkVersionInstalled} from './redux/actions/install_actions';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import DependencyList from './components/DependencyList/DependencyList'; import DependencyList from './components/DependencyList/DependencyList';
import DownloadProgress from './components/DownloadProgress/DownloadProgress'; import DownloadProgress from './components/DownloadProgress/DownloadProgress';
@@ -11,16 +12,16 @@ import IPCContainer from './containers/IPCContainer/IPCContainer';
import Loading from './components/UI/Loading/Loading'; import Loading from './components/UI/Loading/Loading';
import Modal from './components/UI/Modal/Modal'; import Modal from './components/UI/Modal/Modal';
import MountItems from './containers/MountItems/MountItems'; import MountItems from './containers/MountItems/MountItems';
import {notifyError} from './redux/actions/error_actions';
import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay'; import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay';
import {saveState} from './redux/actions/common_actions';
import Text from './components/UI/Text/Text'; import Text from './components/UI/Text/Text';
import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon'; import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon';
import UpgradeUI from './components/UpgradeUI/UpgradeUI'; import UpgradeUI from './components/UpgradeUI/UpgradeUI';
import {checkVersionInstalled} from './redux/actions/install_actions';
import { import {
loadReleases, loadReleases,
setDismissUIUpgrade setDismissUIUpgrade
} from './redux/actions/release_version_actions'; } from './redux/actions/release_version_actions';
import {saveState} from './redux/actions/common_actions';
const Constants = require('./constants'); const Constants = require('./constants');
const Scheduler = require('node-schedule'); const Scheduler = require('node-schedule');
@@ -28,7 +29,9 @@ const Scheduler = require('node-schedule');
class App extends IPCContainer { class App extends IPCContainer {
componentDidMount() { componentDidMount() {
const detectUpgrades = () => { const detectUpgrades = () => {
if (this.props.AppPlatform !== 'unknown') { if (this.props.AppPlatform === 'unknown') {
this.props.notifyError('Operation system is not supported.', true);
} else {
this.props.loadReleases(); this.props.loadReleases();
} }
}; };
@@ -199,6 +202,7 @@ const mapDispatchToProps = dispatch => {
return { return {
checkVersionInstalled: () => dispatch(checkVersionInstalled()), checkVersionInstalled: () => dispatch(checkVersionInstalled()),
loadReleases: ()=> dispatch(loadReleases()), loadReleases: ()=> dispatch(loadReleases()),
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
saveState: () => dispatch(saveState()), saveState: () => dispatch(saveState()),
setDismissUIUpgrade: dismiss => dispatch(setDismissUIUpgrade(dismiss)), setDismissUIUpgrade: dismiss => dispatch(setDismissUIUpgrade(dismiss)),
}; };

View File

@@ -27,8 +27,14 @@ exports.DEV_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----\n' +
'9wIDAQAB\n' + '9wIDAQAB\n' +
'-----END PUBLIC KEY-----'; '-----END PUBLIC KEY-----';
exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/1.0.0-release_branch/releases.json';
exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/1.0.6_branch/releases.json'; const REPERTORY_BRANCH = '1.0.1-release_branch';
const REPERTORY_UI_BRANCH = '1.0.6_branch';
exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/' + REPERTORY_BRANCH + '/releases.json';
exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/' + REPERTORY_UI_BRANCH + '/releases.json';
exports.LINUX_DETECT_SCRIPT_URL = 'https://bitbucket.org/blockstorage/repertory/raw/' + REPERTORY_BRANCH + '/detect_linux.sh';
exports.DATA_LOCATIONS = { exports.DATA_LOCATIONS = {
linux: '~/.local/repertory/ui', linux: '~/.local/repertory/ui',

View File

@@ -140,7 +140,9 @@ module.exports.downloadFile = (url, destination, progressCallback, completeCallb
response.data.on('data', (chunk) => { response.data.on('data', (chunk) => {
stream.write(Buffer.from(chunk)); stream.write(Buffer.from(chunk));
downloaded += chunk.length; downloaded += chunk.length;
if (progressCallback) {
progressCallback((downloaded / total * 100.0).toFixed(2)); progressCallback((downloaded / total * 100.0).toFixed(2));
}
}); });
response.data.on('end', () => { response.data.on('end', () => {