diff --git a/setup/commands.py b/setup/commands.py index eb61b11260..5fb10b87e6 100644 --- a/setup/commands.py +++ b/setup/commands.py @@ -21,7 +21,7 @@ __all__ = [ 'linux32', 'linux64', 'linux', 'linux_freeze', 'osx32_freeze', 'osx', 'rsync', 'push', 'win32_freeze', 'win32', 'win64', 'win', - 'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish' + 'stage1', 'stage2', 'stage3', 'stage4', 'stage5', 'publish', 'publish_betas', ] @@ -58,7 +58,7 @@ kakasi = Kakasi() coffee = Coffee() from setup.publish import Manual, TagRelease, Stage1, Stage2, \ - Stage3, Stage4, Stage5, Publish + Stage3, Stage4, Stage5, Publish, PublishBetas manual = Manual() tag_release = TagRelease() stage1 = Stage1() @@ -67,6 +67,7 @@ stage3 = Stage3() stage4 = Stage4() stage5 = Stage5() publish = Publish() +publish_betas = PublishBetas() from setup.upload import (UploadUserManual, UploadDemo, UploadInstallers, UploadToServer, ReUpload) diff --git a/setup/publish.py b/setup/publish.py index 2efe91c458..384351293d 100644 --- a/setup/publish.py +++ b/setup/publish.py @@ -65,6 +65,22 @@ class Publish(Command): require_git_master() require_clean_git() +class PublishBetas(Command): + + sub_commands = ['sdist', 'stage2',] + + def pre_sub_commands(self, opts): + require_clean_git() + dist = self.a(self.j(self.d(self.SRC), 'dist')) + if os.path.exists(dist): + shutil.rmtree(dist) + os.mkdir(dist) + + def run(self, opts): + dist = self.a(self.j(self.d(self.SRC), 'dist')) + subprocess.check_call( + ('rsync --partial -rh --progress --delete %s/ download.calibre-ebook.com:/srv/download/betas/' % dist).split()) + class Manual(Command): description='''Build the User Manual '''