installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta4 vs installer/utils/package_upload/repos.rake in rhoconnect-3.2.0.beta5
- old
+ new
@@ -57,11 +57,11 @@
"Codename: rhoconnect\n" +
"Architectures: i386 amd64\n" +
"Components: main\n" +
"Description: Rhoconnect APT Repository\n"
cmd "sudo touch #{filename}/distributions"
- cmd "sudo chmod 777 #{filename}/distributions"
+ cmd "sudo chmod -R 777 #{PKG_DIR}"
# Write distributions string to corresponding file
dist_file = File.new("#{filename}/distributions", "w")
dist_file.write(distributions)
dist_file.close
@@ -79,32 +79,24 @@
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|
@@ -113,25 +105,15 @@
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/"