fixed "hm dist src" command to support branches
also allowed non-unix platforms to run src
This commit is contained in:
parent
07d56e8e03
commit
5bd0139734
|
@ -1019,10 +1019,7 @@ class InternalCommands:
|
||||||
moveExt = ''
|
moveExt = ''
|
||||||
|
|
||||||
if type == 'src':
|
if type == 'src':
|
||||||
if sys.platform in ['linux2', 'darwin']:
|
self.distSrc()
|
||||||
self.distSrc()
|
|
||||||
else:
|
|
||||||
package_unsupported = True
|
|
||||||
|
|
||||||
elif type == 'rpm':
|
elif type == 'rpm':
|
||||||
if sys.platform == 'linux2':
|
if sys.platform == 'linux2':
|
||||||
|
@ -1206,11 +1203,15 @@ class InternalCommands:
|
||||||
print "Removing existing export..."
|
print "Removing existing export..."
|
||||||
shutil.rmtree(exportPath)
|
shutil.rmtree(exportPath)
|
||||||
|
|
||||||
print 'Exporting repository to: ' + exportPath
|
|
||||||
os.mkdir(exportPath)
|
os.mkdir(exportPath)
|
||||||
err = os.system('git archive master | tar -x -C ' + exportPath)
|
|
||||||
|
cmd = "git archive %s | tar -x -C %s" % (
|
||||||
|
self.getGitBranchName(), exportPath)
|
||||||
|
|
||||||
|
print 'Exporting repository to: ' + exportPath
|
||||||
|
err = os.system(cmd)
|
||||||
if err != 0:
|
if err != 0:
|
||||||
raise Exception('Repository export failed: ' + str(err))
|
raise Exception('Repository export failed: ' + str(err))
|
||||||
|
|
||||||
packagePath = '../' + self.getGenerator().binDir + '/' + name + '.tar.gz'
|
packagePath = '../' + self.getGenerator().binDir + '/' + name + '.tar.gz'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue