Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
3d3eba1
Fix permissions on certain EasyBlocks
Oct 26, 2015
0ce1c19
Update BinariesTarball to include support for an explicit list of bin…
Oct 26, 2015
6f9be2e
Some changes recommended by K.H.
Oct 27, 2015
f515103
Merge branch 'develop' into binariestarball
Oct 28, 2015
7807b62
Merge branch 'develop' into binariestarball
Dec 10, 2015
31210d8
Merge branch 'develop' into binariestarball
Dec 14, 2015
074dd79
Merge branch 'develop' into binariestarball
Jan 5, 2016
203513e
Merge branch 'develop' into binariestarball
Jan 13, 2016
ae57a98
Merge branch 'develop' into binariestarball
Jan 24, 2016
53cedde
Merge branch 'develop' into binariestarball
Jan 27, 2016
6776f14
Merge branch 'develop' into binariestarball
Feb 14, 2016
ca82164
Merge branch 'develop' into binariestarball
Feb 17, 2016
ac74b85
make files_to_copy's default value None, not an empty list
Feb 21, 2016
fd107b0
Merge branch 'develop' into binariestarball
Feb 21, 2016
6186b6d
Merge branch 'develop' into binariestarball
Feb 24, 2016
46cde23
Merge branch 'develop' into binariestarball
Mar 1, 2016
4e4326f
Merge branch 'develop' into binariestarball
Mar 2, 2016
4fcb4e3
Merge branch 'develop' into binariestarball
Mar 15, 2016
2eed6ea
Merge branch 'develop' into binariestarball
Mar 29, 2016
2d54ce3
Merge branch 'develop' into binariestarball
Apr 5, 2016
1c1d60f
Merge branch 'develop' into binariestarball
Apr 13, 2016
da06bea
Merge branch 'develop' into binariestarball
Apr 18, 2016
1514900
Merge branch 'develop' into binariestarball
Apr 28, 2016
a9169d4
Merge branch 'develop' into binariestarball
May 16, 2016
355dbcd
Merge branch 'develop' into binariestarball
Jun 21, 2016
c83a126
Merge branch 'develop' into binariestarball
Jul 22, 2016
97985d2
Merge branch 'develop' into binariestarball
Aug 26, 2016
05c7ed1
Merge branch 'develop' into binariestarball
Sep 1, 2016
f2465f4
Merge branch 'develop' into binariestarball
Dec 6, 2016
ee7945a
Merge branch 'develop' into binariestarball
Jan 4, 2017
2c86136
Merge branch 'develop' into binariestarball
Jan 11, 2017
268e622
Merge branch 'develop' into binariestarball
Apr 18, 2017
c10c518
Merge branch 'develop' into binariestarball
May 22, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified easybuild/easyblocks/b/bamtools.py
100755 → 100644
Empty file.
Empty file modified easybuild/easyblocks/b/blat.py
100755 → 100644
Empty file.
Empty file modified easybuild/easyblocks/b/bwa.py
100755 → 100644
Empty file.
Empty file modified easybuild/easyblocks/c/chimera.py
100755 → 100644
Empty file.
33 changes: 28 additions & 5 deletions easybuild/easyblocks/generic/binariestarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import stat

from easybuild.easyblocks.generic.tarball import Tarball
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import adjust_permissions

Expand All @@ -40,21 +41,43 @@ class BinariesTarball(Tarball):
"""
Support for installing a tarball of binaries
"""
@staticmethod
def extra_options(extra_vars=None):
"""
Define list of files to be copied during the installation process
"""
extra_vars = Tarball.extra_options(extra_vars)
# Allow specification of files to copy explicitly.
# If files_to_copy is a zero-length list, all files (but not
# directories, etc.) in start_dir will be copied with their
# current names.
extra_vars['files_to_copy'] = [
[],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use None as default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Precedents elsewhere seem to be in favour of an empty list (see e.g. the makesymlinks extra variable in rpm.py).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boegel: Further thoughts regarding None as the default?

"List of optional (source_file, destination_file) tuples",
CUSTOM,
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this on a single line, since it's really one entry (not three)

return extra_vars

def install_step(self):
"""Install by copying unzipped binaries to 'bin' subdir of installation dir, and fixing permissions."""

bindir = os.path.join(self.installdir, 'bin')
items_to_copy = []
try:
os.makedirs(bindir)
for item in os.listdir(self.cfg['start_dir']):
if len(self.cfg['files_to_copy']) == 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.cfg['files_to_copy'] is None:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if initialising the value to None (see above) is considered more desirable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using None as a default value makes more sense anyway; using mutable values (like lists) is considered evil for defaults.

See also http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

for item in os.listdir(self.cfg['start_dir']):
items_to_copy.append((os.path.join(self.cfg['start_dir'], item), item))
else:
items_to_copy = self.cfg['files_to_copy']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this implies that the entries should be specified full path, like %(installpath)s/foo rather than foo?

it would make more sense to also join these entries with self.cfg['start_dir']?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, as far as I can tell, if start_dir is not explicitly set, it is assumed to be builddir and paths (where not explicitly absolute) are computed relative to it. However, entries can be joined with self.cfg['start_dir'] if that would make sense. I guess it would be more understandable. I'll make that change.

for (item, destname) in items_to_copy:
if os.path.isfile(item):
shutil.copy2(os.path.join(self.cfg['start_dir'], item), bindir)
shutil.copy2(item, os.path.join(bindir, destname))
# make sure binary has executable permissions
adjust_permissions(os.path.join(bindir, item), stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH, add=True)
adjust_permissions(os.path.join(bindir, destname), stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH, add=True)
self.log.debug("Copied %s to %s and fixed permissions" % (item, bindir))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use , item, bindir please

else:
self.log.warning("Skipping non-file %s in %s, not copying it." % (item, self.cfg['start_dir']))
self.log.warning("%s: not a file. Skipping." % item)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use , item please

except OSError, err:
raise EasyBuildError("Copying binaries in %s to install dir 'bin' failed: %s", self.cfg['start_dir'], err)
raise EasyBuildError("Copying binaries to install dir 'bin' failed: %s" % err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use , err please


Empty file modified easybuild/easyblocks/generic/cmdcp.py
100755 → 100644
Empty file.
Empty file modified easybuild/easyblocks/generic/makecp.py
100755 → 100644
Empty file.
Empty file modified easybuild/easyblocks/m/modeller.py
100755 → 100644
Empty file.