www-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

www/server/standards boilerplate.html patch-fro...


From: Karl Berry
Subject: www/server/standards boilerplate.html patch-fro...
Date: Tue, 27 Oct 2009 23:25:04 +0000

CVSROOT:        /web/www
Module name:    www
Changes by:     Karl Berry <karl>       09/10/27 23:25:04

Modified files:
        server/standards: boilerplate.html 
Added files:
        server/standards: patch-from-parent 

Log message:
        boilerplate and patch-from-parent

CVSWeb URLs:
http://web.cvs.savannah.gnu.org/viewcvs/www/server/standards/boilerplate.html?cvsroot=www&r1=1.45&r2=1.46
http://web.cvs.savannah.gnu.org/viewcvs/www/server/standards/patch-from-parent?cvsroot=www&rev=1.1

Patches:
Index: boilerplate.html
===================================================================
RCS file: /web/www/www/server/standards/boilerplate.html,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- boilerplate.html    12 Aug 2009 23:09:30 -0000      1.45
+++ boilerplate.html    27 Oct 2009 23:24:54 -0000      1.46
@@ -1,7 +1,9 @@
+<!-- Parent-Version: $Revision: 1.46 $ -->
+
 <!-- Instructions for adapting this boilerplate to a new project: -->
 
-<!-- 1. In the line below starting "Parent-Version:", remove the -->
-<!--    "$Revision: 1.45 $" from around the revision number, -->
+<!-- 1. In the line above starting "Parent-Version:", remove the -->
+<!--    "$Revision: 1.46 $" from around the revision number, -->
 <!--    leaving just the number. -->
 
 <!-- 2. Replace "baz" with the name of your project. -->
@@ -9,13 +11,16 @@
 <!--    making sure that the search is case insensitive and -->
 <!--    that the case of the replacement matches the case -->
 <!--    of the string found. In Emacs, query-replace will do this -->
-<!--    when case-fold-search and case-replace are both non-nil, -->
+<!--    when case-fold-search and case-replace are both non-nil -->
 <!--    and both search and replacement string are given in lower case. -->
 
 <!-- 3. Of course update the actual information according to your project, -->
 <!--    such as mailing lists, project locations, and maintainer name.  -->
 
-<!-- Parent-Version: $Revision: 1.45 $ -->
+<!-- 4. You can use the patch-from-parent script to semi-automate -->
+<!--    merging future changes to the boilerplate with your file.  -->
+<!-- 
http://web.cvs.savannah.gnu.org/viewvc/*checkout*/www/server/standards/patch-from-parent?root=www&content-type=text%2Fplain
 -->
+
 <!--#include virtual="/server/header.html" -->
 <title>Baz
 - GNU Project - Free Software Foundation</title>
@@ -192,7 +197,7 @@
 
 <p>Updated:
 <!-- timestamp start -->
-$Date: 2009/08/12 23:09:30 $
+$Date: 2009/10/27 23:24:54 $
 <!-- timestamp end -->
 </p>
 </div>

Index: patch-from-parent
===================================================================
RCS file: patch-from-parent
diff -N patch-from-parent
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patch-from-parent   27 Oct 2009 23:24:54 -0000      1.1
@@ -0,0 +1,54 @@
+#!/bin/sh
+# $Id: patch-from-parent,v 1.1 2009/10/27 23:24:54 karl Exp $
+# patch-from-parent
+# Patch a file in CVS from a notional "parent" from which it "inherits".
+# http://www.gnu.org/server/standards/boilerplate.html is one likely parent.
+
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Originally written by Reuben Thomas.
+
+program=`basename $0`
+
+if [ $# -lt 2 ]; then
+    echo Usage: $program FILE PARENT-PATH
+    echo Patch a file from a parent in a different repository
+    echo FILE can be a relative path but PARENT-PATH must be absolute
+    echo The previous version of the parent used is given by a Parent-Version: 
tag,
+    echo which is updated by the script.
+    echo
+    echo Typical usage:
+    echo
+    echo   1. Run $program foo.html /path/to/parent.html
+    echo   2. foo.html will be updated
+    echo   3. Resolve any conflicts
+    exit 1
+fi
+
+FILE=$1
+FILE_PATH=`pwd`/$1
+PARENT_FILE=$2
+PARENT_BASE=`basename $PARENT_FILE`
+PARENT_DIR=`dirname $PARENT_FILE`
+
+CURRENT_VERSION=`sed -n '/Parent-Version:/{p;q;}' $FILE | sed -e 
's/^.*Parent-Version: \([a-z0-9._-]\+\).*$/\1/i'`
+
+( cd $PARENT_DIR
+    NEW_VERSION=`cvs stat $PARENT_BASE | grep Working | cut -f 2`
+    sed -i -e 's/\(Parent-Version: \)\([a-z0-9._-]\/+\)/\1'$NEW_VERSION'/i' 
$FILE_PATH
+    cvs up $PARENT_BASE
+    cvs diff -r $CURRENT_VERSION $PARENT_BASE ) |
+patch $FILE




reply via email to

[Prev in Thread] Current Thread [Next in Thread]