mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Copy calibre releases to my backup hdd
This commit is contained in:
parent
b06d080987
commit
ec2bd359ab
@ -133,15 +133,18 @@ class UploadInstallers(Command): # {{{
|
|||||||
files = {x:installer_description(x) for x in
|
files = {x:installer_description(x) for x in
|
||||||
all_possible.intersection(available)}
|
all_possible.intersection(available)}
|
||||||
tdir = mkdtemp()
|
tdir = mkdtemp()
|
||||||
|
backup = os.path.join('/mnt/external/calibre/%s' % __version__)
|
||||||
|
if not os.path.exists(backup):
|
||||||
|
os.mkdir(backup)
|
||||||
try:
|
try:
|
||||||
self.upload_to_staging(tdir, files)
|
self.upload_to_staging(tdir, backup, files)
|
||||||
self.upload_to_sourceforge()
|
self.upload_to_sourceforge()
|
||||||
self.upload_to_calibre()
|
self.upload_to_calibre()
|
||||||
# self.upload_to_google(opts.replace)
|
# self.upload_to_google(opts.replace)
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(tdir, ignore_errors=True)
|
shutil.rmtree(tdir, ignore_errors=True)
|
||||||
|
|
||||||
def upload_to_staging(self, tdir, files):
|
def upload_to_staging(self, tdir, backup, files):
|
||||||
os.mkdir(tdir+'/dist')
|
os.mkdir(tdir+'/dist')
|
||||||
hosting = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
hosting = os.path.join(os.path.dirname(os.path.abspath(__file__)),
|
||||||
'hosting.py')
|
'hosting.py')
|
||||||
@ -149,6 +152,7 @@ class UploadInstallers(Command): # {{{
|
|||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
shutil.copyfile(f, os.path.join(tdir, f))
|
shutil.copyfile(f, os.path.join(tdir, f))
|
||||||
|
shutil.copyfile(f, os.path.join(backup, f))
|
||||||
|
|
||||||
with open(os.path.join(tdir, 'fmap'), 'wb') as fo:
|
with open(os.path.join(tdir, 'fmap'), 'wb') as fo:
|
||||||
for f, desc in files.iteritems():
|
for f, desc in files.iteritems():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user