I just found "diff -U 1" did the trick in this case :)
Thanks,
Raymond
On 03/31/09, Raymond Xiong wrote:
> Hi
>
> I am porting a package and have generated serveral patch files
> for it. I encountered an issue while checking in one of these
> patch files into my ws because it contained SCCS keywords
> (note the "DATETIME=..." line):
>
> --8<--
>
> $ cat ejabberdctl.template.patch
> ...[snipped]...
> @@ -42,15 +42,15 @@
> ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES"
>
> # define additional environment variables
> -EJABBERD_EBIN=$ROOTDIR/var/lib/ejabberd/ebin
> -EJABBERD_MSGS_PATH=$ROOTDIR/var/lib/ejabberd/priv/msgs
> -EJABBERD_SO_PATH=$ROOTDIR/var/lib/ejabberd/priv/lib
> +ejabberd_ebin=${rootd...@libdir@/ejabberd/ebin
> +ejabberd_msgs_path=${rootd...@libdir@/ejabberd/priv/msgs
> +ejabberd_so_path=${rootd...@libdir@/ejabberd/priv/lib
> EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
> SASL_LOG_PATH=$LOGS_DIR/sasl.log
> DATETIME=`date +%Y%m%d-%H%M%S`
> ERL_CRASH_DUMP=$LOGS_DIR/erl_crash_$DATETIME.dump
> -ERL_INETRC=$ROOTDIR/etc/ejabberd/inetrc
> -HOME=$ROOTDIR/var/lib/ejabberd
> +erl_inetrc=${rootd...@sysconfdir@/ejabberd/inetrc
> +home=${rootd...@libdir@/ejabberd
>
> # export global variables
> export EJABBERD_CONFIG_PATH
>
> --8<--
>
> Does anyone know if it is possible to pass diff(1) some arguments
> to let it split the above hunk into two ones so the patch file
> won't contain the "DATETIME=..." line? I checked its man page
> and didn't find, so I changed the patch file manaully as below
> but unfortunately it didn't work:
>
> --8<--
>
> @@ -42,8 +42,8 @@
> ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES"
>
> # define additional environment variables
> -EJABBERD_EBIN=$ROOTDIR/var/lib/ejabberd/ebin
> -EJABBERD_MSGS_PATH=$ROOTDIR/var/lib/ejabberd/priv/msgs
> -EJABBERD_SO_PATH=$ROOTDIR/var/lib/ejabberd/priv/lib
> +ejabberd_ebin=${rootd...@libdir@/ejabberd/ebin
> +ejabberd_msgs_path=${rootd...@libdir@/ejabberd/priv/msgs
> +ejabberd_so_path=${rootd...@libdir@/ejabberd/priv/lib
> EJABBERD_LOG_PATH=$LOGS_DIR/ejabberd.log
> SASL_LOG_PATH=$LOGS_DIR/sasl.log
> @@ -51,6, +51,6 @@
> ERL_CRASH_DUMP=$LOGS_DIR/erl_crash_$DATETIME.dump
> -ERL_INETRC=$ROOTDIR/etc/ejabberd/inetrc
> -HOME=$ROOTDIR/var/lib/ejabberd
> +erl_inetrc=${rootd...@sysconfdir@/ejabberd/inetrc
> +home=${rootd...@libdir@/ejabberd
>
> # export global variables
> export EJABBERD_CONFIG_PATH
>
> --8<--
>
> Any suggestions? Or will I have to use a perl script, instead of
> patch file, to modify the original file? But that would be ugly
> because I need to make a lot of changes to that file.
>
> Thanks in advance.
>
> --
> Regards,
> Raymond
> _______________________________________________
> sfwnv-discuss mailing list
> sfwnv-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/sfwnv-discuss