OSDN Git Service

1st
authorkokkiemouse <kokkiemouse@gmail.com>
Sun, 28 Jun 2020 01:44:43 +0000 (10:44 +0900)
committerkokkiemouse <kokkiemouse@gmail.com>
Sun, 28 Jun 2020 01:44:43 +0000 (10:44 +0900)
build.sh
channels/share/packages_aur.x86_64/alter.x86_64 [new file with mode: 0644]

index e4437d5..baa67b2 100755 (executable)
--- 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 (file)
index 0000000..6c58165
--- /dev/null
@@ -0,0 +1 @@
+adduser-deb