installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta3 vs installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta4
- old
+ new
@@ -69,48 +69,69 @@
# Create rpm directory if it does not already exist
cmd "sudo mkdir -p #{PKG_DIR}/rpm" unless File.directory?("#{PKG_DIR}/rpm")
end #prepare_destination
+
def copy_files
# Move back into rhoconnect repo root first
Dir.chdir RHOCONNECT_ROOT
# Copy the packages to their respective directory
Find.find('./pkg') do |file|
if !FileTest.directory?(file)
dest_dir = File.extname(file)
# Get rid of '.' before extension name
dest_dir[0] = ''
+ puts "=========================\n" +
+ " dest_dir:\t#{dest_dir} \n" +
+ "=========================\n"
if dest_dir == 'deb' || dest_dir == 'rpm'
if dest_dir == 'deb'
@deb_pkg = File.basename(file)
+ puts "==========================\n" +
+ "= @deb_pkg:\t#{@deb_pkg} =\n" +
+ "==========================\n"
end #if
file_path = File.expand_path(file)
+ puts "\n\n\nfile: #{file}\n\n"
cmd "sudo cp -r #{file_path} #{PKG_DIR}/#{dest_dir}"
end #if
end #if
end #do
end #copy_files
+ # SCRIPT
+
prepare_destination
copy_files
if !build_number.empty?
# Change name of packages to include build number
- ['deb', 'rpm'].each do |arch|
- Find.find("#{PKG_DIR}") do |file|
- if !File.directory?(file) and file =~ /#{arch}$/
- file_to_rename = File.open(file, 'r')
- old_name = File.expand_path(file)
- new_name = old_name.gsub(/(#{arch})$/, "#{build_number}.\\1" )
- File.rename(old_name, new_name)
- end #if
- end #do
- end #do
+ ['deb', 'rpm'].each do |arch|
+ Find.find("#{PKG_DIR}") do |file|
+ if !File.directory?(file) and file =~ /#{arch}$/
+ file_to_rename = File.open(file, 'r')
+ old_name = File.expand_path(file)
+ new_name = old_name.gsub(/(#{arch})$/, "#{build_number}.\\1" )
+ File.rename(old_name, new_name)
+ @deb_pkg = File.basename(new_name) if arch == 'deb'
+ puts "==================================\n" +
+ "= renamed @deb_pkg:\t#{@deb_pkg} =\n" +
+ "==================================\n"
+ end #if
+ end #do
+ end #do
end #if
# REPOIFY!
+ puts "=======================\n" +
+ "ls -la #{PKG_DIR}/deb \n" +
+ "#{`ls -la #{PKG_DIR}/deb`}\n" +
+ "=======================\n"
+ puts "Abort job now..."
+ STDIN.gets
+
cmd "sudo reprepro -b #{PKG_DIR}/deb includedeb rhoconnect #{PKG_DIR}/deb/#{@deb_pkg}"
cmd "sudo createrepo #{PKG_DIR}/rpm"
# Create SHA1 checksum of repo dirs
checksum_dest = "#{PKG_DIR}/SHA1/"