[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] patch for alternate setup mode
From: |
Brian J. Murrell |
Subject: |
[Quilt-dev] patch for alternate setup mode |
Date: |
Wed, 08 Feb 2006 12:34:03 -0500 |
Hello,
I work for Cluster File Systems. One of my current projects is to
(finally) eliminate our use of a custom version of quilt (the b_cfs
branch). It seems that "stock quilt" comes very close to allowing us to
do this with the exception of the "setup" step.
As per a previous conversation with Andreas, please find the patch
below. It allows one to do this:
$ quilt setup -l path/to/series/file -d path/to/patches/directory
This setup mode assumes that the series file is a list of patch files
and that the patch files listed in there are in the
path/to/patches/directory. These setup switches create symbolic links
in . to the specified series file and patches directory. i.e.:
lrwxrwxrwx 1 brian brian 53 Feb 8 12:04 series ->
../b1_4/lustre/kernel_patches/series/2.6-rhel4.series
lrwxrwxrwx 1 brian brian 39 Feb 8 12:04 patches ->
../b1_4/lustre/kernel_patches/patches///
One can then do quilt push/pop operations normally.
I realize we are overloading the use of the -d switch for setup. This
is desirable to us as it would mean not having to disseminate new
instructions to a pool of users already familiar with it and AFAICS,
users desiring the -l/-d mode for setup would not be interested in -d's
incumbent use so this shouldn't really pose a problem. I am not tied to
the overloading however and would be willing to use another switch.
Comments?
b.
Index: quilt/setup.in
===================================================================
RCS file: /sources/quilt/quilt/quilt/setup.in,v
retrieving revision 1.24
diff -u -p -b -r1.24 setup.in
--- quilt/setup.in 14 Jan 2006 10:24:08 -0000 1.24
+++ quilt/setup.in 8 Feb 2006 17:30:49 -0000
@@ -24,15 +24,18 @@ fi
usage()
{
- printf $"Usage: quilt setup [-d path-prefix] [-v]
{specfile|seriesfile}\n"
+ printf $"Usage: quilt setup [-v] {[-l seriesfile -d patches-path]|[-d
path-prefix] {specfile|seriesfile}}\n"
if [ x$1 = x-h ]
then
printf $"
Initializes a source tree from an rpm spec file or a quilt series file.
--d optional path prefix (sub-directory).
+-d optional path prefix (sub-directory) or patches directory to
+ symlink to if used with -l.
-v verbose debug output.
+
+-l create a symbolic link to the series file.
"
exit 0
else
@@ -40,7 +43,7 @@ Initializes a source tree from an rpm sp
fi
}
-options=`getopt -o d:vh -- "$@"`
+options=`getopt -o d:vhl: -- "$@"`
if [ $? -ne 0 ]
then
@@ -50,6 +53,8 @@ fi
eval set -- "$options"
prefix=
+symlink_series=false
+series_path=""
while true
do
@@ -62,17 +67,16 @@ do
-v)
verbose=-v
shift ;;
+ -l)
+ symlink_series=true
+ series_path=${2}
+ shift 2 ;;
--)
shift
break ;;
esac
done
-if [ $# -ne 1 ]
-then
- usage
-fi
-
up() {
if [ "${1:0:1}" = / ]
then
@@ -109,6 +113,21 @@ check_for_existing_files() {
tmpfile=$(gen_tempfile)
trap "rm -f $tmpfile" EXIT
+if $symlink_series; then
+ if [ -z "$prefix" ]; then
+ usage
+ else
+ ln -s $prefix patches
+ fi
+ ln -s $series_path series
+ exit 0
+fi
+
+if [ $# -ne 1 ]
+then
+ usage
+fi
+
case "$1" in
*.spec)
spec_file="$1"
signature.asc
Description: This is a digitally signed message part
- [Quilt-dev] patch for alternate setup mode,
Brian J. Murrell <=