Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Issue 154073002: Add script for generating a source tarball and rules for bilding a Debian package (Closed)

Created:
6 years, 10 months ago by Søren Gjesse
Modified:
6 years, 10 months ago
Reviewers:
ricow1, kustermann
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add script for generating a source tarball and rules for bilding a Debian package R=ricow@google.com, kusternamm@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=32359

Patch Set 1 #

Total comments: 15

Patch Set 2 : Addressed review comments and expanded the script #

Patch Set 3 : Minor fix #

Total comments: 22

Patch Set 4 : Addressed more review comments #

Total comments: 2

Patch Set 5 : Addressed final review comments #

Total comments: 28
Unified diffs Side-by-side diffs Delta from patch set Stats (+302 lines, -0 lines) Patch
A tools/create_tarball.py View 1 2 3 1 chunk +221 lines, -0 lines 24 comments Download
A tools/linux_dist_support/debian/compat View 1 1 chunk +1 line, -0 lines 0 comments Download
A tools/linux_dist_support/debian/control View 1 1 chunk +16 lines, -0 lines 1 comment Download
A tools/linux_dist_support/debian/dart.install View 1 1 chunk +2 lines, -0 lines 0 comments Download
A tools/linux_dist_support/debian/dart.links View 1 1 chunk +2 lines, -0 lines 1 comment Download
A tools/linux_dist_support/debian/rules View 1 2 1 chunk +51 lines, -0 lines 0 comments Download
A tools/linux_dist_support/debian/source/format View 1 1 chunk +1 line, -0 lines 0 comments Download
M tools/utils.py View 1 2 3 4 1 chunk +8 lines, -0 lines 2 comments Download

Messages

Total messages: 10 (0 generated)
Søren Gjesse
This is a start. We should discuss the directory structure. That is the debian directory ...
6 years, 10 months ago (2014-02-04 17:42:51 UTC) #1
ricow1
I don't really know anything about debian packaging. https://codereview.chromium.org/154073002/diff/1/debian/rules File debian/rules (right): https://codereview.chromium.org/154073002/diff/1/debian/rules#newcode43 debian/rules:43: make ...
6 years, 10 months ago (2014-02-04 18:16:01 UTC) #2
ricow1
https://codereview.chromium.org/154073002/diff/1/tools/create_tarball.py File tools/create_tarball.py (right): https://codereview.chromium.org/154073002/diff/1/tools/create_tarball.py#newcode52 tools/create_tarball.py:52: tardir = dirname(dirname(dirname(realpath(__file__)))) On 2014/02/04 18:16:01, ricow1 wrote: > ...
6 years, 10 months ago (2014-02-05 06:42:35 UTC) #3
Søren Gjesse
PTAL The copyright and changelog files for the building Debian packages are now generated. For ...
6 years, 10 months ago (2014-02-06 08:19:08 UTC) #4
ricow1
The changes to tools/utils.py is not showing up in the review tool, could you reupload? ...
6 years, 10 months ago (2014-02-06 08:45:25 UTC) #5
Søren Gjesse
PTAL Thanks for all the useful comments https://codereview.chromium.org/154073002/diff/110001/tools/create_tarball.py File tools/create_tarball.py (right): https://codereview.chromium.org/154073002/diff/110001/tools/create_tarball.py#newcode34 tools/create_tarball.py:34: # TODO ...
6 years, 10 months ago (2014-02-06 13:15:30 UTC) #6
ricow1
LGTM https://codereview.chromium.org/154073002/diff/230001/tools/utils.py File tools/utils.py (right): https://codereview.chromium.org/154073002/diff/230001/tools/utils.py#newcode345 tools/utils.py:345: fd = open(svn_revision_file) I am a sucker for ...
6 years, 10 months ago (2014-02-06 13:25:21 UTC) #7
Søren Gjesse
Committed patchset #5 manually as r32359 (presubmit successful).
6 years, 10 months ago (2014-02-06 14:37:55 UTC) #8
kustermann
kusternamm -> kustermann :) https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py File tools/create_tarball.py (right): https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py#newcode17 tools/create_tarball.py:17: # Debian is needed. "to ...
6 years, 10 months ago (2014-02-06 15:28:03 UTC) #9
Søren Gjesse
6 years, 10 months ago (2014-02-07 09:52:43 UTC) #10
Message was sent while issue was closed.
Thanks for the comments Martin, they have been addressed in
https://codereview.chromium.org/157383002.

