Skip to content

Commit

Permalink
Merge branch 'dev' into dev-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayao0819 committed May 22, 2021
2 parents 516a28a + 4d70c44 commit be87a52
Show file tree
Hide file tree
Showing 25 changed files with 177 additions and 274 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/codescan-analysis.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: ShellCheck CL

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
pull_request:
branches: [ dev ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error
env:
SHELLCHECK_OPTS: --shell=bash
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ alteriso_version="3.1"
# Load config file
[[ ! -f "${defaultconfig}" ]] && "${tools_dir}/msg.sh" -a 'build.sh' error "${defaultconfig} was not found." && exit 1
for config in "${defaultconfig}" "${script_path}/custom.conf"; do
[[ -f "${script_path}/${config}.conf" ]] && source "${script_path}/${config}.conf"
[[ -f "${config}" ]] && source "${config}"
done

umask 0022
Expand Down Expand Up @@ -424,7 +424,7 @@ prepare_build() {
local module_check
module_check(){
msg_debug "Checking ${1} module ..."
! bash "${tools_dir}/module.sh" check "${1}" && msg_error "Module ${1} is not available." "1";
bash "${tools_dir}/module.sh" check "${1}" || msg_error "Module ${1} is not available." "1";
}
modules=($(printf "%s\n" "${modules[@]}" | awk '!a[$0]++'))
for_module "module_check {}"
Expand Down Expand Up @@ -600,10 +600,10 @@ make_pkgbuild() {
# Customize installation (airootfs)
make_customize_airootfs() {
# Overwrite airootfs with customize_airootfs.
local _airootfs _airootfs_script_options _script _script_list _airootfs_list _main_script
local _airootfs _airootfs_script_options _script _script_list _airootfs_list=() _main_script

_airootfs_list=("${channel_dir}/airootfs.any" "${channel_dir}/airootfs.${arch}")
for_module '_airootfs_list=("${_airootfs_list[@]}" "${module_dir}/{}/airootfs.any" "${module_dir}/{}/airootfs.${arch}")'
for_module '_airootfs_list+=("${module_dir}/{}/airootfs.any" "${module_dir}/{}/airootfs.${arch}")'
_airootfs_list+=("${channel_dir}/airootfs.any" "${channel_dir}/airootfs.${arch}")

for _airootfs in "${_airootfs_list[@]}";do
if [[ -d "${_airootfs}" ]]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Seat:*]
autologin-session=cinnamon2d
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Seat:*]
autologin-session=i3
4 changes: 2 additions & 2 deletions channels/i3/airootfs.any/etc/skel/.config/rofi/power.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare -A menu_list=(

function main() {
local -r IFS=$'\n'
[[ $# -ne 0 ]] && eval "${menu_list[$1]}" || echo "${!menu_list[*]}"
[[ "${#}" -ne 0 ]] && eval "${menu_list[$1]}" || echo "${!menu_list[*]}"
}

main $@
main "${@}"
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sed -i "s|%USERNAME%|${username}|g" "/etc/lightdm/lightdm.conf.d/02-autologin.co


# Session list
if cat "/etc/lightdm/lightdm.conf.d/02-autologin-session.conf" | grep "%SESSION%" 1> /dev/null 2>&1; then
if [[ -f "/etc/lightdm/lightdm.conf.d/02-autologin-session.conf" ]] && cat "/etc/lightdm/lightdm.conf.d/02-autologin-session.conf" | grep "%SESSION%" 1> /dev/null 2>&1; then
session_list=()
while read -r session; do
session_list+=("${session}")
Expand All @@ -32,6 +32,10 @@ if cat "/etc/lightdm/lightdm.conf.d/02-autologin-session.conf" | grep "%SESSION%
elif (( "${#session_list[@]}" == 0)); then
echo "Warining: Auto login session was not found"
else
remove "/etc/lightdm/lightdm.conf.d/02-autologin-session.conf"
echo "Failed to set the session.Multiple sessions were found." >&2
echo "Please set the session of automatic login in /etc/lightdm/lightdm.conf.d/02-autologin-session.conf"
echo "Found session: $(printf "%s " "${session_list[@]}")"
sleep 0.5
exit 1
fi
fi
2 changes: 1 addition & 1 deletion system/aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
set -e -u

aur_username="aurbuild"
pacman_debug=true
pacman_debug=false
pacman_args=()

trap 'exit 1' 1 2 3 15
Expand Down
8 changes: 4 additions & 4 deletions system/pkgbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
set -e

build_username="pkgbuild"
pacman_debug=true
pacman_debug=false
pacman_args=()

_help() {
Expand Down Expand Up @@ -66,7 +66,7 @@ function user_check () {

# 一般ユーザーで実行します
function run_user () {
sudo -u "${build_username}" ${@}
sudo -u "${build_username}" "${@}"
}

# 引数を確認
Expand Down Expand Up @@ -106,12 +106,12 @@ pacman -Syy "${pacman_args[@]}"
cd "${pkgbuild_dir}"
pkgbuild_dirs=($(ls "${pkgbuild_dir}" 2> /dev/null))
if (( "${#pkgbuild_dirs[@]}" != 0 )); then
for _dir in ${pkgbuild_dirs[@]}; do
for _dir in "${pkgbuild_dirs[@]}"; do
cd "${_dir}"
depends=($(source "${pkgbuild_dir}/${_dir}/PKGBUILD"; echo "${depends[@]}"))
makedepends=($(source "${pkgbuild_dir}/${_dir}/PKGBUILD"; echo "${makedepends[@]}"))
if (( ${#depends[@]} + ${#makedepends[@]} != 0 )); then
for _pkg in ${depends[@]} ${makedepends[@]}; do
for _pkg in "${depends[@]}" "${makedepends[@]}"; do
if pacman -Ssq "${_pkg}" | grep -x "${_pkg}" 1> /dev/null; then
pacman -S --asdeps --needed "${pacman_args[@]}" "${_pkg}"
fi
Expand Down
14 changes: 13 additions & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Alter Linuxのビルドに使用する処理をコマンド化したものです
全てのチャンネルのパッケージの一覧を表示します。
`channel.sh`でチャンネルの一覧を取得後、`pkglist.sh`でパッケージ一覧を取得します。

## alteriso-info.sh
ビルド情報を書いたテキストファイルを出力します。詳細は`alteiso-info.sh`を実行してください。

## build_helper.py
GUIのビルドヘルパーです。PyGobjectが必要です。

Expand Down Expand Up @@ -43,6 +46,10 @@ menuconfigで使用されるスクリプトです。
## menuconf-to-alterconf.sh
menuconfigで使用されるスクリプトです。

## module.sh
使用可能なモジュールの一覧や確認を行います。
詳細は`module.sh -h`を実行してください。

## msg.sh
ラベルと色がついたメッセージを出力します。このスクリプトは様々な場所から呼び出されます。
詳細は`msg.sh -h`を実行してください。
Expand All @@ -52,14 +59,19 @@ menuconfigで使用されるスクリプトです。
`build.sh`の依存関係チェックに使用されています。
詳細は`package.py -h`を実行してください。

## pkglist.py
## pkglist.sh
指定されたチャンネルのパッケージ一覧を取得します。
詳細は`pkglist.sh`を実行してください。

## testpkg.sh
`allpkglist.sh`で全てのパッケージ一覧を取得後、そのパッケージが公式リポジトリから利用可能かどうかを調べます。
詳細は`testpkg.sh`を実行してください。

## umount.sh
指定されたディレクトリ以下のマウントポイントを検索してアンマウントします。
`build.sh``clean.sh`から呼び出されます。
詳細は`umount.sh`を実行してください。

## wizard.sh
CLIの対話型のビルド設定ツールです。英語と日本語に対応しています。
依存パッケージの自動インストールやキーリングの自動インストールを行います。
Expand Down
12 changes: 6 additions & 6 deletions tools/allpkglist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

load_config() {
local _file
for _file in ${@}; do
for _file in "${@}"; do
if [[ -f "${_file}" ]]; then
source "${_file}"
fi
Expand Down Expand Up @@ -79,7 +79,7 @@ fi

load_config() {
local _file
for _file in ${@}; do
for _file in "${@}"; do
if [[ -f "${_file}" ]]; then
source "${_file}"
fi
Expand All @@ -88,12 +88,12 @@ load_config() {

for_module(){
local module
for module in ${modules[@]}; do
eval $(echo ${@} | sed "s|{}|${module}|g")
for module in "${modules[@]}"; do
eval $(echo "${@}" | sed "s|{}|${module}|g")
done
}

for arch in ${archs[@]}; do
for arch in "${archs[@]}"; do
for channel in $("${tools_dir}/channel.sh" show -a "${arch}" -b -d -k zen -f); do
modules=($(
load_config "${script_path}/default.conf" "${script_path}/custom.conf"
Expand All @@ -105,7 +105,7 @@ for arch in ${archs[@]}; do
modules=("share")
fi
fi
for module in ${modules[@]}; do
for module in "${modules[@]}"; do
dependent="${module_dir}/${module}/dependent"
if [[ -f "${dependent}" ]]; then
modules+=($(grep -h -v ^'#' "${dependent}" | tr -d "\n" ))
Expand Down
2 changes: 1 addition & 1 deletion tools/alteriso-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ variable_list=(
"iso_version"
)

for var in ${variable_list[@]}; do
for var in "${variable_list[@]}"; do
if [[ -z "$(eval echo '$'${var})" ]]; then
echo "${var} is empty" >&2
exit 1
Expand Down
6 changes: 3 additions & 3 deletions tools/channel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ else
fi

case "${mode}" in
"check" ) check ${@} ;;
"check" ) check "${@}" ;;
"show" ) show ;;
"desc" ) desc ${@} ;;
"ver" ) get_alteriso_version ${@} ;;
"desc" ) desc "${@}" ;;
"ver" ) get_alteriso_version "${@}" ;;
"help" ) _help; exit 0 ;;
* ) _help; exit 1 ;;
esac
Loading

0 comments on commit be87a52

Please sign in to comment.