Commit 63c59d01 authored by rah@settrans.net's avatar rah@settrans.net

Changes to try and get builder working with Wheezy (incomplete)

parent a73d5632
Pipeline #695 failed with stages
......@@ -49,6 +49,7 @@ export MAINTINFO='gNewSense hackers <gnewsense-dev@nongnu.org>'
# Do you want to enable backports and updates?
UPDATES=1
BACKPORTS=1
SECURITY=1
# Which architectures will we have in our repository (list all of them)
ALL_REPO_ARCHES="i386"
......@@ -168,6 +169,9 @@ OVERRIDEFILE=$REPODST/conf/override.$RELEASE
# Space separated list of repo components. Put the default first.
COMPONENTS="main universe"
# Whether reprepro should download InRelease files
DOWNLOAD_IN_RELEASE=no
# Allow for local customisations
if [ -r config.local ]; then . config.local; fi
......
......@@ -56,6 +56,12 @@ case $(tr A-Z a-z <<<$MIRRORDIST) in
"hardy")
export KERNEL_RELEASE="2.6.24"
;;
"wheezy")
export KERNEL_RELEASE="3.2.0"
;;
"jessie")
export KERNEL_RELEASE="3.16.0"
;;
*)
exit 1
;;
......
......@@ -33,9 +33,10 @@ discover_version(){
# $4 sub-release (-security,-updates,-backports)
# Find "Package:", then find "Version:" and print the second field
awk -v srcpkg=$1 'BEGIN { package_found = 0 }
zcat $2/dists/$3$4/*/source/Sources.gz | awk -v srcpkg=$1 '
BEGIN { package_found = 0 }
/^Package:/ {if ($2 == srcpkg) package_found = 1}
/^Version:/ {if (package_found == 1) { print $2; exit; } }' $2/dists/$3$4/*/source/Sources
/^Version:/ {if (package_found == 1) { print $2; exit; } }'
}
get_binaries(){
......@@ -45,11 +46,12 @@ get_binaries(){
# Upstream codename.
local ucodename=$(echo "$codename" | sed "s/$RELEASE/$MIRRORDIST/")
local binaries=$(awk -v pkg="$src" 'BEGIN { package_found = 0 }
local binaries=$(zcat "$MIRRORLOCAL"/dists/"$ucodename"/*/source/Sources.gz | \
awk -v pkg="$src" '
BEGIN { package_found = 0 }
/^Package:/ { if ($2 == pkg) package_found = 1 }
/^Binary:/ { if (package_found == 1 ) { for (i=2; i<=NF; i++) printf ("%s", $i);
exit; } }' \
"$MIRRORLOCAL"/dists/"$ucodename"/*/source/Sources)
exit; } }')
binaries=$(echo "$binaries" | tr ',' ' ')
# Dirty hack (hopefully temporary).
......@@ -84,10 +86,10 @@ get_section(){
section=$(egrep -e "^$bin Section " override.bin | cut -d ' ' -f 3)
fi
else
section=$(awk -v pkg="$src" 'BEGIN { package_found = 0 }
section=$(ZCAT "$MIRRORLOCAL"/dists/"$ucodename"/*/source/Sources.gz | \
awk -v pkg="$src" 'BEGIN { package_found = 0 }
/^Package:/ { if ($2 == pkg) package_found = 1 }
/^Section:/ { if (package_found == 1) { print $2; exit; } }' \
"$MIRRORLOCAL"/dists/"$ucodename"/*/source/Sources)
/^Section:/ { if (package_found == 1) { print $2; exit; } }')
if [ -z "$section" ] ; then
section=$(egrep -e "^$src Section " override.src | cut -d ' ' -f 3)
fi
......@@ -212,7 +214,9 @@ ensure_updated() {
# If we are doing packages in -updates, and have a "non-existent" package, try -security
if [ -z "$OUR_VERSION" -a "$distro_release" == "-updates" ]; then
# Try to find a version in -security
OUR_VERSION=$(discover_version $2 $REPODST $BASE_RELEASE "-security" |grep $DISTRONAME_L) ||true
if [ "$SECURITY" == 1 ]; then
OUR_VERSION=$(discover_version $2 $REPODST $BASE_RELEASE "-security" |grep $DISTRONAME_L) ||true
fi
# If OUR_VERSION is no longer empty (eg, its in -security)
if [ -n $OUR_VERSION ]; then
......@@ -283,11 +287,25 @@ while [ $REDO -eq 1 ]; do # If versions in the config change, we could need to r
REDO=0
set_purge
if [ $SECURITY == 1 ]; then
sec=-security
fi
for distro_release in '' $sec $EXTRAS; do
for type in src bin; do
OVERRIDE_FILE="$REPODST"/conf/override."$RELEASE""$distro_release"."$type"
if ! test -e "$OVERRIDE_FILE"; then
touch "$OVERRIDE_FILE"
fi
done
done
reprepro --noskipold -V -b $REPODST update || { echo "Repository update failed"; exit 1; }
# Non-Free, or no valid use.
for pkg in `cat packages-to-remove`; do
for postfix in '' -security $EXTRAS; do
for postfix in '' $sec $EXTRAS; do
reprepro -Vb $REPODST removesrc $RELEASE$postfix $pkg
done
done
......@@ -301,7 +319,7 @@ while [ $REDO -eq 1 ]; do # If versions in the config change, we could need to r
UPSTREAM_VERSION=$(discover_version "$pkg" "$MIRRORLOCAL" "$MIRRORDIST" "")
if [ -n "$UPSTREAM_VERSION" ] ; then
# Package exists upstream.
for distro_release in '' -security $EXTRAS ; do
for distro_release in '' $sec $EXTRAS ; do
# Peek in every pocket so that this does what it's supposed to
# when a new pocket is added after initial setup.
# FIXME: there could be multiple versions in one pocket. This only
......@@ -318,17 +336,17 @@ while [ $REDO -eq 1 ]; do # If versions in the config change, we could need to r
fi
done
for distro_release in '' -security $EXTRAS; do
for distro_release in '' $sec $EXTRAS; do
./update-chroot $distro_release
CHROOTDIR=$WORKINGDIR/$MIRRORDIST$distro_release-$GNS_HOST_ARCH
# Regenerate overrides on every run.
for type in src bin; do
OVERRIDE_FILE="$REPODST"/conf/override."$RELEASE""$distro_release"."$type"
rm -f "$OVERRIDE_FILE"
touch "$OVERRIDE_FILE"
done
# Regenerate overrides on every run.
for type in src bin; do
OVERRIDE_FILE="$REPODST"/conf/override."$RELEASE""$distro_release"."$type"
rm -f "$OVERRIDE_FILE"
touch "$OVERRIDE_FILE"
done
# General
# ensure_updated srcname gnssrcname
......
......@@ -33,15 +33,18 @@ cat << EOF >> doc/examples/sources.list
# See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
# CDROMs are managed through the apt-cdrom tool.
deb http://us.archive.gnewsense.org/gnewsense deltah main universe
deb-src http://us.archive.gnewsense.org/gnewsense deltah main universe
deb http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE $COMPONENTS
deb-src http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE $COMPONENTS
deb http://security.gnewsense.org/gnewsense deltah-security main universe
deb-src http://security.gnewsense.org/gnewsense deltah-security main universe
deb http://us.archive.gnewsense.org/gnewsense deltah-updates main universe
deb-src http://us.archive.gnewsense.org/gnewsense deltah-updates main universe
deb http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE-updates $COMPONENTS
deb-src http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE-updates $COMPONENTS
EOF
if [ $SECURITY == 1 ]; then
cat << EOF >> doc/examples/sources.list
deb http://security.gnewsense.org/gnewsense $RELEASE-security $COMPONENTS
deb-src http://security.gnewsense.org/gnewsense $RELEASE-security $COMPONENTS
EOF
fi
echo | dch -D $RELEASE -v $(sed -n '1s#^.*(\(.*\)).*#\1'${DISTRONAME_L}${APT_VERSION}'#p' debian/changelog) "Changed for $DISTRONAME"
......
......@@ -79,11 +79,16 @@ cdebootstrap -v --allow-unauthenticated --keyring= --arch=$GNS_HOST_ARCH --flavo
mkdir -p cdroot-$GNS_HOST_ARCH/image/casper/
cat << EOF > chroot-$GNS_HOST_ARCH/etc/apt/sources.list
deb $REPOAPT $RELEASE main universe
# deb-src $REPOAPT $RELEASE main universe
deb $REPOAPT $RELEASE-security main universe
# deb-src $REPOAPT $RELEASE-security main universe
deb $REPOAPT $RELEASE $COMPONENTS
# deb-src $REPOAPT $RELEASE $COMPONENTS
EOF
if [ $SECURITY == 1 ]; then
cat << EOF >> chroot-$GNS_HOST_ARCH/etc/apt/sources.list
deb $REPOAPT $RELEASE-security $COMPONENTS
# deb-src $REPOAPT $RELEASE-security $COMPONENTS
EOF
fi
# Used by gen-cdsource
cp chroot-$GNS_HOST_ARCH/etc/apt/sources.list sources.list
......@@ -135,11 +140,15 @@ chroots "dpkg --get-selections > ./cdroot-$GNS_HOST_ARCH/root/default-package-se
chroots "apt-get clean"
cat << EOF > chroot-$GNS_HOST_ARCH/etc/apt/sources.list
# From gen-livecd
deb http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE main universe
deb-src http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE main universe
deb http://security.$DOMAIN/$DISTRONAME_L/ $RELEASE-security main universe
deb-src http://security.$DOMAIN/$DISTRONAME_L/ $RELEASE-security main universe
deb http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE $COMPONENTS
deb-src http://archive.$DOMAIN/$DISTRONAME_L/ $RELEASE $COMPONENTS
EOF
if [ $SECURITY == 1 ]; then
cat << EOF >> chroot-$GNS_HOST_ARCH/etc/apt/sources.list
deb http://security.$DOMAIN/$DISTRONAME_L/ $RELEASE-security $COMPONENTS
deb-src http://security.$DOMAIN/$DISTRONAME_L/ $RELEASE-security $COMPONENTS
EOF
fi
chroots /etc/cron.daily/mlocate
......
......@@ -11,53 +11,66 @@ cd $REPODST
cat > conf/distributions <<EOF
Origin: $DISTRONAME
Label: $DISTRONAME
Codename: ${RELEASE}-security
Update: Upstream-security
Codename: $RELEASE
Update: Upstream
Architectures: $ALL_REPO_ARCHES source
Components: main universe
Components: main
UDebComponents: main
SignWith: $SIGNINGKEY
DscIndices: Sources Release . .gz
DebOverride: override.$RELEASE-security.bin
UDebOverride: override.$RELEASE-security.bin
DscOverride: override.$RELEASE-security.src
DebOverride: override.$RELEASE.bin
UDebOverride: override.$RELEASE.bin
DscOverride: override.$RELEASE.src
EOF
cat > conf/updates <<EOF
Name: Upstream
Method: $MIRROR
Suite: $MIRRORDIST
Components: main>main
FilterList: install purge-wheezy
GetInRelease: ${DOWNLOAD_IN_RELEASE}
VerifyRelease: $UPSTREAM_FINGERPRINT_MAIN
EOF
if [ 1 == $SECURITY ]; then
cat > conf/distributions <<EOF
Origin: $DISTRONAME
Label: $DISTRONAME
Codename: $RELEASE
Update: Upstream
Codename: ${RELEASE}-security
Update: Upstream-security
Architectures: $ALL_REPO_ARCHES source
Components: main universe
Components: main
UDebComponents: main
SignWith: $SIGNINGKEY
DscIndices: Sources Release . .gz
DebOverride: override.$RELEASE.bin
UDebOverride: override.$RELEASE.bin
DscOverride: override.$RELEASE.src
DebOverride: override.$RELEASE-security.bin
UDebOverride: override.$RELEASE-security.bin
DscOverride: override.$RELEASE-security.src
EOF
cat > conf/updates <<EOF
Name: Upstream-security
Method: $MIRROR
Suite: ${MIRRORDIST}-security
Components: main>main universe>universe
FilterList: install purge-hardy
Name: Upstream
Method: $MIRROR
Suite: $MIRRORDIST
Components: main>main universe>universe
FilterList: install purge-hardy
Components: main>main
FilterList: install purge-wheezy
GetInRelease: ${DOWNLOAD_IN_RELEASE}
VerifyRelease: $UPSTREAM_FINGERPRINT_SECURITY
EOF
fi
if [ 1 == $UPDATES ]; then
cat >> conf/updates <<EOF
Name: Upstream-updates
Method: $MIRROR
Suite: ${MIRRORDIST}-updates
Components: main>main universe>universe
FilterList: install purge-hardy
Components: main>main
FilterList: install purge-wheezy
GetInRelease: ${DOWNLOAD_IN_RELEASE}
VerifyRelease: $UPSTREAM_FINGERPRINT_MAIN
EOF
cat >> conf/distributions <<EOF
......@@ -67,7 +80,7 @@ Label: $DISTRONAME
Codename: $RELEASE-updates
Update: Upstream-updates
Architectures: $ALL_REPO_ARCHES source
Components: main universe
Components: main
UDebComponents: main
SignWith: $SIGNINGKEY
DscIndices: Sources Release . .gz
......@@ -83,8 +96,10 @@ cat >> conf/updates <<EOF
Name: Upstream-backports
Method: $MIRROR
Suite: ${MIRRORDIST}-backports
Components: main>main universe>universe
FilterList: install purge-hardy
Components: main>main
FilterList: install purge-wheezy
GetInRelease: ${DOWNLOAD_IN_RELEASE}
VerifyRelease: $UPSTREAM_FINGERPRINT_MAIN
EOF
cat >> conf/distributions <<EOF
......@@ -94,7 +109,7 @@ Label: $DISTRONAME
Codename: $RELEASE-backports
Update: Upstream-backports
Architectures: $ALL_REPO_ARCHES source
Components: main universe
Components: main
UDebComponents: main
SignWith: $SIGNINGKEY
DscIndices: Sources Release . .gz
......
......@@ -36,14 +36,14 @@ if ! [ -f $DIR/bootstrap-done ]; then
fi
cat > $DIR/etc/apt/sources.list <<EOF
deb $MIRROR $MIRRORDIST main universe
deb-src $MIRROR $MIRRORDIST main universe
deb $MIRROR $MIRRORDIST $COMPONENTS
deb-src $MIRROR $MIRRORDIST $COMPONENTS
EOF
if [ -n "$VARIANT" ];then
cat >> $DIR/etc/apt/sources.list <<EOF
deb $MIRROR $MIRRORDIST$VARIANT main universe
deb-src $MIRROR $MIRRORDIST$VARIANT main universe
deb $MIRROR $MIRRORDIST$VARIANT $COMPONENTS
deb-src $MIRROR $MIRRORDIST$VARIANT $COMPONENTS
EOF
fi
......
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