A bug is caused by the previous modification is fixed.
modified: bin/portsreinstall
modified: lib/libdatabase_build.sh
modified: lib/libdatabase_query.sh
# MYVERSION=3.1.0
# COMPATIBLE_VERSIONS='^(3\.1\.[0-9]+)$'
# Template for development versions
-MYVERSION=3.0.5+toward_3.1.0_20140804144650
+MYVERSION=3.0.5+toward_3.1.0_20140804161950
COMPATIBLE_VERSIONS='^(3\.0\.[0-9]+\+toward_3\.1\.[0-9]+_[0-9]+|3\.0\.[0-9]+\+toward_3\.0\.[0-9]+_[0-9]+|3\.1\.[0-9]+)$'
MYPREFIX=`dirname "\`dirname \"$0\"\`" | sed 's|/bin$||'`
MYPREFIX=${MYPREFIX:-/usr/local}
savefile=${DBDIR}/requires/$origin/current_version
origin_orig=`echo "$origin" \
| sed -E -f "${DBDIR}/REVERSE_REPLACE.complete_sed_pattern"` || :
+ [ "x$origin_orig" = "x$origin" ] && origin_orig=
echo "$origin_orig" "$origin" | tr ' ' '\n' | grep -v '^$' | while read orig
do
pkg=`pkg_info_qO "$orig" || :`
orig_init=`cat "${DBDIR}/requires/$orig/initial_orig"`
pkg=`pkg_info_qO "$orig_init" || :`
fi
- echo -n "$pkg"
+ echo "$pkg"
done > $savefile
cat "$savefile"
}
{
local origin pkg_cur pkg_new
origin=$1
- pkg_cur=`database_build_get_pkgname "$origin"`
+ pkg_cur=`database_build_get_pkgname "$origin" | tr '\n' ' ' | sed 's/ *$//'`
pkg_new=`database_build_get_new_pkgname "$origin"`
[ "x$pkg_cur" = "x$pkg_new" ]
}
# ============= Check whether a port needs to be updated or upgraded =============
database_query_does_a_port_need_update ()
{
- local origin dbpath
+ local origin dbpath new_version current_version
origin=$1
dbpath=${DBDIR}/requires/$origin
[ -e "$dbpath/conf_updated" ] && return
[ -e "$dbpath/new_version" ] || return
- ! diff "$dbpath/new_version" "$dbpath/current_version" > /dev/null 2>&1
+ new_version=`cat "$dbpath/new_version"`
+ current_version=`cat "$dbpath/new_version"`
+ [ "x$current_version" != "x$new_version" ]
}
# ============= Check before operations of a command which need the temporary database completely prepared =============