autodist-upstream-updates: added support for blacklisting
This commit is contained in:
parent
681b2e5ec7
commit
68bacbc599
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# autodist upstream updates - find upstream packages updates from different internet resources
|
# autodist upstream updates - find upstream packages updates from different internet resources
|
||||||
# Copyright (c) 2004-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
# Copyright (c) 2004-2016 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
#
|
#
|
||||||
|
|
||||||
#[ -r /etc/sysconfig/openmamba-central ] || {
|
#[ -r /etc/sysconfig/openmamba-central ] || {
|
||||||
@ -157,6 +157,7 @@ CONFIG_DIR=$CACHE_DIR
|
|||||||
UPDATES_DB=$CACHE_DIR/upstream-updates
|
UPDATES_DB=$CACHE_DIR/upstream-updates
|
||||||
ALIASES_DB=$CACHE_DIR/aliases
|
ALIASES_DB=$CACHE_DIR/aliases
|
||||||
MANUALVER_DB=$CACHE_DIR/manualver
|
MANUALVER_DB=$CACHE_DIR/manualver
|
||||||
|
BLACKLIST_DB_PREFIX=$CACHE_DIR/blacklist.
|
||||||
|
|
||||||
[ -s $PKGLIST_FILE ] || {
|
[ -s $PKGLIST_FILE ] || {
|
||||||
echo "Error: file $PKGLIST_FILE is missing or empty; aborting." >&2
|
echo "Error: file $PKGLIST_FILE is missing or empty; aborting." >&2
|
||||||
@ -180,9 +181,12 @@ parse_arch_linux() {
|
|||||||
while read line; do
|
while read line; do
|
||||||
line=`echo $line | sed "s|.*href=\"\([^\"]*\)\">.*|\1|"`
|
line=`echo $line | sed "s|.*href=\"\([^\"]*\)\">.*|\1|"`
|
||||||
pkg=`echo $line | sed "s|\(.*\)-[^-]*-[^-]*-[^-]*|\1|"`
|
pkg=`echo $line | sed "s|\(.*\)-[^-]*-[^-]*-[^-]*|\1|"`
|
||||||
ver=`echo $line | sed "s|.*-\([^-]*\)-[^-]*-[^-]*|\1|;s|.*%3a||"`
|
ver=`echo $line | sed "s|.*-\([^-]*\)-[^-]*-[^-]*|\1|;s|.*%3a||i;s|%2b.*||i"`
|
||||||
alias=`grep "^$pkg " $ALIASES_DB`
|
alias=`grep "^$pkg " $ALIASES_DB`
|
||||||
|
# Skip blackisted
|
||||||
|
if [ -e ${BLACKLIST_DB_PREFIX}arch ]; then
|
||||||
|
grep -q "^$pkg$" ${BLACKLIST_DB_PREFIX}arch && continue
|
||||||
|
fi
|
||||||
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
|
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
|
||||||
[ "$alias" ] && pkgalias=${alias/* /} || pkgalias=$pkg
|
[ "$alias" ] && pkgalias=${alias/* /} || pkgalias=$pkg
|
||||||
line=`grep -i "^$pkgalias:" $buildstmp || grep -i "^lib$pkgalias:" $buildstmp || grep -i " $pkgalias[^-_A-Za-z0-9]" $buildstmp`
|
line=`grep -i "^$pkgalias:" $buildstmp || grep -i "^lib$pkgalias:" $buildstmp || grep -i " $pkgalias[^-_A-Za-z0-9]" $buildstmp`
|
||||||
@ -206,6 +210,9 @@ parse_xorg() {
|
|||||||
if [ "$line" ]; then
|
if [ "$line" ]; then
|
||||||
ver=`echo $line | sed "s|.*-||"`
|
ver=`echo $line | sed "s|.*-||"`
|
||||||
pkg="${line/-$ver}"
|
pkg="${line/-$ver}"
|
||||||
|
if [ -e ${BLACKLIST_DB_PREFIX}xorg ]; then
|
||||||
|
grep -q "^$pkg$" ${BLACKLIST_DB_PREFIX}xorg && continue
|
||||||
|
fi
|
||||||
alias=`grep "^$pkg " $ALIASES_DB`
|
alias=`grep "^$pkg " $ALIASES_DB`
|
||||||
if [ ! "$alias" -a "${pkg:0:5}" == "xf86-" ]; then
|
if [ ! "$alias" -a "${pkg:0:5}" == "xf86-" ]; then
|
||||||
alias="$pkg xorg-drv-${pkg/xf86-}"
|
alias="$pkg xorg-drv-${pkg/xf86-}"
|
||||||
@ -228,6 +235,9 @@ parse_gnome() {
|
|||||||
IFS=":"
|
IFS=":"
|
||||||
set -- $line
|
set -- $line
|
||||||
pkg="$2"
|
pkg="$2"
|
||||||
|
if [ -e ${BLACKLIST_DB_PREFIX}gnome ]; then
|
||||||
|
grep -q "^$pkg$" ${BLACKLIST_DB_PREFIX}gnome && continue
|
||||||
|
fi
|
||||||
ver="$3"
|
ver="$3"
|
||||||
alias=`grep "^$pkg " $ALIASES_DB`
|
alias=`grep "^$pkg " $ALIASES_DB`
|
||||||
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
|
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
|
||||||
@ -249,7 +259,7 @@ parse_gnome() {
|
|||||||
parse_distromatic() {
|
parse_distromatic() {
|
||||||
# parse distrowatch.com packages list
|
# parse distrowatch.com packages list
|
||||||
[ "$quiet" ] || echo "Parsing Distrowatch packages list..." >&2
|
[ "$quiet" ] || echo "Parsing Distrowatch packages list..." >&2
|
||||||
SOURCEURL="http://distrowatch.com/packages.php"
|
SOURCEURL="http://distrowatch.gds.tuwien.ac.at/packages.php"
|
||||||
lynx -width 300 -dump $SOURCEURL |
|
lynx -width 300 -dump $SOURCEURL |
|
||||||
while read line; do
|
while read line; do
|
||||||
[ "`echo $line | grep "Package Version Note"`" ] && start_print=1
|
[ "`echo $line | grep "Package Version Note"`" ] && start_print=1
|
||||||
|
Loading…
Reference in New Issue
Block a user