lib/packaging/util/ship.rb in packaging-0.99.20 vs lib/packaging/util/ship.rb in packaging-0.99.21
- old
+ new
@@ -68,11 +68,11 @@
nonfinal: false }.merge(opts)
# First find the packages to be shipped. We must find them before moving
# to our temporary staging directory
local_packages = collect_packages(pkg_exts, options[:excludes])
- return if local_packages.empty?
+ return false if local_packages.empty?
tmpdir = Dir.mktmpdir
staged_pkgs = reorganize_packages(local_packages, tmpdir, options[:platform_independent], options[:nonfinal])
puts staged_pkgs.sort
@@ -98,10 +98,11 @@
Pkg::Util::Net.remote_set_permissions(staging_server, '775', [remote_basepath])
Pkg::Util::Net.remote_set_permissions(staging_server, '0664', [remote_pkg])
Pkg::Util::Net.remote_set_immutable(staging_server, [remote_pkg]) if options[:chattr]
end
end
+ return true
end
end
def ship_rpms(local_staging_directory, remote_path, opts = {})
ship_pkgs(["#{local_staging_directory}/**/*.rpm", "#{local_staging_directory}/**/*.srpm"], Pkg::Config.yum_staging_server, remote_path, opts)
@@ -130,32 +131,36 @@
def ship_p5p(local_staging_directory, remote_path, opts = {})
ship_pkgs(["#{local_staging_directory}/**/*.p5p"], Pkg::Config.p5p_host, remote_path, opts)
end
def ship_dmg(local_staging_directory, remote_path, opts = {})
- ship_pkgs(["#{local_staging_directory}/**/*.dmg"], Pkg::Config.dmg_staging_server, remote_path, opts)
+ packages_have_shipped = ship_pkgs(["#{local_staging_directory}/**/*.dmg"], Pkg::Config.dmg_staging_server, remote_path, opts)
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('osx'), Pkg::Config.dmg_staging_server, remote_path, opts[:nonfinal])
- Pkg::Platforms.platform_tags_for_package_format('dmg').each do |platform_tag|
- # Create the latest symlink for the current supported repo
- Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(platform_tag, remote_path), 'dmg')
+ if packages_have_shipped
+ Pkg::Platforms.platform_tags_for_package_format('dmg').each do |platform_tag|
+ # Create the latest symlink for the current supported repo
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(platform_tag, remote_path), 'dmg')
+ end
end
end
def ship_swix(local_staging_directory, remote_path, opts = {})
ship_pkgs(["#{local_staging_directory}/**/*.swix"], Pkg::Config.swix_staging_server, remote_path, opts)
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('eos'), Pkg::Config.swix_staging_server, remote_path, opts[:nonfinal])
end
def ship_msi(local_staging_directory, remote_path, opts = {})
- ship_pkgs(["#{local_staging_directory}/**/*.msi"], Pkg::Config.msi_staging_server, remote_path, opts)
+ packages_have_shipped = ship_pkgs(["#{local_staging_directory}/**/*.msi"], Pkg::Config.msi_staging_server, remote_path, opts)
create_rolling_repo_link(Pkg::Platforms.generic_platform_tag('windows'), Pkg::Config.msi_staging_server, remote_path, opts[:nonfinal])
- # Create the symlinks for the latest supported repo
- Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x64')
- Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x86')
+ if packages_have_shipped
+ # Create the symlinks for the latest supported repo
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x64')
+ Pkg::Util::Net.remote_create_latest_symlink(Pkg::Config.project, Pkg::Paths.artifacts_path(Pkg::Platforms.generic_platform_tag('windows'), remote_path), 'msi', arch: 'x86')
+ end
end
def ship_gem(local_staging_directory, remote_path, opts = {})
ship_pkgs(["#{local_staging_directory}/*.gem*"], Pkg::Config.gem_host, remote_path, opts)
end