Mercurial > treepkg
comparison bin/publishpackages.py @ 318:f70cee73a7ec
Only try to copy package files when there actually are files to copy
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Wed, 09 Dec 2009 17:42:44 +0000 |
parents | 1fcdffbeb9de |
children | 0862a14df80b |
comparison
equal
deleted
inserted
replaced
317:cb006b23b1a7 | 318:f70cee73a7ec |
---|---|
108 variables["build_host"]) | 108 variables["build_host"]) |
109 files = capture_output(cmdexpand("@runremote $build_listpackages" | 109 files = capture_output(cmdexpand("@runremote $build_listpackages" |
110 " @track @revision $pkgtype" | 110 " @track @revision $pkgtype" |
111 " --newest=$num_newest", | 111 " --newest=$num_newest", |
112 runremote=runremote, | 112 runremote=runremote, |
113 **listpackages_vars)).strip().split("\n") | 113 **listpackages_vars)).splitlines() |
114 | 114 |
115 # scp the packages to the cache dir | 115 # scp the packages to the cache dir |
116 cachedir = variables["cachedir"] | 116 cachedir = variables["cachedir"] |
117 shutil.rmtree(cachedir, ignore_errors=True) | 117 shutil.rmtree(cachedir, ignore_errors=True) |
118 ensure_directory(cachedir) | 118 ensure_directory(cachedir) |
119 if variables["build_host"]: | 119 if files: |
120 userhost = "%(build_user)s@%(build_host)s:" % variables | 120 if variables["build_host"]: |
121 files = [userhost + filename for filename in files] | 121 userhost = "%(build_user)s@%(build_host)s:" % variables |
122 scp_flags = [] | 122 files = [userhost + filename for filename in files] |
123 if quiet: | 123 scp_flags = [] |
124 scp_flags.append("-q") | 124 if quiet: |
125 call(cmdexpand("scp -p @scp_flags @files $cachedir/", files=files, | 125 scp_flags.append("-q") |
126 scp_flags=scp_flags, **variables)) | 126 call(cmdexpand("scp -p @scp_flags @files $cachedir/", files=files, |
127 scp_flags=scp_flags, **variables)) | |
127 | 128 |
128 | 129 |
129 def copy_to_publishdir(variables, dist, section, arch, quiet): | 130 def copy_to_publishdir(variables, dist, section, arch, quiet): |
130 destdir = os.path.join(variables["publish_dir"], dist, section, arch) | 131 destdir = os.path.join(variables["publish_dir"], dist, section, arch) |
131 remote_destdir = destdir | 132 remote_destdir = destdir |