From c9160f372b7f02e0e60ef81e7a62c261d7babae8 Mon Sep 17 00:00:00 2001 From: kokkiemouse Date: Sun, 28 Jun 2020 10:44:43 +0900 Subject: [PATCH] 1st --- build.sh | 97 +++++++++++++++++++++++++ channels/share/packages_aur.x86_64/alter.x86_64 | 1 + 2 files changed, 98 insertions(+) create mode 100644 channels/share/packages_aur.x86_64/alter.x86_64 diff --git a/build.sh b/build.sh index e4437d5b..baa67b21 100755 --- a/build.sh +++ b/build.sh @@ -783,7 +783,104 @@ make_packages() { # Install packages on airootfs ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "${pkglist[@]}" install } +make_packages_aur() { + # インストールするパッケージのリストを読み込み、配列pkglistに代入します。 + set +e + local _loadfilelist + local _pkg + local _file + local excludefile + local excludelist + local _pkglist + + #-- Detect package list to load --# + # Add the files for each channel to the list of files to read. + _loadfilelist=( + $(ls "${script_path}"/channels/${channel_name}/packages_aur.${arch}/*.${arch}) + "${script_path}"/channels/${channel_name}/packages_aur.${arch}/lang/${language}.${arch} + $(ls "${script_path}"/channels/share/packages_aur.${arch}/*.${arch}) + "${script_path}"/channels/share/packages_aur.${arch}/lang/${language}.${arch} + ) + + + #-- Read package list --# + # Read the file and remove comments starting with # and add it to the list of packages to install. + for _file in ${_loadfilelist[@]}; do + if [[ -f "${_file}" ]]; then + _msg_debug "Loaded aur package file ${_file}." + pkglist_aur=( ${pkglist_aur[@]} "$(grep -h -v ^'#' ${_file})" ) + fi + done + if [[ ${debug} = true ]]; then + sleep 1 + fi + + # Exclude packages from the share exclusion list + excludefile="${script_path}/channels/share/packages_aur.${arch}/exclude" + if [[ -f "${excludefile}" ]]; then + excludelist=( $(grep -h -v ^'#' "${excludefile}") ) + + # 現在のpkglistをコピーする + _pkglist=(${pkglist_aur[@]}) + unset pkglist_aur + for _pkg in ${_pkglist[@]}; do + # もし変数_pkgの値が配列excludelistに含まれていなかったらpkglistに追加する + if [[ ! $(printf '%s\n' "${excludelist[@]}" | grep -qx "${_pkg}"; echo -n ${?} ) = 0 ]]; then + pkglist_aur=(${pkglist_aur[@]} "${_pkg}") + fi + done + fi + + if [[ -n "${excludelist[@]}" ]]; then + _msg_debug "The following packages have been removed from the installation list." + _msg_debug "Excluded packages: ${excludelist[@]}" + fi + # Exclude packages from the exclusion list for each channel + excludefile="${script_path}/channels/${channel_name}/packages.${arch}/exclude" + if [[ -f "${excludefile}" ]]; then + excludelist=( $(grep -h -v ^'#' "${excludefile}") ) + + # 現在のpkglistをコピーする + _pkglist=(${pkglist_aur[@]}) + unset pkglist_aur + for _pkg in ${_pkglist[@]}; do + # もし変数_pkgの値が配列excludelistに含まれていなかったらpkglistに追加する + if [[ ! $(printf '%s\n' "${excludelist[@]}" | grep -qx "${_pkg}"; echo -n ${?} ) = 0 ]]; then + pkglist_aur=(${pkglist_aur[@]} "${_pkg}") + fi + done + fi + + + # Sort the list of packages in abc order. + pkglist_aur=( + "$( + for _pkg in ${pkglist_aur[@]}; do + echo "${_pkg}" + done \ + | sort + )" + ) + set -e + + # _msg_debug "${pkglist[@]}" + + # Create a list of packages to be finally installed as packages.list directly under the working directory. + echo "# The list of packages that is installed in live cd." > ${work_dir}/packages.list + echo "#" >> ${work_dir}/packages.list + echo >> ${work_dir}/packages.list + for _pkg in ${pkglist_aur[@]}; do + echo ${_pkg} >> ${work_dir}/packages.list + done + + # Install packages on airootfs + ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -D "${install_dir}" -r "mkdir /ippan_temp" + ${mkalteriso} ${mkalteriso_option} -w "${work_dir}/${arch}" -D "${install_dir}" -r "useradd -d /ippan_temp ippan" + + + +} # Customize installation (airootfs) make_customize_airootfs() { # Overwrite airootfs with customize_airootfs. diff --git a/channels/share/packages_aur.x86_64/alter.x86_64 b/channels/share/packages_aur.x86_64/alter.x86_64 new file mode 100644 index 00000000..6c581659 --- /dev/null +++ b/channels/share/packages_aur.x86_64/alter.x86_64 @@ -0,0 +1 @@ +adduser-deb -- 2.11.0