autodist-upstream-updates: added -u option to only output packages that are not up-to-date

This commit is contained in:
Silvan Calarco 2012-12-01 23:31:16 +01:00
parent 0168057f06
commit 4b8773011b
3 changed files with 31 additions and 31 deletions

View File

@ -41,7 +41,8 @@ function usage()
echo "openmamba-upstream-updates [-h|-m][-r repository][-o output_repository]"
echo
echo " -h: generate distromatic HTML output"
echo " -m: show missing packages only"
echo " -m: report missing packages only"
echo " -u: output not up-to-date packages only"
echo " -q: produces quite output"
echo " -r repository: specify the repository (default: devel)"
echo " -o repository: specify the repository for output data (default: same as base repository)"
@ -132,8 +133,9 @@ while [ "$1" ]; do
usage
exit 1
else
missing_only=1
missing_only=1
fi ;;
-u) needupdate_only=1 ;;
-r) [ "$2" ] || {
echo "Error: option -r requires repository name as parameter"
usage
@ -290,38 +292,36 @@ while read pkg ver alias; do
}
fi
fi
if [ "$pkgline" ]; then
if [ "$pkgline" -a ! "$missing_only" ]; then
set -- $pkgline
pkgname=$1
pkgver=$2
version_find_bigger $pkgver ${ver/-/.}
vercmp=$?
[ "${vercmp}" != "2" -a "$needupdate_only" ] && continue
[ "$found_manual" ] && pkgname=$3
if [ ! "$missing_only" ]; then
[ "$found_alias" -o "$found_manual" ] && nameadd="$pkg" || unset nameadd
unset veradd
[ ${vercmp} = 2 ] && veradd="<font color=red>$ver</font>"
[ ${vercmp} = 1 ] && veradd="$ver"
# [ "${ver/-/}" != "$pkgver" ] && veradd="<font color=red>$ver</font>" || unset veradd
[ "$veradd" -o "$nameadd" ] && {
[ "$veradd" -a "$nameadd" ] && \
verappend="($nameadd;$veradd)" ||
verappend="(${nameadd}${veradd})"
} || unset verappend
if [ "$distromatic_html" = "1" ]; then
echo "<a href=\"${DISTROMATIC_PREFIX}tag=${DISTROMATIC_REPOSITORY}&pkg=${JOB_PKGS[0]}.source\">${JOB_PKGS[0]} $pkgver</a> $verappend<br>"
else
echo "$pkg $pkgver ($ver)"
fi
[ $vercmp = 2 ] && {
if [ "$found_alias" ]; then
echo "$alias +$ver 0" >> $BUILDLIST_FILE
else
echo "$pkg +$ver 0" >> $BUILDLIST_FILE
fi
}
[ "$found_alias" -o "$found_manual" ] && nameadd="$pkg" || unset nameadd
unset veradd
[ ${vercmp} = 2 ] && veradd="<font color=red>$ver</font>"
[ ${vercmp} = 1 ] && veradd="$ver"
[ "$veradd" -o "$nameadd" ] && {
[ "$veradd" -a "$nameadd" ] && \
verappend="($nameadd;$veradd)" ||
verappend="(${nameadd}${veradd})"
} || unset verappend
if [ "$distromatic_html" = "1" ]; then
echo "<a href=\"${DISTROMATIC_PREFIX}tag=${DISTROMATIC_REPOSITORY}&pkg=${JOB_PKGS[0]}.source\">${JOB_PKGS[0]} $pkgver</a> $verappend<br>"
else
echo "$pkg $pkgver ($ver)"
fi
else
[ $vercmp = 2 ] && {
if [ "$found_alias" ]; then
echo "$alias +$ver 0" >> $BUILDLIST_FILE
else
echo "$pkg +$ver 0" >> $BUILDLIST_FILE
fi
}
elif [ ! "$pkgline" ]; then
echo "$pkg ($ver)" >> $UPDATES_DB.missing
fi
done < $UPDATES_DB

View File

@ -5,12 +5,12 @@
#
. /etc/autodist/config
REPOSITORY=devel
/usr/sbin/autodist-upstream-updates -h -r $REPOSITORY > $LOCAL_REPS_BASE_DIR/distromatic/$REPOSITORY/_popular.html
/usr/sbin/autodist-upstream-updates -h -u -r $REPOSITORY > $LOCAL_REPS_BASE_DIR/distromatic/$REPOSITORY/_popular.html
REPOSITORY=milestone1-1.1
/usr/sbin/autodist-upstream-updates -h -r $REPOSITORY > $LOCAL_REPS_BASE_DIR/distromatic/$REPOSITORY/_popular.html
/usr/sbin/autodist-upstream-updates -h -u -r $REPOSITORY > $LOCAL_REPS_BASE_DIR/distromatic/$REPOSITORY/_popular.html
REPOSITORY=milestone2
/usr/sbin/autodist-upstream-updates -h -r $REPOSITORY > $LOCAL_REPS_BASE_DIR/distromatic/$REPOSITORY/_popular.html
/usr/sbin/autodist-upstream-updates -h -u -r $REPOSITORY > $LOCAL_REPS_BASE_DIR/distromatic/$REPOSITORY/_popular.html
exit 0

View File

@ -38,7 +38,7 @@ pid_check
distromatic -q -t $DISTROMATIC_REPOSITORY --gensrcpkglist > $LOCAL_REPS_BASE_DIR/$DISTROMATIC_REPOSITORY/srcpkglist
pid_check
autodist-upstream-updates -q -h -r $DISTROMATIC_REPOSITORY -o $AUTODIST_REPOSITORY \
autodist-upstream-updates -q -h -m -r $DISTROMATIC_REPOSITORY -o $AUTODIST_REPOSITORY \
> $LOCAL_REPS_BASE_DIR/distromatic/$AUTODIST_REPOSITORY/_popular.html
pid_check