#!/bin/sh
# query ini syntax:
#[libvirt SLES11]
#title=SLES11
# quick create query.ini file for SLES11
# first arg must be the list of package to take into account

if [ $# -ne 1 ]
then
    echo "- First arg must be the package list (file)"
    exit 1
fi

file=$1

# we need a title for the main webpage
echo "
[MAINTITLE]
data=Packages SLES11 GA SP1 SP2 SP3 SP4
"

for i in `cat $file`
do
echo "
[$i]
title=$i
url=buglist.cgi?short_desc=$i&resolution=---&resolution=DUPLICATE&classification=SUSE%20Linux%20Enterprise%20Server&query_format=advanced&bug_status=NEW&bug_status=CONFIRMED&bug_status=IN_PROGRESS&bug_status=REOPENED&short_desc_type=allwordssubstr&product=suse%20linux%20enterprise%20server%2011%20sp2%20%28sles%2011%20sp2%29&product=suse%20linux%20enterprise%20server%2011%20sp3%20%28sles%2011%20sp3%29&product=suse%20linux%20enterprise%20server%2011%20sp4%20%28sles%2011%20sp4%29"


#url=bug_status=UNCONFIRMED&bug_status=NEW&bug_status=CONFIRMED&bug_status=IN_PROGRESS&bug_status=REOPENED&bug_status=VERIFIED&list_id=2321196
#&product=SUSE%20Linux%20Enterprise%20Server%2011
#&product=SUSE%20Linux%20Enterprise%20Server%2011%20SP1
#&product=SUSE%20Linux%20Enterprise%20Server%2011%20SP2%20%28SLES%2011%20SP2%29
#&product=SUSE%20Linux%20Enterprise%20Server%2011%20SP3%20%28SLES%2011%20SP3%29
#&product=SUSE%20Linux%20Enterprise%20Server%2011%20SP4%20%28SLES%2011%20SP4%29
#&query_format=advanced&resolution=---&short_desc=kvm

done
