echo
echo " Channel:"
- for _dirname in $(bash "${tools_dir}/channel.sh" -d -b -n show); do
+ for _dirname in $(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -d -b -n show); do
echo -ne " ${_dirname%.add}"
echo_blank "$(( ${blank} - 3 - $(echo ${_dirname%.add} | wc -m) ))"
- "${tools_dir}/channel.sh" --nocheck desc "${_dirname%.add}"
+ "${tools_dir}/channel.sh" --version "${alteriso_version}" --nocheck desc "${_dirname%.add}"
done
echo
check_bool boot_splash cleaning noconfirm nodepend shmkalteriso customized_username customized_password noloopmod nochname tarball noiso noaur customized_syslinux norescue_entry debug bash_debug nocolor msgdebug noefi include_extra nosigcheck
# Check architecture for each channel
- if [[ ! "$(bash "${tools_dir}/channel.sh" -a ${arch} -n -b check "${channel_name}")" = "correct" ]]; then
+ if [[ ! "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -a ${arch} -n -b check "${channel_name}")" = "correct" ]]; then
msg_error "${channel_name} channel does not support current architecture (${arch})." "1"
fi
# Check for a valid channel name
if [[ -n "${1+SET}" ]]; then
- case "$(bash "${tools_dir}/channel.sh" -n check "${1}")" in
+ case "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" -n check "${1}")" in
"incorrect")
msg_error "Invalid channel ${1}" "1"
;;
# Check channel version
msg_debug "channel path is ${channel_dir}"
-if [[ ! "$(cat "${channel_dir}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${nochkver}" = false ]]; then
+if [[ "$(bash "${tools_dir}/channel.sh" --version "${alteriso_version}" ver "${channel_name}" | cut -d "." -f 1)" = "$(echo "${alteriso_version}" | cut -d "." -f 1)" ]] && [[ "${nochkver}" = false ]]; then
msg_error "This channel does not support Alter ISO 3."
if [[ -d "${script_path}/.git" ]]; then
msg_error "Please run \"git checkout alteriso-2\"" "1"
else
- msg_error "Please download Alter ISO 2 here.\nhttps://github.com/FascodeNet/alterlinux/archive/alteriso-2.zip" "1"
+ msg_error "Please download old version here.\nhttps://github.com/FascodeNet/alterlinux/releases" "1"
fi
fi
opt_nobuiltin=false
opt_fullpath=false
opt_nocheck=false
-alteriso_version="3.0"
+alteriso_version="3.1"
mode=""
arch="all"
kernel="all"
echo " check [name] Returns whether the specified channel name is valid."
echo " desc [name] Display a description of the specified channel"
echo " show Display a list of channels"
+ echo " ver Display a version declared on the channel"
echo " help This help message"
echo
echo " General options:"
gen_channel_list() {
local _dirname
for _dirname in $(ls -l "${script_path}"/channels/ | awk '$1 ~ /d/ {print $9}'); do
- if [[ -n $(ls "${script_path}"/channels/${_dirname}) ]] && [[ "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] || [[ "${opt_nochkver}" = true ]]; then
+ if [[ -n $(ls "${script_path}"/channels/${_dirname}) ]] && check_alteriso_version "${_dirname}/" || [[ "${opt_nochkver}" = true ]]; then
if [[ ! "${arch}" = "all" ]] && [[ -z "$(cat "${script_path}/channels/${_dirname}/architecture" 2> /dev/null | grep -h -v ^'#' | grep -x "${arch}")" ]] || [[ "${_dirname}" = "share" ]] || [[ "${_dirname}" = "share-extra" ]]; then
continue
elif [[ ! "${kernel}" = "all" ]] && [[ -f "${channel_dir}/kernel_list-${arch}" ]] && [[ -z $( ( cat "${script_path}/channels/${_dirname}/kernel_list-${arch}" | grep -h -v ^'#' | grep -x "${kernel}" ) 2> /dev/null) ]]; then
}
# check?alteriso_version <channel dir>
-check_alteriso_version(){
+get_alteriso_version(){
local _channel
if [[ ! -d "${script_path}/channels/${1}" ]]; then
_channel="${script_path}/channels/${1}.add"
fi
}
+check_alteriso_version(){
+ #if [[ "$(get_alteriso_version "${1%.add}")" = "${alteriso_version}" ]]; then
+ if [[ "$(get_alteriso_version "${1%.add}" | cut -d "." -f 1)" = "$(echo "${alteriso_version}" | cut -d "." -f 1)" ]]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
check() {
gen_channel_list
if [[ ! "${#}" = "1" ]]; then
echo "correct"
elif [[ -d "${1}" ]] && [[ -n $(ls "${1}") ]] && [[ ! "$(basename "${1%/}")" = "share" ]] && [[ ! "$(basename "${1%/}")" = "share-extra" ]]; then
local _channel_name="$(basename "${1%/}")"
- if [[ "$(cat "${script_path}/channels/${_dirname}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] || [[ "${opt_nochkver}" = true ]]; then
+ if ! check_alteriso_version "${_channel}" || [[ "${opt_nochkver}" = true ]]; then
echo "directory"
else
echo "incorrect"
else
_channel="${1}"
fi
- if [[ ! "$(cat "${script_path}/channels/${_channel}/alteriso" 2> /dev/null)" = "alteriso=${alteriso_version}" ]] && [[ "${opt_nochkver}" = false ]]; then
+ if ! check_alteriso_version "${_channel}" && [[ "${opt_nochkver}" = false ]]; then
"${script_path}/tools/msg.sh" --noadjust -l 'ERROR:' --noappname error "Not compatible with AlterISO3"
elif [[ -f "${script_path}/channels/${_channel}/description.txt" ]]; then
echo -ne "$(cat "${script_path}/channels/${_channel}/description.txt")\n"
"check" ) check ${@} ;;
"show" ) show ;;
"desc" ) desc ${@} ;;
- "ver" ) check_alteriso_version ${@} ;;
+ "ver" ) get_alteriso_version ${@} ;;
"help" ) _help; exit 0 ;;
* ) _help; exit 1 ;;
esac