rpms/kernel/devel/scripts sort-config,1.4.2.2,1.4.2.3
myoung
myoung at fedoraproject.org
Sat Sep 19 16:47:33 UTC 2009
- Previous message: rpms/bouml/devel .cvsignore, 1.20, 1.21 bouml.spec, 1.29, 1.30 sources, 1.22, 1.23
- Next message: rpms/kernel/devel drm-intel-no-tv-hotplug.patch, NONE, 1.1.2.1 linux-2.6-iwlagn-modify-digital-SVR-for-1000.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-Handle-new-firmware-file-with-ucode-build-number-in-header.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-fix-debugfs-buffer-handling.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-fix-unloading-driver-while-scanning.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-remove-deprecated-6000-series-adapters.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-traverse-linklist-to-find-the-valid-OTP-block.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-update-1000-series-API-version-to-match-firmware.patch, NONE, 1.1.2.1 linux-2.6-raidlockdep.patch, NONE, 1.1.2.1 linux-2.6-selinux-module-load-perms.patch, NONE, 1.1.2.1 linux-2.6.31-cpufreq-powernow-k8-oops.patch, NONE, 1.1.2.1 linux-2.6.31-cpuidle-faster-io.patch, NONE, 1.1.2.1 ppc-hates-my-family-and-swore-revenge.patch, NONE, 1.1.2.1 Makefile, 1.97.6.6, 1.97.6.7 config-powerpc64, 1.27.6.4, 1.27.6.5 drm-nouveau.patch, 1.8.6.18, 1.8.6.19 kernel.spec, 1.1294.2.67, 1.1294.2.68 xen.pvops.patch, 1.1.2.42, 1.1.2.43 xen.pvops.post.patch, 1.1.2.27, 1.1.2.28 drm-page-flip.patch, 1.2.6.5, NONE linux-2.6-mac80211-age-scan-results-on-resume.patch, 1.1.10.2, NONE linux-2.6-rt2x00-asus-leds.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: myoung
Update of /cvs/pkgs/rpms/kernel/devel/scripts
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12113/scripts
Modified Files:
Tag: private-myoung-dom0-branch
sort-config
Log Message:
Switch pvops from rebase/master to xen/master branch
Index: sort-config
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/scripts/sort-config,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -u -p -r1.4.2.2 -r1.4.2.3
--- sort-config 20 Aug 2009 18:50:24 -0000 1.4.2.2
+++ sort-config 19 Sep 2009 16:47:33 -0000 1.4.2.3
@@ -5,35 +5,38 @@ TGT=($(ls kernel-*/linux-*.noarch/config
kernel-*/linux-*.noarch/configs/kernel-2.6.*-*-debug.config 2>/dev/null))
TGT1=(${TGT[*]#kernel-*/linux-*.noarch/configs/kernel-2.6.*-})
+ALL_OPTS="cdfimn"
if [ $# -lt 2 ] ; then
- echo -e "Usage:\n $(basename $0) [-dfcn] input target\n"
+ 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 " -c: insert comments about non-matching items"
+ 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 "dfcn" OPTION ; do
+while getopts "$ALL_OPTS" OPTION ; do
case $OPTION in
+c)
+ ADDCOMMENT=1 ;;
d)
- DEBUG=1
-;;
+ DEBUG=1 ;;
f)
- FORCE=1
-;;
-c)
- ADDCOMMENT=1
-;;
+ FORCE=1 ;;
+i)
+ FIND_IMPOSS=1 ;;
+m)
+ FIND_CHANGED=1 ;;
n)
- NOSORT=1
-;;
+ NOSORT=1 ;;
\?)
- exit 2
-;;
+ exit 2 ;;
esac
done
@@ -44,12 +47,17 @@ fi
shift $((OPTIND-1))
-if [ -f xx00 -o -f xx01 -o -f xx99 ] ; then
+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 xx00 xx01 xx99
+rm -f $TEMPFILES
SRCFILE=config-$1
[ ! -f $SRCFILE ] && echo "Input file" $SRCFILE "missing" && exit 2
@@ -57,11 +65,48 @@ SRCFILE=config-$1
TGTFILE=kernel-*/linux-*.noarch/configs/kernel-2.6.*-$2.config
[ ! -f $TGTFILE ] && echo "No target file matching" $TGTFILE "exists" && exit 2
+[ "$FIND_IMPOSS" ] && \
+ find kernel-*/*.noarch -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
+cat ${SRCFILE} | {
+while read TEXT ; do
LINE=
COMMENT=
@@ -73,42 +118,52 @@ cat ${SRCFILE} | while read TEXT ; do
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
+ extract_optname
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}
+
+ 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
- COMMENT="# -- Next option changed to \"${NEWOPT}\" at target line $LINE --"
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
- done
+ fi
+
fi
fi
else
+ # not a config variable
COMMENT="$TEXT"
TEXT=
fi
@@ -118,41 +173,37 @@ cat ${SRCFILE} | while read TEXT ; do
if [ "$TEXT" ] ; then
- # use input line numbers if not sorting
- [ "$NOSORT" ] && LINE=$IN
- # make sure it has a line number
- [ -z "$LINE" ] && LINE=999999
+ assign_line_number
- # 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
+ # print the saved comments first
+ print_saved_comments
+ # now print the latest comment and text
[ "$COMMENT" ] && echo "$LINE":"$COMMENT"
echo "$LINE":"$TEXT"
- else
+ elif [ "$COMMENT" ] ; then
# no output yet, save the comment
SAVECOMMENT[$IX]="$COMMENT"
- [ "$DEBUG" ] && echo "savecomment ->" "$LINE" "${SAVECOMMENT[$IX]}"
- (( IX++ ))
+ let IX++
+ [ "$DEBUG" ] && echo 'savecomment (#'${IX}')'
fi
- ((IN++))
+ let IN++
-done > xx99
+done
+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 ':'
@@ -165,4 +216,4 @@ else
fi
-rm -f xx00 xx01 xx99
+rm -f $TEMPFILES
- Previous message: rpms/bouml/devel .cvsignore, 1.20, 1.21 bouml.spec, 1.29, 1.30 sources, 1.22, 1.23
- Next message: rpms/kernel/devel drm-intel-no-tv-hotplug.patch, NONE, 1.1.2.1 linux-2.6-iwlagn-modify-digital-SVR-for-1000.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-Handle-new-firmware-file-with-ucode-build-number-in-header.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-fix-debugfs-buffer-handling.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-fix-unloading-driver-while-scanning.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-remove-deprecated-6000-series-adapters.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-traverse-linklist-to-find-the-valid-OTP-block.patch, NONE, 1.1.2.1 linux-2.6-iwlwifi-update-1000-series-API-version-to-match-firmware.patch, NONE, 1.1.2.1 linux-2.6-raidlockdep.patch, NONE, 1.1.2.1 linux-2.6-selinux-module-load-perms.patch, NONE, 1.1.2.1 linux-2.6.31-cpufreq-powernow-k8-oops.patch, NONE, 1.1.2.1 linux-2.6.31-cpuidle-faster-io.patch, NONE, 1.1.2.1 ppc-hates-my-family-and-swore-revenge.patch, NONE, 1.1.2.1 Makefile, 1.97.6.6, 1.97.6.7 config-powerpc64, 1.27.6.4, 1.27.6.5 drm-nouveau.patch, 1.8.6.18, 1.8.6.19 kernel.spec, 1.1294.2.67, 1.1294.2.68 xen.pvops.patch, 1.1.2.42, 1.1.2.43 xen.pvops.post.patch, 1.1.2.27, 1.1.2.28 drm-page-flip.patch, 1.2.6.5, NONE linux-2.6-mac80211-age-scan-results-on-resume.patch, 1.1.10.2, NONE linux-2.6-rt2x00-asus-leds.patch, 1.1, NONE
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list