message_echo "INFO: No item is registered in this list."
return 1
fi
- grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern" "${DBDIR}/failed.list" 2> /dev/null \
+ env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern" "${DBDIR}/failed.list" 2> /dev/null \
| while read origin
do
- grep -q -Fx "$origin" "${DBDIR}/stage.loop_list/ports_to_delete" 2> /dev/null \
+ env LANG=C grep -q -Fx "$origin" "${DBDIR}/stage.loop_list/ports_to_delete" 2> /dev/null \
|| echo "$origin"
done > $tmp_valid
if [ `cat "$tmp_valid" 2> /dev/null | wc -l` -eq 0 ]
do
note=`cat "${DBDIR}/notes/$origin/note_failtre" 2> /dev/null || :`
resolved=no
- grep -q -Fx "$origin" "${DBDIR}/manually_done.list" 2> /dev/null && resolved=yes
+ env LANG=C grep -q -Fx "$origin" "${DBDIR}/manually_done.list" 2> /dev/null && resolved=yes
pkgtag=`cat "${DBDIR}/moved_from/$origin/pkgtag" 2> /dev/null || :`
if [ $opt_batch_mode = no ]
then
message_echo "INFO: No item is registered in this list."
return 1
fi
- grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" \
+ env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" \
| while read origin pkg
do
pkg_regexp=`str_escape_regexp "$pkg"`
- against=`grep -E "^$pkg_regexp:" "${DBDIR}/forbidden_conflicts" 2> /dev/null | cut -d : -f 2,3 | sort -u`
+ against=`env LANG=C grep -E "^$pkg_regexp:" "${DBDIR}/forbidden_conflicts" 2> /dev/null | cut -d : -f 2,3 | sort -u`
if [ $opt_batch_mode = no ]
then
if [ -n "$pkg" ]
echo "Non-default port options," >> $tmp_msg
is_customized=yes
fi
- if grep -q -Fx "$origin" "${DBDIR}/conf/NOPKG:PORTS.parsed" 2> /dev/null
+ if env LANG=C grep -q -Fx "$origin" "${DBDIR}/conf/NOPKG:PORTS.parsed" 2> /dev/null
then
echo "Explicit specification as non-default in ${APPNAME}.conf," >> $tmp_msg
is_customized=yes
matches_negative=no
for negative_listdb in $flag_negative_listdb
do
- if grep -qFx "$origin" "${DBDIR}/$negative_listdb" 2> /dev/null
+ if env LANG=C grep -qFx "$origin" "${DBDIR}/$negative_listdb" 2> /dev/null
then
matches_negative=yes
break
list=`ls "${DBDIR}"/fossil_pkgs/fossil_since_* | head -n 1`
;;
conflict )
- grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" 2> /dev/null \
- | grep -q -E "^${origin_esc}[[:space:]]"
+ env LANG=C grep -v -E -f "${DBDIR}/ports_to_delete.grep_pattern_col1" "${DBDIR}/deleted_conflicts" 2> /dev/null \
+ | env LANG=C grep -q -E "^${origin_esc}[[:space:]]"
return
;;
taboo )
list=stage.loop_list/ports_to_delete
;;
esac
- grep -q -Fx "$origin" "${DBDIR}/$list" 2> /dev/null
+ env LANG=C grep -q -Fx "$origin" "${DBDIR}/$list" 2> /dev/null
}
# ============= Check whether the requirements of installed packages match the port configuration =============
pkg=`database_build_get_new_pkgname "$origin"`
[ -n "$pkg" ] || return
pkg_info_e "$pkg" || return
- pkg_info_qr "$pkg" | grep -v '^[[:space:]]*$' | sort -u > $tmp_inst
+ pkg_info_qr "$pkg" | env LANG=C grep -v '^[[:space:]]*$' | sort -u > $tmp_inst
database_build_get_full_run_requirement_pkgs "$origin" > $tmp_db
diff "$tmp_inst" "$tmp_db" > /dev/null 2>/dev/null
}
cat "${DBDIR}/requires/$origin/requirements.all.direct" 2> /dev/null | while read origin_requirement
do
pkg_requirement=`pkgsys_get_installed_pkg_from_origin "$origin_requirement"` || :
- if grep -q -Fx "$origin_requirement" "${DBDIR}/freeze.all.list" 2> /dev/null
+ if env LANG=C grep -q -Fx "$origin_requirement" "${DBDIR}/freeze.all.list" 2> /dev/null
then
[ -n "$pkg_requirement" ] || return
elif [ -z "$pkg_requirement" ]
fi
:
}
+
+# ============= Get an unflavored or flavored equivalence of an origin with the same package name, which is deemed the same version =============
+# If the input is unflavored and a flavored equivalence is inspected as a required port, the flavored origin is returned.
+# If the input is flavored and an unflavored equivalence is inspected as a required port, the unflavored origin is returned.
+# Otherwise, a blank value is returned.
+database_query_get_equivalent_orgin ()
+{
+ local origin origin_esc pkg_origin pkg_origin_esc flavor origin_unflavored_esc origin_search
+ origin=$1
+ origin_esc=`str_escape_regexp "$origin"`
+ pkg_origin=`env LANG=C grep -E "[[:space:]]$origin_esc$" "${DBDIR}/installed_ports:pkg_vs_origin.tbl" | cut -f 2 || :`
+ [ -n "$pkg_origin" ] || return 0
+ pkg_origin_esc=`str_escape_regexp "$pkg_origin"`
+ flavor=`pkgsys_get_flavor_from_origin "$origin"`
+ origin_search=$origin_unflavored_esc$
+ [ -n "$flavor" ] || origin_search=$origin_esc@
+ env LANG=C grep -E "^$pkg_origin_esc[[:space:]]$origin_search" "${DBDIR}/installed_ports:pkg_vs_origin.tbl" | cut -f 2 | head -n 1 || :
+}