rpms/kernel/F-11/scripts combine.sh, NONE, 1.1 sort-config, NONE, 1.1 check-TODO.sh, 1.2, 1.3 pull-upstreams.sh, 1.7, 1.8 rebase.sh, 1.26, 1.27

Kyle McMartin kyle at fedoraproject.org
Mon Jan 4 15:26:03 UTC 2010


Author: kyle

Update of /cvs/pkgs/rpms/kernel/F-11/scripts
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10342/scripts

Modified Files:
	check-TODO.sh pull-upstreams.sh rebase.sh 
Added Files:
	combine.sh sort-config 
Log Message:
* Fri Jan  1 2010 Kyle McMartin <kyle at redhat.com> 2.6.32.2-1
- Rebased F-11 to 2.6.32, still needs forward porting of patches.



--- NEW FILE combine.sh ---
#! /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


--- NEW FILE sort-config ---
#!/bin/bash

SRC=($(ls config-* 2>/dev/null))
TGT=($(ls kernel-*/linux-*.noarch/configs/kernel-2.6.*-*.config \
          kernel-*/linux-*.noarch/configs/kernel-2.6.*-*-debug.config 2>/dev/null))
TGT1=(${TGT[*]#kernel-*/linux-*.noarch/configs/kernel-2.6.*-})

if [ $# -lt 2 ] ; then
   echo -e "Usage:\n   $(basename $0) [-dfcn] input target\n"
   echo -e " Sort input config file into the same order as the target\n"
   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 "      -c: insert comments about non-matching 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 "dfcn" OPTION ; do
case $OPTION in
d)
   DEBUG=1
;;
f)
   FORCE=1
;;
c)
   ADDCOMMENT=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))

if [ -f xx00 -o -f xx01 -o -f xx99 ] ; 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 xx00 xx01 xx99

SRCFILE=config-$1
[ ! -f $SRCFILE ] && echo "Input file" $SRCFILE "missing" && exit 2

TGTFILE=kernel-*/linux-*.noarch/configs/kernel-2.6.*-$2.config
[ ! -f $TGTFILE ] && echo "No target file matching" $TGTFILE "exists" && exit 2

IX=0
IN=0
declare -a SAVECOMMENT

cat ${SRCFILE} | while read TEXT ; do

   LINE=
   COMMENT=
   [ -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"

         # see if option changed in output file
         OPTNAME=
         if [ "${TEXT:0:7}" = "CONFIG_" ] ; then
            OPTNAME=${TEXT%%=*}
         elif [ "${TEXT:0:9}" = "# CONFIG_" ] ; then
            OPTNAME=${TEXT%" is not set"}
            OPTNAME=${OPTNAME#\# }
         fi
         if [ "$OPTNAME" ] ; 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

      fi

   else
      COMMENT="$TEXT"
      TEXT=
   fi

   [ "$DEBUG" -a "$COMMENT" ] && echo "comment     ->" "$LINE" "$COMMENT"
   [ "$DEBUG" -a "$TEXT" ]    && echo "text        ->" "$LINE" "$TEXT"

   if [ "$TEXT" ] ; then

      # use input line numbers if not sorting
      [ "$NOSORT" ] && LINE=$IN
      # make sure it has a line number
      [ -z "$LINE" ] && LINE=999999

      # print saved comments first
      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
      [ "$COMMENT" ] && echo "$LINE":"$COMMENT"
      echo "$LINE":"$TEXT"

   else

      # no output yet, save the comment
      SAVECOMMENT[$IX]="$COMMENT"
      [ "$DEBUG" ] && echo "savecomment ->" "$LINE" "${SAVECOMMENT[$IX]}"
      (( IX++ ))

   fi

   ((IN++))

done > xx99

if [ "$DEBUG" ] ; then
   cat xx99
else

   cat xx99 | sort -s -t ":" -k 1g | csplit -k -s - /^999999/ 2>/dev/null

   cat xx00 | cut -f 2- -d ':'
   if [ -s xx01 ] ; then
      echo
      echo '# ------------  UNMATCHED OPTIONS  ------------'
      echo
      cat xx01 | cut -f 2- -d ':'
   fi

fi

rm -f xx00 xx01 xx99


Index: check-TODO.sh
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/scripts/check-TODO.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- check-TODO.sh	29 Dec 2008 03:21:40 -0000	1.2
+++ check-TODO.sh	4 Jan 2010 15:26:02 -0000	1.3
@@ -10,7 +10,7 @@ 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 ApplyPatch | awk '{ print $2 }' | wc -l)
+   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.


Index: pull-upstreams.sh
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/scripts/pull-upstreams.sh,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -p -r1.7 -r1.8
--- pull-upstreams.sh	2 Jun 2009 20:44:56 -0000	1.7
+++ pull-upstreams.sh	4 Jan 2010 15:26:02 -0000	1.8
@@ -1,6 +1,8 @@
 #!/bin/bash
 
-url=http://people.redhat.com/roland/utrace/${1:-2.6.29}
+utrace_base=2.6.32
+
+url=http://people.redhat.com/roland/utrace/${1:-$utrace_base}
 
 wget -q -O /dev/stdout $url/series | grep 'patch$' |
 while read i


Index: rebase.sh
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/scripts/rebase.sh,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- rebase.sh	23 Feb 2009 08:12:20 -0000	1.26
+++ rebase.sh	4 Jan 2010 15:26:03 -0000	1.27
@@ -29,12 +29,12 @@ else
 fi
 
 # Is there a new snapshot or prepatch ?
-NEW=`curl -s http://www.kernel.org/kdist/finger_banner | grep "snapshot for the stable"`
+NEW=`curl -s http://www.kernel.org/kdist/finger_banner | grep "latest snapshot 2.6 version"`
 if [ -z "$NEW" ] ; then
-  NEW=`curl -s http://www.kernel.org/kdist/finger_banner | grep "prepatch for the stable"`
+  NEW=`curl -s http://www.kernel.org/kdist/finger_banner | grep "latest mainline 2.6 version"`
   if [ -z "$NEW" ] ; then
     if [ "$OLDRC" -ne 0 ] ; then
-      NEW=`curl -s http://www.kernel.org/kdist/finger_banner | grep "stable version of the Linux kernel is"`
+      NEW=`curl -s http://www.kernel.org/kdist/finger_banner | grep "latest stable 2.6." | head -n1`
     else
       echo "No new rc or git snapshot of stable branch".
       exit 0




More information about the scm-commits mailing list