-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnachbau
executable file
·40 lines (36 loc) · 1.2 KB
/
nachbau
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# 'nachbau' is the German word for a copy/clone of something
#
# this script fetches a package from OBS and tries to do a local build that matches it
detect_repo()
{
osc buildinfo |
perl -ne '/^<buildinfo.*repository="([^"]*)"/ && print $1'
}
: ${repo:=`detect_repo`}
export project=$(cat .osc/_project)
export repo
export arch=x86_64
export OUTDIR=binaries.nachbau
rm -rf binaries $OUTDIR
osc getbinaries $repo $arch || exit 16
for bin in binaries/*rpm ; do rpm -qpi $bin | grep "^Signature.*:" ; rpm --delsign $bin ; done > binaries/signature
p=$(basename $(pwd))
origrpm=$(ls binaries/[a-zA-Z0-9]*.rpm | head -1)
[ -n "$origrpm" ] || exit 17
export buildhost=$(rpm -qp --qf "%{BUILDHOST}" $origrpm)
export DISTURL=$(rpm -qp --qf "%{DISTURL}" $origrpm)
export release=$(rpm -qp --qf "%{release}" $origrpm)
# dummy value to use the repo default
export debuginfo=--clean
export vmtype="--vm-type=kvm -j4"
export OSC_BUILD_ROOT=/var/tmp/build-root.${slot}/
rm -f .build-*-nachbau
rebuild
dir2=$OUTDIR compareone
ret=$(cat .build-compare-retval)
mv .build-compare-retval .build-compare-retval-nachbau
mv .build-differed .build-differed-nachbau
# restore rbk result status
dir1=RPMS.2017 compareone
exit $ret