Inhaltsverzeichnis

upcheck.sh

Summary

This script can be used to check your repository against AUR for updates.
I'm using it with Archup to periodically check my repository.

Main

Warranty

Warranty

There is no warranty that this setup works for any system which provide the dependencies listed below.
I'm just providing these information because it worked for me.
If you have questions you can leave a message here but I decide whether I'll answer and help or not.

Security - Connection

Security issue

If you use the described setup you'll copy files using an unencrypted connection.
That is why it is possible to sniff data about you, your systems and your infrastructure.
You should only use it within a secure network and only if you trust everybody who is using it.

Dependencies:

Version History:

0.3:

0.2.5:

0.2:

0.1:

Script

upcheck.sh
#!/bin/bash
 
######################################################################
#
#                  Author: Andrwe Lord Weber
#                  Mail: lord-weber-andrwe<at>renona-studios<dot>org
#                  Version: 0.3
#
######################################################################
 
######################################################################
#
#                  script variables and functions
#
######################################################################
 
# Set name of the repository
REPONAME="andrwe seiichiro"
# Set packages which should be skipped
# e.g.: foo-.* => skip all starting with foo-
#       foobar => skip package foobar
#       .*bar  => skip packages ending with bar
BLACKLIST="vdr-.* .*zjs"
 
######################################################################
#
#                  No changes needed after this line.
#
######################################################################
 
for repo in ${REPONAME}
do
	pacman -Sl ${repo} > /tmp/upcheck.pac.$$
	pacname=`cat /tmp/upcheck.pac.$$ | awk -F ' ' '{print $2}'`
	slurpy -s ${pacname} | sed '/^aur.*/!d' > /tmp/upcheck.slu.$$
 
	echo Repository: ${repo}
 
	for pn in ${pacname}
	do
		blacked=0
		for black in ${BLACKLIST}
		do
			[ ${blacked} -eq 1 ] && continue
			[ "`echo ${pn} | sed "s#${black}##"`" == "" ] && blacked=1
		done
		[ ${blacked} -eq 1 ] && continue
		vcs=0
		if [[ ${pn} =~ .*-(git|svn|cvs|hg) ]]
		then
			vcs=1
		fi
		if [ ${vcs} -eq 0 ]
		then
			pacver=`grep -F "${repo} ${pn} " /tmp/upcheck.pac.$$ | awk -F ' ' '{print $3}'`
			sluver=`grep -F "aur/${pn} " /tmp/upcheck.slu.$$ | awk -F ' ' '{print $2}'`
			[ "${sluver}" == "" ] && continue
			pacver_num=`echo ${pacver} | sed 's#\.##g;s#-##g'`
			sluver_num=`echo ${sluver} | sed 's#\.##g;s#-##g'`
			[[ ${pacver_num} =~ ^[0-9]+$ ]] && [[ ${sluver_num} =~ ^[0-9]+$ ]] && [ ${pacver_num} -lt ${sluver_num} ] && echo ${pn} ${sluver} cur: ${pacver} && continue
			[[ ${pacver_num} =~ ^[0-9]+$ ]] && [[ ${sluver_num} =~ ^[0-9]+$ ]] && continue
			[ "${pacver}" != "${sluver}" ] && echo ${pn} ${sluver} cur: ${pacver}
		fi
	done
 
	rm /tmp/upcheck.pac.$$
	rm /tmp/upcheck.slu.$$
done