Commit 35a3e4e3 authored by Ricardo Tavares de Oliveira's avatar Ricardo Tavares de Oliveira Committed by Vinicius Ruoso

integrity/generate_packs_base,packs_base: Removed packs base related files

We are removing both generate_packs_base.sh and packs_base, since we
changed the way we generate the packs base to an external schema.
Signed-off-by: default avatarRicardo Tavares de Oliveira <rto07@c3sl.ufpr.br>
parent 968250f6
#!/bin/bash
BASEFILE_=MAINBASEFILE
BASEFILE=$(mktemp)
cp $BASEFILE_ $BASEFILE
sed -i 's/| //g' $BASEFILE
DIR=/home/mirror/debian/prd/etch-testing/etch-security
list="$( ls $DIR | cut -d'_' -f1)"
for pack in $list; do
sed -i "/^@ ${pack}/d" $BASEFILE
done
PACKS="$(cut -d' ' -f1 $BASEFILE | sed 's/+/\\\+/g')"
function update() {
VERFILE=$1
for pack in $PACKS; do
if egrep -q "Package: $pack$" $VERFILE; then
version=$(egrep "Package: ${pack}$" $VERFILE -A10 | \
grep "Version:" | head -1 | \
awk -F": " '{print $2}' | cut -d":" -f2)
oldversion=$(egrep "^$pack " $BASEFILE | cut -d" " -f2)
if dpkg --compare-versions $version ">=" $oldversion
then
sed -i \
"s/^$(sed "s/\\\+/+/g" <<< $pack) .*$/${pack} ${version}/1" $BASEFILE
fi
fi
done
}
function update_from_dir() {
list="$(ls $1 | awk -F'_' '{print $1" "$2}')"
while read pack version; do
if egrep -q "^${pack} "; then
sed -i "s/^${pack} .*$/${pack} ${version}/1" $BASEFILE
else
echo "${pack} ${version}" >> $BASEFILE
fi
done <<< "$list"
}
# mirror debian
update /home/mirror/debian/debian/dists/etch/main/binary-i386/Packages
# mirror debian-security
update /home/mirror/debian/debian-security/dists/etch/updates/main/\
binary-i386/Packages
# mirror prdetch
update_from_dir /home/mirror/debian/prd/prdetch/pool/main
# mirror etch-security
update_from_dir /home/mirror/debian/prd/etch-security/pool/main
# forcing prd-kernel!
kernelver=$(grep "prd-kernel-xeon" $BASEFILE | cut -d" " -f2)
sed -i "/prd-kernel-xeon/d;/prd-kernel-opteron/d" $BASEFILE
echo "| prd-kernel-xeon $kernelver prd-kernel-opteron $kernelver" \
>> $BASEFILE
# forcing xephyr!
sed -i "/xserver-xephyr/d" $BASEFILE
echo "xserver-xephyr 1.1.1-21etch3" >> $BASEFILE
# mirror testing (insert "OR" (|) into packages that has
# 2 possible versions)
DIR=/home/mirror/debian/prd/etch-testing/etch-security
list="$( ls $DIR | awk -F'_' '{print $1" "$2}')"
while read pack version; do
if ! grep -q "$pack" $BASEFILE; then
echo "@ $pack $version" >> $BASEFILE
else
f=$(mktemp)
if ! grep -q "$pack $version" $BASEFILE; then
awk '{if ($1 ~ /^'$pack'$/) \
{print "| '$pack' '$version' " $0} else \
{print $0}}' $BASEFILE > $f
mv $f $BASEFILE
fi
fi
done <<< "$list"
# insert "OR" (|) into packages in the
# same situation outside mirror testing
f=$(mktemp)
awk '{if (NF == 4) {print "| "$0} else {print $0}}' $BASEFILE > $f
mv $f $BASEFILE
cp $BASEFILE $BASEFILE_
rm -f $BASEFILE
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment