file_paths.each do |file_path|
@server.log.info "Creating new job for registering \"#{file_path}\""
- prj = @server.prjmgr.get_project_from_package_name( pkg_name, @dist_name )
new_job = prj.create_new_job_from_local_file( file_path )
if new_job.nil? then
@server.log.error "Creating job failed: #{prj.name} #{pkg_name} #{@dist_name}"
}
bin_prjs.each do |p|
pkg_name = p.pkg_name
+ compat_pkgs = []
p.os_list.each do |os|
# get pkg version in server
main_ver = @main_client.get_attr_from_pkg(pkg_name, os, "version")
- remote_ver = @pkgsvr_client.get_attr_from_pkg(pkg_name, os, "version")
+ remote_pkg = @pkgsvr_client.get_pkg_from_list(pkg_name, os)
+ remote_ver = remote_pkg.version
if remote_ver.nil? then next end
if main_ver.nil? or Version.new(main_ver) < Version.new(remote_ver) then
- pkgs.push [pkg_name, os, p]
+ if (compat_pkgs.index { |pkg| remote_pkg.size == pkg[0] and remote_pkg.checksum == pkg[1] } ) == nil then
+ pkgs.push [pkg_name, os, p]
+ compat_pkgs.push [remote_pkg.size, remote_pkg.checksum]
+ end
end
end
end
when "version" then return pkg.version
when "src_path" then return pkg.src_path
when "os" then return pkg.os
+ when "os_list" then return pkg.os_list
when "build_dep_list" then return pkg.build_dep_list
when "install_dep_list" then return pkg.install_dep_list
when "attribute" then return pkg.attribute
--- /dev/null
+#PRE-EXEC
+#EXEC
+../../pkg-svr register -n pkgsvr02 -d unstable -P bin/bin_0.0.2_ubuntu-32.zip
+../../pkg-svr register -n pkgsvr02 -d unstable -P bin/bin_0.0.2_windows-32.zip
+sleep 50
+../../pkg-cli list-rpkg -P bin -u `pwd`/pkgsvr01/unstable -o ubuntu-32
+../../pkg-cli list-rpkg -P bin -u `pwd`/pkgsvr01/unstable -o windows-32
+../../build-cli build -N testa -d 127.0.0.1:2223 -o ubuntu-32 -U admin@user -w 1234
+#POST-EXEC
+#EXPECT
+Archive: bin/bin_0.0.2_ubuntu-32.zip
+inflating:
+snapshot is generated :
+package registed successfully
+Archive: bin/bin_0.0.2_windows-32.zip
+inflating:
+snapshot is generated :
+package registed successfully
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+bin (0.0.2)
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+I, [
+bin (0.0.2)
+Info: Added new job "2" for ubuntu-32!
+Info: Initializing job...
+Info: Checking package version ...
+Info: Invoking a thread for building Job 2
+Info: New Job 2 is started
+Info: Checking build dependency ...
+Info: Checking install dependency ...
+Info: Started to build this job...
+Info: JobBuilder#2 is created
+Info: Downloding client is initializing...
+Info: Installing dependent packages...
+Info: Downloading dependent source packages...
+Info: Make clean...
+Info: Make build...
+Info: Make install...
+Info: Generatiing pkginfo.manifest...
+Info: Zipping...
+Info: Creating package file ... a_0.0.1_ubuntu-32.zip
+Info: Checking reverse build dependency ...
+Info: Uploading ...
+Info: Upload succeeded. Sync local pkg-server again...
+Info: Snapshot:
+Info: Job is completed!
+Info: Job is FINISHED successfully!
+Info: Updating the source info for project "testa"
${RUBY} ../../build-svr add-dist -n testserver3 -D unstable -u `pwd`/pkgsvr01/unstable -d 127.0.0.1:3333
${RUBY} ../../build-svr add-os -n testserver3 -o ubuntu-32
${RUBY} ../../build-svr add-os -n testserver3 -o windows-32
-${RUBY} ../../build-svr add-prj -n testserver3 -N teste -P bin -D unstable -o ubuntu-32
+${RUBY} ../../build-svr add-prj -n testserver3 -N testa -g `pwd`/git01/a -b master
+${RUBY} ../../build-svr add-prj -n testserver3 -N teste -P bin -D unstable -o ubuntu-32,windows-32
${RUBY} ../../build-svr add-sync -n testserver3 -u `pwd`/pkgsvr02/unstable -D unstable
+mkdir -p git01
+cp ../git01/*.tar.gz git01/
+cd git01
+rm -rf a
+rm -rf a1
+rm -rf b
+rm -rf c
+rm -rf d
+tar xvf a_v1.tar.gz
+tar xvf b_v1.tar.gz
+tar xvf c_v1.tar.gz
+tar xvf d_v0.tar.gz
+tar xvf a1_v1.tar.gz
+cd ..
mkdir -p bin
cp ../bin/*.zip ./bin/
--- /dev/null
+02.testcase