https://codereview.chromium.org/154073002/diff/230001/tools/utils.py
File tools/utils.py (right):

https://codereview.chromium.org/154073002/diff/230001/tools/utils.py#newcode345
tools/utils.py:345: fd = open(svn_revision_file)
On 2014/02/06 13:25:21, ricow1 wrote:
> I am a sucker for with :-)
> try:
>   with open(svn_revision_file) as fd:
>     return fd.read()
> expect:
>   pass

Done.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py
File tools/create_tarball.py (right):

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:17: # Debian is needed.
On 2014/02/06 15:28:04, kustermann wrote:
> "to follow the Debian" sounds strange.

Done.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:28: import tempfile
On 2014/02/06 15:28:04, kustermann wrote:
> tempfile not used.

Removed.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:31: from os import listdir, makedirs, remove, rmdir
On 2014/02/06 15:28:04, kustermann wrote:
> remove, rmdir not used.

Removed.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:32: from os.path import basename, dirname, join,
realpath, exists, isdir, split
On 2014/02/06 15:28:04, kustermann wrote:
> basename, dirname, realpath, isdir unused.

Removed.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:38: license = [
On 2014/02/06 15:28:04, kustermann wrote:
> Python supports multiline strings, why don't you do something like this?:
> 
> license = """
> ..........
> ..........
> """

This will go away when https://codereview.chromium.org/156573003/ lands.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:137: lf = open('../LICENSE', 'r')
On 2014/02/06 15:28:04, kustermann wrote:
> 'r' is the default + using context manager?

Done.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:139: print license_lines
On 2014/02/06 15:28:04, kustermann wrote:
> Why print?

Debug code. Removed.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:160: datetime.datetime.utcnow().strftime('%a, %d %b %Y
%X +0000'))
On 2014/02/06 15:28:04, kustermann wrote:
> Maybe use a multiline string? [see comment at license]

It does not indent as well as this I think.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:164: f = open(filename, 'w')
On 2014/02/06 15:28:04, kustermann wrote:
> It's usually nicer (and safer if an exception occurs, because then you don't
> leak) if you use a context manager:
> 
> with open(filename, 'w') as f:
>   f.write(svn_revision)

Done.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:180: tarfilename = join(tardir, tarname)
On 2014/02/06 15:28:04, kustermann wrote:
> It's slightly spooky, that you tar up the dart directory into a tarball which
> lives inside the dart directory. Though you ignore "out", so it's not taring
up
> itself.
> 
> Since this is not invoked by gyp anyway, why do we need to put the tarball in
> out/buildDir/*.tar.gz ?
> You could add a commandline option for the destination of the tarball.

I started out by generating it in the parent directory to avoid the spooky part.
However placing everything we generate in out seems best.

Adding an option for the tar file is an option, but that way one can easily
place the tar file in an included directory, and we would have to check for
that.

Changed the excluding of out to use the name from GetBuildDir.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:181: print 'Creating tarball: %s' % (tarfilename)
On 2014/02/06 15:28:04, kustermann wrote:
> No parenthesis needed!

Done.

https://codereview.chromium.org/154073002/diff/270001/tools/create_tarball.py...
tools/create_tarball.py:183: for f in listdir('.'):
On 2014/02/06 15:28:04, kustermann wrote:
> You assume this is run from the root of the dart directory I assume?
> 
> Why not ensure it by using DART_DIR as you do in other places?

Done. The script can now be run from anywhere.

Powered by Google App Engine
This is Rietveld 408576698