diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-TODO.sh | 27 | ||||
-rwxr-xr-x | scripts/check-patchlist.sh | 113 | ||||
-rwxr-xr-x | scripts/combine.sh | 34 | ||||
-rw-r--r-- | scripts/configcommon.pl | 82 | ||||
-rw-r--r-- | scripts/configdiff.pl | 76 | ||||
-rwxr-xr-x | scripts/grab-logs.sh | 35 | ||||
-rwxr-xr-x | scripts/newpatch.sh | 42 | ||||
-rwxr-xr-x | scripts/sort-config | 226 |
8 files changed, 0 insertions, 635 deletions
diff --git a/scripts/check-TODO.sh b/scripts/check-TODO.sh deleted file mode 100755 index 7067f0b44..000000000 --- a/scripts/check-TODO.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -for i in `grep ^* TODO | awk '{ print $2 }'` -do - if [ ! -f $i ]; then - echo "$i referenced in the TODO, but isn't in CVS!" - fi; -done - -# sometimes dead stuff lingers in cvs, even though it's not in the specfile. -for i in *.patch -do - for j in $(grep $i kernel.spec | grep Apply.*Patch | awk '{ print $2 }' | wc -l) - do - if [ "$j" = "0" ]; then - echo $i is in CVS, but not applied in spec file. - grep $i TODO | awk '{ print $2 " is also still in the TODO" }' - fi - done -done - -#for i in `grep ApplyPatch kernel.spec | awk '{ print $2 }'` -#do -# R=$(grep $i TODO) -# echo "$i is in CVS, but not mentioned in the TODO!" -#done - diff --git a/scripts/check-patchlist.sh b/scripts/check-patchlist.sh deleted file mode 100755 index 134e41e97..000000000 --- a/scripts/check-patchlist.sh +++ /dev/null @@ -1,113 +0,0 @@ -#! /bin/sh -# This script was created in a effort to make patch management a bit easier. -# It list all the patches in the current tree and identifies if they are -# present in the kernel.spec, PatchList.txt, both files or neither. -# -# eg. ./check-patchlist.sh [optional flag] - -function usage(){ - echo "List all the patches currently in the tree. It also helps identify" - echo "if the patch is present in kernel.spec or PatchList.txt. " - echo "-h, --help " - echo "-t, --tracked patches in both kernel.spec and PatchList.txt " - echo "-p, --patchlist patches added to PatchList.txt. " - echo "-s, --specfile patches added to kernel.spec. " - echo "-n, --not-tracked patches in the tree but not in PatchList.txt " - echo " or kernel.spec " -} - -BASEDIR=$(dirname "$( cd $(dirname $BASH_SOURCE[0]) && pwd)") -pushd $BASEDIR > /dev/null - -function list_all(){ - echo "===========Legend===========================" - echo ". In kernel.spec " - echo "* In PatchList.txt " - echo "+ In PatchList.txt & Kernel.spec " - echo "- Neither in PatchList.txt nor kernel.spec" - echo "============================================" - for patch in $(ls *.patch); do - if [ ! -z "$(grep $patch PatchList.txt)" ] && [ ! -z "$(grep $patch kernel.spec)" ] - then - echo "+ ${patch}" # Patches in kernel.spec and PatchList.txt - - elif [ ! -z "$(grep $patch PatchList.txt)" ] && [ -z "$(grep $patch kernel.spec)" ] - then - echo "* ${patch}" # Patches in PatchList.txt but not in kernel.spec - - elif [ -z "$(grep $patch PatchList.txt)" ] && [ ! -z "$(grep $patch kernel.spec)" ] - then - echo ". ${patch}" # Patches in kernel.spec but not in PatchList.txt - - else - echo "- ${patch}" # Neither in PatchList.txt nor kernel.spec - - fi - done -} - -function list_present_not_added(){ - for patch in $(ls *.patch); do - if [ -z "$(grep $patch PatchList.txt)" ] && [ -z "$(grep $patch kernel.spec)" ] - then - echo $patch - fi - done -} - -function list_present_added(){ - for patch in $(ls *.patch); do - if [ ! -z "$(grep $patch PatchList.txt)" ] && [ ! -z "$(grep $patch kernel.spec)" ] - then - echo $patch - fi - done -} - -function list_patchList(){ - for patch in $(ls *.patch); do - if [ ! -z "$(grep $patch PatchList.txt)" ] && [ -z "$(grep $patch kernel.spec)" ] - then - echo $patch - fi - done - -} -function list_specfile(){ - for patch in $(ls *.patch); do - if [ -z "$(grep $patch PatchList.txt)" ] && [ ! -z "$(grep $patch kernel.spec)" ] - then - echo $patch - fi - done -} - -if [ -z "$@" ]; then - list_all -else - - for opt in "$@"; do - case $opt in - -t|--tracked) - list_present_added - ;; - -s|--specfile) - list_specfile - ;; - -h|--help) - usage - ;; - -n|--not-added) - list_present_not_added - ;; - -p|--patchlist) - list_patchList - ;; - *) - usage - ;; - esac - done -fi - -popd > /dev/null diff --git a/scripts/combine.sh b/scripts/combine.sh deleted file mode 100755 index 86a68d302..000000000 --- a/scripts/combine.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh - -# combine a set of quilt patches - -# $1 : base dir (source tree) -# $2 : quilt dir (patches to apply) -# $3 : pre-patch to apply first (optional) - -# e.g.: -# combine.sh /home/user/fedora/trunk/kernel/F-11/kernel-2.6.30/vanilla-2.6.30 \ -# /home/user/git/stable-queue/queue-2.6.30 \ -# /home/user/fedora/trunk/kernel/F-11/patch-2.6.30.5.bz2 - -if [ $# -lt 2 ] ; then - exit 1 -fi - -TD="combine_temp.d" - -cd $1 || exit 1 -cd .. -[ -d $TD ] && rm -Rf $TD -mkdir $TD || exit 1 -cd $TD - -cp -al ../$(basename $1) work.d -cd work.d -[ "$3" ] && bzcat $3 | patch -p1 -s -ln -s $2 patches -[ -h patches ] || exit 1 -quilt snapshot -quilt upgrade -quilt push -a -q -quilt diff --snapshot >../combined.patch diff --git a/scripts/configcommon.pl b/scripts/configcommon.pl deleted file mode 100644 index 38bbe80dc..000000000 --- a/scripts/configcommon.pl +++ /dev/null @@ -1,82 +0,0 @@ -#! /usr/bin/perl - -my @args=@ARGV; -my @configoptions; -my @configvalues; -my @common; -my $configcounter = 0; - -# first, read the 1st file - -open (FILE,"$args[0]") || die "Could not open $args[0]"; -while (<FILE>) { - my $str = $_; - if (/\# ([\w]+) is not set/) { - $configoptions[$configcounter] = $1; - $configvalues[$configcounter] = $str; - $common[$configcounter] = 1; - $configcounter ++; - } else { - if (/([\w]+)=/) { - $configoptions[$configcounter] = $1; - $configvalues[$configcounter] = $str; - $common[$configcounter] = 1; - $configcounter ++; - } else { - $configoptions[$configcounter] = "foobarbar"; - $configvalues[$configcounter] = $str; - $common[$configcounter] = 1; - $configcounter ++; - } - } -}; - -# now, read all configfiles and see of the options match the initial one. -# if not, mark it not common -my $cntr=1; - - -while ($cntr < @ARGV) { - open (FILE,$args[$cntr]) || die "Could not open $args[$cntr]"; - while (<FILE>) { - my $nooutput; - my $counter; - my $configname; - - if (/\# ([\w]+) is not set/) { - $configname = $1; - } else { - if (/([\w]+)=/) { - $configname = $1; - } - } - - $counter = 0; - $nooutput = 0; - while ($counter < $configcounter) { - if ("$configname" eq "$configoptions[$counter]") { - if ("$_" eq "$configvalues[$counter]") { - 1; - } else { - $common[$counter] = 0; - } - } - $counter++; - } - } - - $cntr++; -} - -# now print the common values -my $counter = 0; - -while ($counter < $configcounter) { - if ($common[$counter]!=0) { - print "$configvalues[$counter]"; - } - $counter++; -} - -1; - diff --git a/scripts/configdiff.pl b/scripts/configdiff.pl deleted file mode 100644 index 848d8df0f..000000000 --- a/scripts/configdiff.pl +++ /dev/null @@ -1,76 +0,0 @@ -#! /usr/bin/perl - -my @args=@ARGV; -my @configoptions; -my @configvalues; -my @alreadyprinted; -my $configcounter = 0; - -# first, read the override file - -open (FILE,"$args[0]") || die "Could not open $args[0]"; -while (<FILE>) { - my $str = $_; - if (/\# ([\w]+) is not set/) { - $configoptions[$configcounter] = $1; - $configvalues[$configcounter] = $str; - $alreadprinted[$configcounter] = 0; - $configcounter ++; - } else { - if (/([\w]+)=/) { - $configoptions[$configcounter] = $1; - $configvalues[$configcounter] = $str; - $alreadprinted[$configcounter] = 0; - $configcounter ++; - } else { - $configoptions[$configcounter] = "$_"; - $configvalues[$configcounter] = $str; - $alreadprinted[$configcounter] = 0; - $configcounter ++; - } - } -}; - -# now, read and output the entire configfile, except for the overridden -# parts... for those the new value is printed. -# O(N^2) algorithm so if this is slow I need to look at it later - -open (FILE2,"$args[1]") || die "Could not open $args[1]"; -while (<FILE2>) { - my $nooutput; - my $counter; - my $configname="$_"; - my $match; - - if (/\# ([\w]+) is not set/) { - $configname = $1; - } else { - if (/([\w]+)=/) { - $configname = $1; - } - } - - $counter = 0; - $nooutput = 0; - $match = 0; -# print "C : $configname"; - while ($counter < $configcounter) { - if ("$configname" eq "$configoptions[$counter]") { - if ( ("$_" eq "$configvalues[$counter]") || ("$configname" eq "") ) { - $match = 1; - } else { - $alreadyprinted[$configcounter] = 1; - print "$_"; - $match = 1; - } - } - $counter++; - } - if ($match == 0) { - print "$_"; - } - -} - - -1; diff --git a/scripts/grab-logs.sh b/scripts/grab-logs.sh deleted file mode 100755 index 571b503bb..000000000 --- a/scripts/grab-logs.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/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}') - -# keep logs in one place. If logs directory does not exist, make it. -if [ -d "$BASEDIR/logs" ]; then - DIR="$BASEDIR/logs" -else - mkdir "$BASEDIR/logs" - DIR="$BASEDIR/logs" -fi - -# 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/scripts/newpatch.sh b/scripts/newpatch.sh deleted file mode 100755 index 2d7498655..000000000 --- a/scripts/newpatch.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh - -# Facilitates the addition of a new patch to the source tree. -# -- Moves patch to tree -# -- Adds patch to kernel.spec list of patches -# -- Adds patch to git -# -- change buildid macro to the name of the patch being added - -# Base directory is relative to where the script is. -BASEDIR="$(dirname "$(cd $(dirname $BASH_SOURCE[0]) && pwd)")" -pushd $BASEDIR > /dev/null -# Check for at least patch -if [ "$#" -lt 1 ]; then - echo "usage: $0 [ /path/to/patch/ ] [ description ]" - exit 1 -fi -PATCHDIR=$1 -DESC=$2 -PATCH="$(basename "$PATCHDIR")" -# Kernel.spec file in the current tree -SPECFILE="$BASEDIR/kernel.spec" -# If adding patch from outside the source tree move it to the source tree -if [ -z "$(ls | grep $PATCH)" ]; then - cp $PATCHDIR $BASEDIR/ -fi - -if [ ! -z "$(grep $PATCH $SPECFILE)" ] -then - echo "$PATCH already in kernel.spec" - exit 1 -fi -# ID number of the last patch in kernel.spec -LPATCH_ID=$(grep ^Patch $SPECFILE | tail -n1 | awk '{ print $1 }' | sed s/Patch// | sed s/://) -# ID of the next patch to be added to kernel.spec -NPATCH_ID=$(($LPATCH_ID + 1 )) -# Add patch with new id at the end of the list of patches -sed -i "/^Patch$LPATCH_ID:\ /a#\ $DESC\nPatch$NPATCH_ID:\ $PATCH" $SPECFILE -# Add it to git -git add $PATCH -BUILDID_PATCH="$(echo $PATCH | sed 's/\-/\_/g' )" -sed -i "s/^.*define buildid .*$/%define buildid .$BUILDID_PATCH/" $SPECFILE -popd > /dev/null diff --git a/scripts/sort-config b/scripts/sort-config deleted file mode 100755 index 399709f18..000000000 --- a/scripts/sort-config +++ /dev/null @@ -1,226 +0,0 @@ -#!/bin/bash - -FC=($(fedpkg verrel | awk -F. '{print $NF}')) - -SRC=($(ls config-* 2>/dev/null)) - -TGT=($(ls kernel-*.$FC/linux-*.$2/configs/kernel-*-*.config \ - kernel-*.$FC/linux-*.$2/configs/kernel-*-*-debug.config 2>/dev/null)) -TGT1=(${TGT[*]#kernel-*.$FC/linux-*.$2/configs/kernel-*-}) - -ALL_OPTS="cdfimn" - -if [ $# -lt 2 ] ; then - echo -e "Usage:\n $(basename $0) [-$ALL_OPTS] input target\n" - echo -e " Sort input config file into the same order as the target\n" - echo -e " -c: insert comments about non-matching/impossible items" - echo -e " -d: show raw unsorted output with extra debug text" - echo -e " -f: force output to match what is in the target config," - echo -e " and/or remove impossible config items" - echo -e " -i: find impossible config items" - echo -e " -m: find changed config items" - echo -e " -n: do not sort output\n" - echo -e " input: source config file" ' [' "${SRC[*]#config-}" ']\n' - echo -e " target: output arch name" ' [' "${TGT1[*]%.config}" ']\n' - exit 1 -fi - -while getopts "$ALL_OPTS" OPTION ; do -case $OPTION in -c) - ADDCOMMENT=1 ;; -d) - DEBUG=1 ;; -f) - FORCE=1 ;; -i) - FIND_IMPOSS=1 ;; -m) - FIND_CHANGED=1 ;; -n) - NOSORT=1 ;; -\?) - exit 2 ;; -esac -done - -if [ "$FORCE" -a "$ADDCOMMENT" ] ; then - echo "-f and -c options cannot be used together" - exit 2 -fi - -shift $((OPTIND-1)) - -TEMPFILES="xx00 xx01 xx98 xx99" -TEMPLEFT= -for FILE in $TEMPFILES ; do - [ -f "$FILE" ] && TEMPLEFT="Y" -done -if [ "$TEMPLEFT" ] ; then - echo "WARNING! Output files named xx?? already exist." >&2 - read -p "Press <Enter> to erase files, or Ctrl-C to exit..." - echo >&2 -fi -rm -f $TEMPFILES - -SRCFILE=config-$1 -[ ! -f $SRCFILE ] && echo "Input file" $SRCFILE "missing" && exit 2 - -TGTFILE=kernel-*.$FC/linux-*.$2/configs/kernel-*-$2.config -[ ! -f $TGTFILE ] && echo "No target file matching" $TGTFILE "exists" && exit 2 - -[ "$FIND_IMPOSS" ] && \ - find kernel-*.$FC/*.$2 -name Kconfig\* -type f \ - | xargs egrep -s -h '^[[:space:]]*(menu)?config[[:space:]]+' \ - | sed -r 's/^[[:space:]]*(menu)?config[[:space:]]+/CONFIG_/' \ - | sort | uniq >xx98 - -extract_optname() { - # extract the option name from $TEXT, setting $OPTNAME - OPTNAME= - if [ "${TEXT:0:7}" = "CONFIG_" ] ; then - OPTNAME=${TEXT%%=*} - elif [ "${TEXT:0:9}" = "# CONFIG_" ] ; then - OPTNAME=${TEXT%" is not set"} - OPTNAME=${OPTNAME#\# } - fi -} - -print_saved_comments() { - if [ $IX -gt 0 ] ; then - [ "$DEBUG" ] && echo " ->" $IX "comments were saved" - (( IX-- )) - for IX in $(seq 0 $IX) ; do - echo "$LINE":"${SAVECOMMENT[$IX]}" - done - unset SAVECOMMENT - IX=0 - fi -} - -assign_line_number() { - # use input line numbers if not sorting - [ "$NOSORT" ] && LINE=$IN - # make sure it has a line number - [ -z "$LINE" ] && LINE=999999 -} - -IX=0 -IN=0 -declare -a SAVECOMMENT - -cat ${SRCFILE} | { -while read TEXT ; do - - LINE= - COMMENT= - - # replace empty lines - [ -z "$TEXT" ] && TEXT='//' - - if [ "${TEXT:0:7}" = "CONFIG_" -o "${TEXT:0:9}" = "# CONFIG_" ] ; then - - LINE=$(grep -n "^$TEXT" $TGTFILE | head -1 | cut -f 1 -d ':') - if [ -z "$LINE" ] ; then - [ "$DEBUG" ] && echo "nofind ->" "$TEXT" - - extract_optname - if [ "$OPTNAME" ] ; then - - if [ "$FIND_CHANGED" ] ; then - for FINDTEXT in "^${OPTNAME}=" "^# ${OPTNAME} is not set" ; do - if [ -z "$LINE" ] ; then - [ "$DEBUG" ] && echo "looking for ->" "$FINDTEXT" - LINE=$(grep -n "$FINDTEXT" $TGTFILE | head -1 | cut -f 1 -d ':') - if [ "$LINE" ] ; then - CHANGED=$(grep "$FINDTEXT" $TGTFILE | head -1) - if [ "$FORCE" ] ; then - TEXT=$CHANGED - [ "$DEBUG" ] && echo 'forced ->' "$TEXT" - else - if [ "$ADDCOMMENT" ] ; then - if [ ${CHANGED:0:1} = '#' ] ; then - NEWOPT="not set" - else - NEWOPT=${CHANGED#$OPTNAME} - fi - COMMENT="# -- Next option changed to \"${NEWOPT}\" at target line $LINE --" - fi - fi - fi - fi - done - fi - - if [ "$FIND_IMPOSS" -a -z "$LINE" -a -z "$COMMENT" ] ; then - POSSIBLE=$(grep -n "^$OPTNAME" xx98) - if [ -z "$POSSIBLE" ] ; then - if [ "$ADDCOMMENT" ] ; then - COMMENT="# -- Next option is impossible --" - elif [ "$FORCE" ] ; then - [ "$DEBUG" ] && echo 'impossible ->' "$TEXT" - TEXT="" - fi - fi - fi - - fi - - fi - - else - # not a config variable - COMMENT="$TEXT" - TEXT= - fi - - [ "$DEBUG" -a "$COMMENT" ] && echo "comment ->" "$LINE" "$COMMENT" - [ "$DEBUG" -a "$TEXT" ] && echo "text ->" "$LINE" "$TEXT" - - if [ "$TEXT" ] ; then - - assign_line_number - - # print the saved comments first - print_saved_comments - # now print the latest comment and text - [ "$COMMENT" ] && echo "$LINE":"$COMMENT" - echo "$LINE":"$TEXT" - - elif [ "$COMMENT" ] ; then - - # no output yet, save the comment - SAVECOMMENT[$IX]="$COMMENT" - let IX++ - [ "$DEBUG" ] && echo 'savecomment (#'${IX}')' - - fi - - let IN++ - -done -# flush the buffers -assign_line_number -print_saved_comments -[ "$DEBUG" ] && echo "$IN lines read from input" -} >xx99 - -if [ "$DEBUG" ] ; then - # just show the raw output with debug info, then exit - cat xx99 -else - - # split output into two files, for matched and unmatched items - cat xx99 | sort -s -t ":" -k 1g | csplit -k -s - /^999999/ 2>/dev/null - - cat xx00 | cut -f 2- -d ':' | sed 's/^\/\/$//' - if [ -s xx01 ] ; then - echo - echo '# ------------ UNMATCHED OPTIONS ------------' - echo - cat xx01 | cut -f 2- -d ':' | sed 's/^\/\/$//' - fi - -fi - -rm -f $TEMPFILES |