summaryrefslogtreecommitdiffstats
path: root/freed-ora/current/master/scripts
diff options
context:
space:
mode:
authorAlexandre Oliva <lxoliva@fsfla.org>2016-07-19 06:29:33 +0000
committerAlexandre Oliva <lxoliva@fsfla.org>2016-07-19 06:29:33 +0000
commit32e6237e75be21b8e908b299ac521add9dda97aa (patch)
treeb54aa577af189fac2bdf24a62d9b963c7414fc4d /freed-ora/current/master/scripts
parent7f0ca8af397dcb3294a3266f7350c64d1a21c308 (diff)
downloadlinux-libre-raptor-32e6237e75be21b8e908b299ac521add9dda97aa.tar.gz
linux-libre-raptor-32e6237e75be21b8e908b299ac521add9dda97aa.zip
4.7.0-0.rc7.git0.1.fc25.gnu
Diffstat (limited to 'freed-ora/current/master/scripts')
-rwxr-xr-xfreed-ora/current/master/scripts/allarchconfig.sh16
-rwxr-xr-xfreed-ora/current/master/scripts/bumpspecfile.py76
-rwxr-xr-xfreed-ora/current/master/scripts/fast-build.sh13
-rwxr-xr-xfreed-ora/current/master/scripts/fast-x86_643
-rwxr-xr-xfreed-ora/current/master/scripts/generate-git-snapshot.sh18
-rwxr-xr-xfreed-ora/current/master/scripts/grab-logs.sh31
-rw-r--r--freed-ora/current/master/scripts/rediffall.pl64
7 files changed, 53 insertions, 168 deletions
diff --git a/freed-ora/current/master/scripts/allarchconfig.sh b/freed-ora/current/master/scripts/allarchconfig.sh
deleted file mode 100755
index f80c23197..000000000
--- a/freed-ora/current/master/scripts/allarchconfig.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-# Run from within a source tree.
-
-for i in configs/kernel-*.config
-do
- cp -f $i .config
- Arch=`head -1 .config | cut -b 3-`
- echo $Arch \($i\)
- make ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true;
- if [ -s .newoptions ]; then
- cat .newoptions;
- exit 1;
- fi;
- rm -f .newoptions;
-done
-
diff --git a/freed-ora/current/master/scripts/bumpspecfile.py b/freed-ora/current/master/scripts/bumpspecfile.py
deleted file mode 100755
index bc02ab300..000000000
--- a/freed-ora/current/master/scripts/bumpspecfile.py
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/usr/bin/python
-#
-# Uses git config options user.name and user.email, falls
-# back to env vars $GIT_COMMITTER_NAME and $GIT_COMMITTER_EMAIL
-#
-import re
-import sys
-import time
-import os
-import string
-
-class Specfile:
- def __init__(self,filename):
- file=open(filename,"r")
- self.lines=file.readlines()
- self.vr=""
-
- def getNextVR(self,aspec):
- # Get VR for changelog entry.
- (ver,rel) = os.popen("LC_ALL=C rpm --specfile -q --qf '%%{version} %%{release}\n' --define 'dist %%{nil}' %s | head -1" % aspec).read().strip().split(' ')
- pos = 0
- # general released kernel case, bump 1st field
- fedora_build = rel.split('.')[pos]
- if fedora_build == "0":
- # this is a devel kernel, bump 2nd field
- pos = 1
- elif rel.split('.')[-1] != fedora_build:
- # this is a branch, must bump 3rd field
- pos = 2
- fedora_build = rel.split('.')[pos]
- if pos == 1 and len(rel.split('.')) > 4:
- # uh... what? devel kernel in a branch? private build? just do no VR in clog...
- print "Warning: not adding any VR to changelog, couldn't tell for sure which field to bump"
- pos = -1
- next_fedora_build = int(fedora_build) + 1
- if pos == 0:
- nextrel = str(next_fedora_build)
- elif pos == 1:
- nextrel = "0." + str(next_fedora_build)
- elif pos == 2:
- nextrel = rel.split('.')[0] + "." + rel.split('.')[1] + "." + str(next_fedora_build)
- if pos >= 0:
- for s in rel.split('.')[pos + 1:]:
- nextrel = nextrel + "." + s
- self.vr = " "+ver+'-'+nextrel
-
- def addChangelogEntry(self,entry):
- user = os.popen("git config --get user.name").read().rstrip()
- if (user == ""):
- user = os.environ.get("GIT_COMMITTER_NAME","Unknown")
- email = os.popen("git config --get user.email").read().rstrip()
- if (email == ""):
- email = os.environ.get("GIT_COMMITTER_EMAIL","unknown")
- if (email == "unknown"):
- email = os.environ.get("USER","unknown")+"@fedoraproject.org"
- changematch=re.compile(r"^%changelog")
- date=time.strftime("%a %b %d %Y", time.localtime(time.time()))
- newchangelogentry="%changelog\n* "+date+" "+user+" <"+email+">"+self.vr+"\n"+entry+"\n\n"
- for i in range(len(self.lines)):
- if(changematch.match(self.lines[i])):
- self.lines[i]=newchangelogentry
- break
-
- def writeFile(self,filename):
- file=open(filename,"w")
- file.writelines(self.lines)
- file.close()
-
-if __name__=="__main__":
- aspec=(sys.argv[1])
- s=Specfile(aspec)
- entry=(sys.argv[2])
- s.getNextVR(aspec)
- s.addChangelogEntry(entry)
- s.writeFile(aspec)
-
diff --git a/freed-ora/current/master/scripts/fast-build.sh b/freed-ora/current/master/scripts/fast-build.sh
new file mode 100755
index 000000000..8286a110f
--- /dev/null
+++ b/freed-ora/current/master/scripts/fast-build.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+# Description:
+# rpmbuild combo to build the given architecture without
+# debugging information, perf or tools.
+#
+# Sample usage:
+# ./fast-build.sh x86_64 kernel-4.7.0-0.rc1.git1.2.fc25.src.rpm
+
+if [ -z "$1" ] || [ -z "$2" ]; then
+ echo "usage: $0 [ arch ] [ kernel-x.x.x.fcxx.src.rpm ] "
+fi
+
+rpmbuild --target $1 --without debug --without debuginfo --without perf --without tools --rebuild $2
diff --git a/freed-ora/current/master/scripts/fast-x86_64 b/freed-ora/current/master/scripts/fast-x86_64
deleted file mode 100755
index 649ef6525..000000000
--- a/freed-ora/current/master/scripts/fast-x86_64
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-rpmbuild --target x86_64 --without debuginfo --without perf --without tools --rebuild $1
diff --git a/freed-ora/current/master/scripts/generate-git-snapshot.sh b/freed-ora/current/master/scripts/generate-git-snapshot.sh
index 3da20a1b1..972fd2148 100755
--- a/freed-ora/current/master/scripts/generate-git-snapshot.sh
+++ b/freed-ora/current/master/scripts/generate-git-snapshot.sh
@@ -1,14 +1,26 @@
#!/bin/sh
+# This script allows for the generation of a git snapshot between the upstream
+# git tree and the current tree.
#
-# Set LINUX_GIT to point to an upstream Linux git tree in your .bashrc or wherever.
+# Prerequisites:
+# Set LINUX_GIT to point to an upstream Linux git tree in your .bashrc
+# or wherever.
-[ ! -d "$LINUX_GIT" ] && echo "error: set \$LINUX_GIT to point at upstream git tree" && exit 1
+# Look to see if LINUX_GIT is set in local .bashrc
+if [ -f ~/.bashrc ]; then
+ source ~/.bashrc
+fi
+
+if [ ! -d "$LINUX_GIT" ]; then
+ echo "error: set \$LINUX_GIT to point at upstream git tree"
+ exit 1
+fi
VER=$(grep patch sources | head -n1 | awk '{ print $2 }' | sed s/patch-// | sed s/-git.*// | sed s/.xz//)
if [ -z "$VER" ] ;
then
- VER=$(grep linux sources | head -1 | awk '{ print $2 }' | sed s/linux-// | sed s/.tar.xz//)
+ VER=$(grep linux sources | head -1 | awk '{ print $2 }' | sed s/linux-// | sed s/.tar.xz//)
fi
OLDGIT=$(grep gitrev kernel.spec | head -n1 | sed s/%define\ gitrev\ //)
diff --git a/freed-ora/current/master/scripts/grab-logs.sh b/freed-ora/current/master/scripts/grab-logs.sh
index 5df573571..571b503bb 100755
--- a/freed-ora/current/master/scripts/grab-logs.sh
+++ b/freed-ora/current/master/scripts/grab-logs.sh
@@ -1,16 +1,35 @@
#!/bin/sh
+# Script helps download the build logs for the current tree.
+# The downloaded logs will be saved in a logs/ within the
+# tree.
+
+BASEDIR="$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)")"
+pushd $BASEDIR > /dev/null
VER=$(fedpkg verrel)
ver=$(echo $VER | sed -e 's/-/ /g' | awk '{print $2}')
rev=$(echo $VER | sed -e 's/-/ /g' | awk '{print $3}')
-if [ -d logs ]; then
- DIR=logs/
+# keep logs in one place. If logs directory does not exist, make it.
+if [ -d "$BASEDIR/logs" ]; then
+ DIR="$BASEDIR/logs"
else
- DIR=./
+ mkdir "$BASEDIR/logs"
+ DIR="$BASEDIR/logs"
fi
-wget -O $DIR/build-$VER-i686.log http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/i686/build.log
-wget -O $DIR/build-$VER-x86-64.log http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/x86_64/build.log
-wget -O $DIR/build-$VER-noarch.log http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/noarch/build.log
+# Common architectures that have build logs.
+ARCHS[0]=i686
+ARCHS[1]=x86_64
+ARCHS[2]=noarch
+ARCHS[3]=armv7hl
+for arch in ${ARCHS[@]}; do
+ URL=http://kojipkgs.fedoraproject.org/packages/kernel/$ver/$rev/data/logs/$arch/build.log
+ # Only download logs if exist
+ wget --spider -q $URL
+ if [ $? -eq 0 ]; then
+ wget -O $DIR/build-$VER-$arch.log $URL
+ fi
+done
+popd > /dev/null
diff --git a/freed-ora/current/master/scripts/rediffall.pl b/freed-ora/current/master/scripts/rediffall.pl
deleted file mode 100644
index 29f12beb9..000000000
--- a/freed-ora/current/master/scripts/rediffall.pl
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Script to rediff all patches in the spec
-# Usage: perl -w rediffall.pl < kernel-2.4.spec
-#
-# $workdir is where the new rediff'ed patches are created
-# $origdir is where the original patches and tarball are located
-#
-# Note that both $workdir and $origdir must be absolute path names.
-# Suggestion: create a /kernel symbolic link to the top of your CVS tree.
-
-my $workdir = "/dev/shm/redifftree";
-my $origdir = "/home/davej/devel";
-my $kernver = "linux-2.6.17";
-my $datestrip = "s/^\\(\\(+++\\|---\\) [^[:blank:]]\\+\\)[[:blank:]].*/\\1/";
-my $patchindex = 0;
-my @patchlist;
-
-# phase 1: create a tree
-print "Extracting pristine source..\n";
-system("mkdir -p $workdir");
-system("rm -rf $workdir/*");
-chdir("$workdir");
-system("tar -jxvf $origdir/$kernver.tar.bz2 > /dev/null");
-system("cp -al $kernver linux-$patchindex");
-
-# phase 2: read the spec from stdin and store all patches
-print "Reading specfile..\n";
-
-while (<>) {
- my $line = $_;
- if ($line =~ /^Patch([0-9]+)\: ([a-zA-Z0-9\-\_\.\+]+\.patch)/) {
- $patchlist[$1] = $2;
- } else {
- if ($line =~ /^Patch([0-9]+)\: ([a-zA-Z0-9\-\_\.]+\.bz2)/) {
- $patchlist[$1] = $2;
- }
- }
-
- if ($line =~ /^%patch([0-9]+) -p1/) {
- # copy the tree, apply the patch, diff and remove the old tree
- my $oldindex = $patchindex;
- $patchindex = $1;
-
- print "rediffing patch number $patchindex: $patchlist[$patchindex]\n";
-
- system("cp -al linux-$oldindex linux-$patchindex");
- chdir("linux-$patchindex");
- if ($patchlist[$patchindex] =~ /bz2/) {
- system("bzcat $origdir/$patchlist[$patchindex] | patch -p1 &>/dev/null");
- } else {
- system("cat $origdir/$patchlist[$patchindex] | patch -p1 &>/dev/null");
- }
- chdir("$workdir");
- system("rm -f `find -name \"*orig\"`");
- if ($patchlist[$patchindex] =~ /bz2/) {
- } else {
- system("diff -urNp --exclude-from=/home/davej/.exclude linux-$oldindex linux-$patchindex | sed '$datestrip' > $patchlist[$patchindex]");
- }
- system("rm -rf linux-$oldindex");
- }
-};
-
-1;
OpenPOWER on IntegriCloud