ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/pack/freebsd/libexec/diff.sh
Revision: 641
Committed: 2014-05-25T23:59:01-07:00 (11 years ago) by douglas
Content type: text/x-sh
File size: 891 byte(s)
Log Message:
Diff formatted like Subversion.


File Contents

# Content
1 #!/usr/local/bin/bash
2 # Diff
3 #
4 # Douglas Thrift
5 #
6 # $Id$
7
8 summary='Create a diff patch of a port'
9 declare -A options
10 declare -A arguments
11
12 function svn_diff()
13 {
14 svn_revision=`git svn find-rev remotes/origin/svn_head`
15 git diff --no-prefix master | gsed -e 's/^index .*$/===================================================================/' \
16 -e 's/^diff --git \(.*\) \1$/Index: \1/' \
17 -e "s/^--- .*$/&\t(revision $svn_revision)/" \
18 -e 's/^+++ .*$/&\t(working copy)/'
19 }
20
21 function execute()
22 {
23 tool git devel/git-subversion
24 tool gsed ports/textproc/gsed
25 tool svn devel/subversion
26
27 svn_diff | cdiff
28
29 help diff
30
31 diff="diff/$category_port/$port.`date -u +%Y-%m-%dT%H%M%SZ`.diff"
32
33 svnmkdir `dirname $diff`
34 sanitize_freebsd_ids
35 (cd $category; diff -Nrux .svn -x work /usr/ports/$category_port $port) | tee $diff
36 unsanitize_freebsd_ids
37 svn add $diff
38 }
39
40 # vim: noexpandtab tabstop=4

Properties

Name Value
svn:keywords Id