echo $1 | sed -e 's/^\(.*\)-\([0-9][0-9]\)-\(.*\)$/\2/'
}
echo $1 | sed -e 's/^\(.*\)-\([0-9][0-9]\)-\(.*\)$/\1/'
}
echo $1 | sed -e 's/^\(.*\)-\([0-9][0-9]\)-\(.*\)$/\3/'
}
else
echo "WARNING: $3.spec not found"
fi
}
# ask "question" variable_name "default answer"
echo -n "$1"
if [ ! -z $3 ]; then
echo -n " [$3]: "
else
echo -n ": "
fi
read -e val
eval "$2=\"$3\""
else
eval "$2=\"$val\""
fi
}
# ask_yes_no "question" variable_name "default answer"
while [ $yes_no_repeat = yes ]; do
ask "${@}"
eval "the_ans=\"\$$2\""
eval "$2=yes"
;;
eval "$2=no"
;;
* )
echo "Please answer yes or no"
esac
done
}
echo "Usage: $0 [options] [component...]"
echo
echo "Run this script in the patches subdirectory to reorder"
echo "the patch numbers to be continuous and starting from 01"
echo
echo "If no components are specified, it'll check all of them."
echo "It does not change the Patch<n> and %patch<n> numbers"
echo "in the spec files, but updates the file names with the"
echo "new patch numbers."
echo
echo "Options:"
echo
echo " -f, --force don't ask for confirmation"
echo " -h, --help print this usage info"
}
FORCE=0
while [ $# -gt 0 ]; do
case $1 in
-f|--force )
FORCE=1
;;
-h|--help )
exit 0
;;
-* )
echo "Unknown option: $1"
exit 1
;;
* )
break
esac
done
if [ $mybasename != patches ]; then
echo "Run this script in the patches subdirectory"
exit 1
fi
if [ $# -gt 0 ]; then
comp_PLIST=$(eval echo $comp-[0-9][0-9]-*.diff)
if [ -f $n_p_1st ]; then
else
echo "No patches found for component $comp"
fi
done
else
fi
if [ $comp != $prev_comp ]; then
ord=01
echo "No patches need renumbering for component $prev_comp"
fi
else
fi
if [ $FORCE = 0 ]; then
fi
else
fi
fi
done
echo "No patches need renumbering for component $prev_comp"
fi