Merge lp:~jr.allen/unifield-toolbox/py27 into lp:unifield-toolbox

Proposed by Jeff Allen
Status: Needs review
Proposed branch: lp:~jr.allen/unifield-toolbox/py27
Merge into: lp:unifield-toolbox
Diff against target: 223 lines (+0/-209)
3 files modified
PatchTools/make_patch.bash (+0/-4)
PatchTools/make_patch.py (+0/-125)
PatchTools/set_win_tree.bash (+0/-80)
To merge this branch: bzr merge lp:~jr.allen/unifield-toolbox/py27
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+329810@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

238. By Jeff Allen

Remove tools that have been moved to https://code.launchpad.net/~unifield-team/unifield-wm/packaging_py27

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'PatchTools/make_patch.bash'
2--- PatchTools/make_patch.bash 2017-05-16 13:35:42 +0000
3+++ PatchTools/make_patch.bash 1970-01-01 00:00:00 +0000
4@@ -1,4 +0,0 @@
5-#! /bin/bash
6-
7-echo "This script has been replaced by make_patch.py."
8-exit 1
9
10=== removed file 'PatchTools/make_patch.py'
11--- PatchTools/make_patch.py 2017-07-25 07:40:49 +0000
12+++ PatchTools/make_patch.py 1970-01-01 00:00:00 +0000
13@@ -1,125 +0,0 @@
14-#!/usr/bin/env python
15-
16-import sys
17-import os
18-import zipfile
19-import time
20-import re
21-import filecmp
22-
23-if len(sys.argv) != 4:
24- print 'Expected 3 arguments: <from_tree> <to_tree> <patch_zip_name>'
25- sys.exit()
26-
27-# Skip things that do not belong in patch files.
28-def should_skip(name):
29- return (name.endswith('.pyc') or
30- name in [
31- # this will be added at the end of this script instead
32- 'release.py',
33- # these are related to the AIO and should not go in the patch
34- 'Uninstall.exe',
35- 'web/Uninstall.exe',
36- 'setup.py',
37- 'setup_py2exe_custom.py',
38- # these config files on the end-user installs should never
39- # be overwritten
40- 'openerp-server.conf',
41- 'web/conf/openerp-web-oc.cfg',
42- ])
43-
44-# Change the directory from the filesystem into a destination directory in
45-# the patchfile (this mapping was set by the implementation of
46-# updater.py)
47-
48-def dirmap(directory):
49- directory = directory.replace(sys.argv[2], '')
50- if directory.startswith('/'):
51- directory = directory[1:]
52- # unpdater.py expects lower case
53- if directory.startswith('Web'):
54- directory = 'w' + directory[1:]
55- # change directory Server/foo to foo
56- if directory == 'Server':
57- directory = ''
58- elif directory.startswith('Server/'):
59- directory = directory[7:]
60- return directory
61-
62-# The plan:
63-#
64-# for each file in the original distribution:
65-# remember it's name
66-# if not in new distribution:
67-# add to delete list
68-# else
69-# if new distribution version is different:
70-# add to patch file
71-# for each file in the new distribution:
72-# if we did not already see it:
73-# add to patch file
74-
75-deleted = []
76-seen = {}
77-
78-old = sys.argv[1]
79-new = sys.argv[2]
80-zf = zipfile.ZipFile(sys.argv[3], mode='w', compression=zipfile.ZIP_DEFLATED)
81-
82-for (dirpath, dirnames, filenames) in os.walk(old):
83- relpath = dirpath.replace(old, '')
84- if len(relpath) > 0 and relpath[0] == '/':
85- relpath = relpath[1:]
86- if relpath == 'ServerLog':
87- continue
88- for f in filenames:
89- oldf = os.path.join(dirpath, f)
90- newf = os.path.join(new, relpath, f)
91- dest = os.path.join(dirmap(relpath), f)
92- if should_skip(dest):
93- continue
94- if not os.path.exists(newf):
95- print "del %s" % dest
96- deleted.append(dest)
97- elif not filecmp.cmp(oldf, newf, False):
98- print "write mod %s" % dest
99- zf.write(newf, dest)
100- seen[dest] = True
101-
102-for (dirpath, dirnames, filenames) in os.walk(new):
103- relpath = dirpath.replace(new, '')
104- if len(relpath) > 0 and relpath[0] == '/':
105- relpath = relpath[1:]
106- if relpath == 'ServerLog':
107- continue
108- for f in filenames:
109- newf = os.path.join(new, relpath, f)
110- dest = os.path.join(dirmap(relpath), f)
111- if should_skip(dest) or dest in seen:
112- continue
113- print "write add %s" % dest
114- zf.write(newf, dest)
115-
116-# special case for release.py: add the date onto the end of the
117-# given version
118-with open(os.path.join(new, 'Server', 'release.py')) as f:
119- lines = f.readlines()
120-out = []
121-for line in lines:
122- if line.startswith('version = '):
123- exec(line)
124- else:
125- out += line
126-
127-if not re.match('.*-[0-9]{8}-[0-9]{6}$', version):
128- version += time.strftime('-%Y%m%d-%H%M%S')
129- print "Version inserted into the patch is: %s" % version
130-else:
131- print "Version in the source is already timestamped: %s" % version
132-
133-out += 'version = \'%s\'\n' % version
134-zf.writestr('release.py', ''.join(out))
135-
136-zf.writestr('delete.txt', '\n'.join(deleted))
137-zf.close()
138-
139
140=== removed file 'PatchTools/set_win_tree.bash'
141--- PatchTools/set_win_tree.bash 2016-09-14 17:28:45 +0000
142+++ PatchTools/set_win_tree.bash 1970-01-01 00:00:00 +0000
143@@ -1,80 +0,0 @@
144-#! /bin/bash
145-usage()
146-{
147- cat << EOF
148-usage: $0 options [name]
149-
150-This script set a UniField windows source tree
151-
152-OPTIONS:
153--h This help msg
154--s <serie> Launchpad serie to retrieve (default trunk)
155--t <tag> Tag name
156-<directory> Directory
157-EOF
158-}
159-
160-TAG=""
161-BZRBRANCH=""
162-SYNCBZRBRANCH=""
163-while getopts "hs:t:" OPTION
164-do
165- case $OPTION in
166- h)
167- usage
168- exit 1
169- ;;
170- t)
171- TAG="-r $OPTARG"
172- ;;
173- s)
174- BZRBRANCH="/$OPTARG"
175- SYNCBZRBRANCH="-$OPTARG"
176- ;;
177- ?)
178- usage
179- exit 0
180- ;;
181- esac
182-done
183-
184-shift $(($OPTIND - 1))
185-if [ -z "$1" ]; then
186- usage
187- exit 1
188-fi
189-
190-if [ -f "$1" -o -d "$1" ]; then
191- echo "Directory $1 exists"
192- exit 1
193-fi
194-
195-mkdir $1
196-cd $1
197-
198-echo "== web =="
199-echo bzr branch $TAG lp:unifield-web/${BZRBRANCH} unifield-web
200-bzr branch $TAG lp:unifield-web/${BZRBRANCH} unifield-web
201-
202-echo "== server =="
203-echo bzr branch $TAG lp:unifield-server${BZRBRANCH} unifield-server
204-bzr branch $TAG lp:unifield-server${BZRBRANCH} unifield-server
205-cd unifield-server/bin/addons
206-
207-#echo "== addons =="
208-#echo bzr branch $TAG lp:unifield-addons${BZRBRANCH} unifield-addons
209-#bzr branch $TAG lp:unifield-addons${BZRBRANCH} unifield-addons
210-#mv unifield-addons/* .
211-#rm -fr unifield-addons
212-
213-#echo "== wm =="
214-#echo bzr branch $TAG lp:unifield-wm${BZRBRANCH} unifield-wm
215-#bzr branch $TAG lp:unifield-wm${BZRBRANCH} unifield-wm
216-#mv unifield-wm/* .
217-#rm -fr unifield-wm
218-
219-#echo "== sync_module =="
220-#echo bzr branch $TAG lp:unifield-wm/sync${SYNCBZRBRANCH} sync_module_prod
221-#bzr branch $TAG lp:unifield-wm/sync${SYNCBZRBRANCH} sync_module_prod
222-#mv sync_module_prod/* .
223-#rm -fr sync_module_prod

Subscribers

People subscribed via source and target branches

to all changes: