Commit 21506f49 authored by Luca Giambonini's avatar Luca Giambonini

if order file exist then execute the parsing

parent 5a3337f0
...@@ -131,20 +131,22 @@ function list_packages() { ...@@ -131,20 +131,22 @@ function list_packages() {
# check if there are some .order file # check if there are some .order file
_list_changes _orders '*.order' '%' --no-commit-id --pretty=format: --name-only -r --diff-filter=AM || return 1 _list_changes _orders '*.order' '%' --no-commit-id --pretty=format: --name-only -r --diff-filter=AM || return 1
_log message ".order file detected, processing..." if [ -n "$_orders" ]; then
PACKAGES=() _log message ".order file detected, processing..."
ORDERLIST_AVAILABLE=true PACKAGES=()
for _order in "${_orders[@]}"; do ORDERLIST_AVAILABLE=true
exec 3<$_order for _order in "${_orders[@]}"; do
while read -u3 _line; do exec 3<$_order
[[ $_line =~ ^[:blank:]*$ ]] && continue while read -u3 _line; do
[[ $_line =~ ^[:blank:]*$ ]] && continue
local comment_re="^[:blank:]*#"
[[ $_line =~ $comment_re ]] && continue local comment_re="^[:blank:]*#"
[[ $_line =~ $comment_re ]] && continue
PACKAGES+=("${_line}")
PACKAGES+=("${_line}")
done
done done
done fi
# remove duplicates without changing the order # remove duplicates without changing the order
# (http://www.unixcl.com/2008/03/remove-duplicates-without-sorting-file.html) # (http://www.unixcl.com/2008/03/remove-duplicates-without-sorting-file.html)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment