source: build-files/freebsd-update/build-upgrade-patches.sh @ 635dc54

9.2-releasereleng/10.0releng/10.0.1
Last change on this file since 635dc54 was 635dc54, checked in by Kris Moore <kris@…>, 10 months ago

Add our freebsd-update code to GIT

This will become a dumping ground for mods we may make to the freebsd-update
build process, as well as the specific patches we have going into a release

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/sh
2
3if [ $# -lt 3 ]; then
4        echo "usage: $0 ARCH TARGETREL OLDRELS"
5        exit 1
6fi
7
8BASEDIR=/usr/freebsd-update-server
9ARCH=$1
10TARGETREL=$2
11OLDRELS=$3
12
13WWWDIR=${BASEDIR}/pub
14
15mkdir -p ${WWWDIR}/to-${TARGETREL}/${ARCH}/bp/
16for V in ${OLDRELS}; do
17        zcat ${WWWDIR}/${V}/${ARCH}/m/* |
18            cut -f 3,4,9 -d '|' |
19            fgrep '|f|' |
20            cut -f 1,3 -d '|' |
21            sort -u |
22            grep -E '\|[0-9a-f]{64}' |
23            lam -s "${V}|" -
24done |
25    sort -k 2,2 -t '|' > hashtab
26
27zcat ${WWWDIR}/${TARGETREL}/${ARCH}/m/* |
28    cut -f 3,4,9 -d '|' |
29    fgrep '|f|' |
30    cut -f 1,3 -d '|' |
31    sort -u |
32    grep -E '\|[0-9a-f]{64}' |
33    lam -s "${TARGETREL}|" - |
34    sort -k 2,2 -t '|' |
35    join -1 2 -2 2 -t '|' hashtab - |
36    cut -f 2- -d '|' |
37    sort -k 2,2 -t '|' |
38    tr '|' ' ' |
39    while read OR OH NR NH; do
40        if [ -f ${WWWDIR}/to-${TARGETREL}/${ARCH}/bp/${OH}-${NH} ]; then
41                continue
42        fi
43        if [ ${OH} = ${NH} ]; then
44                continue
45        fi
46        gunzip < ${WWWDIR}/${OR}/${ARCH}/f/${OH}.gz > ${OH}
47        gunzip < ${WWWDIR}/${NR}/${ARCH}/f/${NH}.gz > ${NH}
48        bsdiff ${OH} ${NH} ${WWWDIR}/to-${TARGETREL}/${ARCH}/bp/${OH}-${NH}
49        rm ${OH} ${NH}
50    done
51
52rm hashtab
Note: See TracBrowser for help on using the repository browser.