Search:  
Gentoo Wiki

SyncArchCK

This page is a candidate for deletion 
Reason given: Package is unmaintained since 2006.
If you disagree with its deletion, please explain why on its discussion page.
If you intend to fix it, please remove this notice, but do not remove this notice from articles that you have created yourself.
Make sure no other pages link here and check the page's history before deleting.

Script to keep your ArchCK overlay in sync with what's been posted on the Gentoo Bugzilla.
The ugliest script you've ever seen.

#!/bin/bash
# GPL
#
# into the overlay archck
cd /etc/portage/overlay/sys-kernel/archck-sources
#
# get the file:
wget http://bugs.gentoo.org/show_bug.cgi?id=103354 -O work
#
# make work usable
cat work|grep attachment|grep ebuild|grep -v title > usable
#
# partoflinks:
NUM=`cat usable|wc -l` && TOHIGH=$[$NUM+1] && C=1 ; for x in `cat usable` ; do  cat usable|head -n $C|tail -n 1|cut -c 20-42 ; C=`echo $[$C+1]` ; if [ $C =  $TOHIGH ] ; then break ; fi ; done > endlink 
#
# rest of links:
cat endlink | sed s,"attachment","http://bugs.gentoo.org/attachment", >  download
#
# filenames:
echo -e "$(for x in `cat usable`;do echo $x|grep archck|sed s,">",\\n,|grep archck|sed s,"</span>",,|sed s,"</a>",,|sed s,"</span",,|sed s,"2.6.14-r1","2.6.14-r1.ebuild",;done) " > filenames
#
# download and rename and digest:
CT=1 && until [ $CT = $TOHIGH ] ; do
	if [ ! -e ./`cat filenames|head -n $CT|tail -n 1` ] ; then 
		wget `cat download|head -n $CT|tail -n 1` -O `cat filenames|head -n $CT|tail -n 1`
		ebuild `cat filenames|head -n $CT|tail -n 1` digest
	fi
	CT=`echo $[$CT+1]`
done
#
# clean up:
rm work && rm filenames && rm download && rm endlink && rm usable
#
# back home:
cd -

Notes:
If it breaks something (which it shouldn't) it's your fault.
The let command in bash didn't want to work for me at the time of writing so as you can see I had to work around it.
There are some nasty greps and seds that I was too lazy to do propperly.
When Bugzilla hits more than 99999 attachments (which it will do sooner or later) the script will no longer work.
Don't spend your time saying it's bad, use that time to make it better (it took me 10 minutes so you can't expect something good).

Retrieved from "http://www.gentoo-wiki.info/SyncArchCK"

Last modified: Fri, 08 Aug 2008 11:03:00 +0000 Hits: 3,009