[meego-commits] 10862: Changes to Tools:Building/meego-osc-plugins
Jian-feng Ding
no_reply at build.meego.com
Mon Dec 13 07:27:00 UTC 2010
Hi,
I have made the following changes to meego-osc-plugins in project Tools:Building. Please review and accept ASAP.
Thank You,
Jian-feng Ding
[This message was auto-generated]
---
Request #10862:
submit: devel:tools:building/meego-osc-plugins(r16) -> Tools:Building/meego-osc-plugins
Message:
Forward Vivian's changes:
* Sat Dec 11 2010 Vivian Zhang <vivian.zhang at intel.com> - 0.7
- Add repo/arch check for localcheckbuild plugi (BMC #11195)
- Add repo arg for user configs the specified repo (BMC #11195)
State: new 2010-12-12T23:27:00 jfding
Comment: None
changes files:
--------------
--- meego-osc-plugins.changes
+++ meego-osc-plugins.changes
@@ -0,0 +1,4 @@
+* Sat Dec 11 2010 Vivian Zhang <vivian.zhang at intel.com> - 0.7
+- Add repo/arch check for localcheckbuild plugi (BMC #11195)
+- Add repo arg for user configs the specified repo (BMC #11195)
+
new:
----
add-opts-repo.patch
add-repo-arch-check.patch
spec files:
-----------
--- meego-osc-plugins.spec
+++ meego-osc-plugins.spec
@@ -1,6 +1,6 @@
#
-# Do not Edit! Generated by:
-# spectacle version 0.17
+# Do NOT Edit the Auto-generated Part!
+# Generated by: spectacle version 0.21
#
# >> macros
# << macros
@@ -17,6 +17,8 @@
Source100: meego-osc-plugins.yaml
Patch0: update-repourllist-localcheckbuild.patch
Patch1: disable-proxy-cache.patch
+Patch2: add-repo-arch-check.patch
+Patch3: add-opts-repo.patch
Requires: osc
Obsoletes: moblin-osc-plugins
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -37,6 +39,10 @@
%patch0 -p1
# disable-proxy-cache.patch
%patch1 -p1
+# add-repo-arch-check.patch
+%patch2 -p1
+# add-opts-repo.patch
+%patch3 -p1
# >> setup
# << setup
dsc files:
----------
other changes:
--------------
++++++ add-opts-repo.patch (new)
--- add-opts-repo.patch
+++ add-opts-repo.patch
+diff -Nur osc-plugins-0.7/osc-localcheckbuild.py osc-plugins-0.7-new/osc-localcheckbuild.py
+--- osc-plugins-0.7/osc-localcheckbuild.py 2010-12-12 00:44:36.183352207 -0500
++++ osc-plugins-0.7-new/osc-localcheckbuild.py 2010-12-12 22:01:28.480295939 -0500
+@@ -8,13 +8,13 @@
+ help='The package list that will not be built, example: --excludepkgs="bash gcc"')
+ @cmdln.option('--buildpkgs', metavar='TEXT',
+ help='The package list that will be built, the tool will skip checking dependencies and build the packages in this list directly, example: --buildpkgs="at-spi gtk2 "')
+- at cmdln.option('--repourl', metavar='TEXT',
+- help='Repository of the new package, default is the OBS download repository')
++ at cmdln.option('--repo',
++ type="string", action="append", dest="repos", help='Use the specified repo')
+
+ def do_localcheckbuild(self, subcmd, opts, *args):
+ """${cmd_name}: Check if all the packages which depends on me can be built successfully.
+ usage:
+- osc localcheckbuild [-r] [-y] [--repourl=TEXT] [--excludepkgs=TEXT] [--buildpkgs=TEXT] PRJECTNAME PACKAGENAME REPOSITORY ARCH
++ osc localcheckbuild [-r] [-y] [--excludepkgs=TEXT] [--buildpkgs=TEXT] PRJECTNAME PACKAGENAME REPOSITORY ARCH
+
+ The arguments REPOSITORY and ARCH are the first two columns in the 'osc
+ repos' output.
+@@ -74,6 +74,7 @@
+ if recursive:
+ args.append("--recursive")
+ args.append(pkgname)
++ print args
+ oscproc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=sys.stderr)
+ packages = oscproc.communicate()[0].strip().split("\n")
+ if oscproc.returncode == 1:
+@@ -93,7 +94,7 @@
+ project, repository, architecture,
+ package = package, verbose=True)
+ if binaries == [ ]:
+- print ('Error: No binaries found. Either the package does not '
++ print ('No binaries found. Either the package does not '
+ 'exist or no binaries have been built.')
+ return False
+
+@@ -355,11 +356,11 @@
+ # clean status dir
+ shutil.rmtree(statusdir)
+ shutil.rmtree(logdir)
+- shutil.rmtree(rpmdir)
+ os.remove(log)
+ os.makedirs(statusdir, 0755)
+ os.makedirs(logdir, 0755)
+- os.makedirs(rpmdir, 0755)
++ if not os.path.isdir(rpmdir):
++ os.makedirs(rpmdir, 0755)
+ mylog("Reusing directory %s and clean the log files" % destdir)
+ else:
+ os.makedirs(destdir, 0755)
+@@ -402,9 +403,8 @@
+ for prjname in archlist.keys():
+ mylog("%s: %s %s" % (prjname, repositorylist[prjname], ','.join(archlist[prjname])))
+
+- if opts.repourl:
+- repourl = opts.repourl
+- repourllist.append(repourl)
++ if opts.repos:
++ repourllist = opts.repos
+
+ if opts.excludepkgs:
+ exclude_pkglist = "* " + opts.excludepkgs + " *"
+@@ -419,7 +419,7 @@
+ try:
+ packages = getwhatdependson(apiurl, package, repourllist, recursive = opts.recursive, continuebuild = opts.continuebuild)
+ except:
+- mylog("Failed to get dependant package list.")
++ mylog("Failed to get dependant package list. It might be caused by the error repourl, you can use --repo to specify the repourl.")
+ return
+
+ mylog("Got dependant packages:%s, len = %s" %(packages, len(packages)), pdata=False, addtime=True)
+@@ -534,18 +534,19 @@
+ break
+ if answer == "no":
+ return
+-
+-
++
+ mylog ("Downloading %s rpms from project %s/%s,%s to %s for initializing the build environment..." % (package, project, repo, arch,rpmdir))
+- try:
++ while True:
+ ret = get_binary_rpms (apiurl, project, package, repo, arch, rpmdir)
+- if ret == False:
+- print ('Failed to download the binary packages for %s' % package)
+- return
+- except:
+- print "Failed to download the binary rpms."
+- return
+-
++ if ret == True:
++ break
++ while True:
++ answer = raw_input("Please check the binary rpms of %s/%s (%s,%s) are generated and published successfully. Try again?(yes/no)" % (project, package, repo, arch))
++ if answer == "yes":
++ break
++ if answer == "no":
++ return
++
+ try:
+ download_process = Process (target=download_sources, args=(download_pkglist, opts.continuebuild))
+ download_process.daemon = True
++++++ add-repo-arch-check.patch (new)
--- add-repo-arch-check.patch
+++ add-repo-arch-check.patch
+diff -Nur osc-plugins-0.7/osc-localcheckbuild.py osc-plugins-0.7-new/osc-localcheckbuild.py
+--- osc-plugins-0.7/osc-localcheckbuild.py 2010-12-11 04:11:13.806112398 -0500
++++ osc-plugins-0.7-new/osc-localcheckbuild.py 2010-12-11 04:10:06.327356859 -0500
+@@ -279,7 +279,7 @@
+
+
+ args = slash_split(args)
+- min_args, max_args = 4, 4
++ min_args, max_args = 2, 4
+ if len(args) < min_args:
+ raise oscerr.WrongArgs('Too few arguments.')
+ if len(args) > max_args:
+@@ -287,8 +287,39 @@
+
+ project = args[0]
+ package = args[1]
+- repo = args[2]
+- arch = args[3]
++ if len(args) == 4:
++ repo = args[2]
++ arch = args[3]
++ else:
++ repo = "default"
++ arch = "default"
++
++ # check repo/arch args
++ repos = []
++ arches = []
++ ask_repoarch = True
++ for repository in get_repos_of_project(conf.config['apiurl'], project):
++ if repository.name == repo and repository.arch == arch:
++ ask_repoarch = False
++ break
++ repos.append(repository.name)
++ arches.append(repository.arch)
++ if ask_repoarch:
++ if len(args) == 4:
++ print "The repo/arch you provide doesn't exist."
++
++ print "The available repo/arch in project %s:" % project
++ for i in range(1,len(repos)+1):
++ print " %d. %s,%s" % (i, repos[i-1], arches[i-1])
++
++ while True:
++ i = raw_input("Enter your choice [1..%d] ? " % len(repos))
++ if i.isdigit():
++ i = int(i)
++ if i >= 1 and i <= len(repos):
++ break
++ repo = repos[i-1]
++ arch = arches[i-1]
+
+ destdir = "/var/tmp/buildcheck-%s-%s" %(package,arch)
+ logdir = "%s/LOG" % destdir
+@@ -505,7 +536,7 @@
+ return
+
+
+- mylog ("Downloading %s rpms to %s for initializing the build environment..." % (package, rpmdir))
++ mylog ("Downloading %s rpms from project %s/%s,%s to %s for initializing the build environment..." % (package, project, repo, arch,rpmdir))
+ try:
+ ret = get_binary_rpms (apiurl, project, package, repo, arch, rpmdir)
+ if ret == False:
++++++ debian.tar.gz
--- patches/00list
+++ patches/00list
@@ -1,2 +1,4 @@
01_update-repourllist-localcheckbuild
02_disable-proxy-cache
+03_add-repo-arch-check
+04_add-opts-repo
--- patches/01_update-repourllist-localcheckbuild.dpatch
+++ patches/01_update-repourllist-localcheckbuild.dpatch
@@ -1,5 +1,5 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
-## 05_prefer-pkg-workaround.dpatch by vivian zhang <vivian.zhang at intel.com>
+## 01_update-repourllist-localcheckbuild.dpatch by vivian zhang <vivian.zhang at intel.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
--- patches/02_disable-proxy-cache.dpatch
+++ patches/02_disable-proxy-cache.dpatch
@@ -1,5 +1,5 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
-## 05_prefer-pkg-workaround.dpatch by vivian zhang <vivian.zhang at intel.com>
+## 02_disable-proxy-cache.dpatch by vivian zhang <vivian.zhang at intel.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
--- patches/03_add-repo-arch-check.dpatch
+++ patches/03_add-repo-arch-check.dpatch
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 03_add-repo-arch-check.dpatch by vivian zhang <vivian.zhang at intel.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+
+
+
+diff -Nur osc-plugins-0.7/osc-localcheckbuild.py osc-plugins-0.7-new/osc-localcheckbuild.py
+--- osc-plugins-0.7/osc-localcheckbuild.py 2010-12-11 04:11:13.806112398 -0500
++++ osc-plugins-0.7-new/osc-localcheckbuild.py 2010-12-11 04:10:06.327356859 -0500
+@@ -279,7 +279,7 @@
+
+
+ args = slash_split(args)
+- min_args, max_args = 4, 4
++ min_args, max_args = 2, 4
+ if len(args) < min_args:
+ raise oscerr.WrongArgs('Too few arguments.')
+ if len(args) > max_args:
+@@ -287,8 +287,39 @@
+
+ project = args[0]
+ package = args[1]
+- repo = args[2]
+- arch = args[3]
++ if len(args) == 4:
++ repo = args[2]
++ arch = args[3]
++ else:
++ repo = "default"
++ arch = "default"
++
++ # check repo/arch args
++ repos = []
++ arches = []
++ ask_repoarch = True
++ for repository in get_repos_of_project(conf.config['apiurl'], project):
++ if repository.name == repo and repository.arch == arch:
++ ask_repoarch = False
++ break
++ repos.append(repository.name)
++ arches.append(repository.arch)
++ if ask_repoarch:
++ if len(args) == 4:
++ print "The repo/arch you provide doesn't exist."
++
++ print "The available repo/arch in project %s:" % project
++ for i in range(1,len(repos)+1):
++ print " %d. %s,%s" % (i, repos[i-1], arches[i-1])
++
++ while True:
++ i = raw_input("Enter your choice [1..%d] ? " % len(repos))
++ if i.isdigit():
++ i = int(i)
++ if i >= 1 and i <= len(repos):
++ break
++ repo = repos[i-1]
++ arch = arches[i-1]
+
+ destdir = "/var/tmp/buildcheck-%s-%s" %(package,arch)
+ logdir = "%s/LOG" % destdir
+@@ -505,7 +536,7 @@
+ return
+
+
+- mylog ("Downloading %s rpms to %s for initializing the build environment..." % (package, rpmdir))
++ mylog ("Downloading %s rpms from project %s/%s,%s to %s for initializing the build environment..." % (package, project, repo, arch,rpmdir))
+ try:
+ ret = get_binary_rpms (apiurl, project, package, repo, arch, rpmdir)
+ if ret == False:
--- patches/04_add-opts-repo.dpatch
+++ patches/04_add-opts-repo.dpatch
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 04_add-opts-repo.dpatch by vivian zhang <vivian.zhang at intel.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+
+
+diff -Nur osc-plugins-0.7/osc-localcheckbuild.py osc-plugins-0.7-new/osc-localcheckbuild.py
+--- osc-plugins-0.7/osc-localcheckbuild.py 2010-12-12 00:44:36.183352207 -0500
++++ osc-plugins-0.7-new/osc-localcheckbuild.py 2010-12-12 22:01:28.480295939 -0500
+@@ -8,13 +8,13 @@
+ help='The package list that will not be built, example: --excludepkgs="bash gcc"')
+ @cmdln.option('--buildpkgs', metavar='TEXT',
+ help='The package list that will be built, the tool will skip checking dependencies and build the packages in this list directly, example: --buildpkgs="at-spi gtk2 "')
+- at cmdln.option('--repourl', metavar='TEXT',
+- help='Repository of the new package, default is the OBS download repository')
++ at cmdln.option('--repo',
++ type="string", action="append", dest="repos", help='Use the specified repo')
+
+ def do_localcheckbuild(self, subcmd, opts, *args):
+ """${cmd_name}: Check if all the packages which depends on me can be built successfully.
+ usage:
+- osc localcheckbuild [-r] [-y] [--repourl=TEXT] [--excludepkgs=TEXT] [--buildpkgs=TEXT] PRJECTNAME PACKAGENAME REPOSITORY ARCH
++ osc localcheckbuild [-r] [-y] [--excludepkgs=TEXT] [--buildpkgs=TEXT] PRJECTNAME PACKAGENAME REPOSITORY ARCH
+
+ The arguments REPOSITORY and ARCH are the first two columns in the 'osc
+ repos' output.
+@@ -74,6 +74,7 @@
+ if recursive:
+ args.append("--recursive")
+ args.append(pkgname)
++ print args
+ oscproc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=sys.stderr)
+ packages = oscproc.communicate()[0].strip().split("\n")
+ if oscproc.returncode == 1:
+@@ -93,7 +94,7 @@
+ project, repository, architecture,
+ package = package, verbose=True)
+ if binaries == [ ]:
+- print ('Error: No binaries found. Either the package does not '
++ print ('No binaries found. Either the package does not '
+ 'exist or no binaries have been built.')
+ return False
+
+@@ -355,11 +356,11 @@
+ # clean status dir
+ shutil.rmtree(statusdir)
+ shutil.rmtree(logdir)
+- shutil.rmtree(rpmdir)
+ os.remove(log)
+ os.makedirs(statusdir, 0755)
+ os.makedirs(logdir, 0755)
+- os.makedirs(rpmdir, 0755)
++ if not os.path.isdir(rpmdir):
++ os.makedirs(rpmdir, 0755)
+ mylog("Reusing directory %s and clean the log files" % destdir)
+ else:
+ os.makedirs(destdir, 0755)
+@@ -402,9 +403,8 @@
+ for prjname in archlist.keys():
+ mylog("%s: %s %s" % (prjname, repositorylist[prjname], ','.join(archlist[prjname])))
+
+- if opts.repourl:
+- repourl = opts.repourl
+- repourllist.append(repourl)
++ if opts.repos:
++ repourllist = opts.repos
+
+ if opts.excludepkgs:
+ exclude_pkglist = "* " + opts.excludepkgs + " *"
+@@ -419,7 +419,7 @@
+ try:
+ packages = getwhatdependson(apiurl, package, repourllist, recursive = opts.recursive, continuebuild = opts.continuebuild)
+ except:
+- mylog("Failed to get dependant package list.")
++ mylog("Failed to get dependant package list. It might be caused by the error repourl, you can use --repo to specify the repourl.")
+ return
+
+ mylog("Got dependant packages:%s, len = %s" %(packages, len(packages)), pdata=False, addtime=True)
+@@ -534,18 +534,19 @@
+ break
+ if answer == "no":
+ return
+-
+-
++
+ mylog ("Downloading %s rpms from project %s/%s,%s to %s for initializing the build environment..." % (package, project, repo, arch,rpmdir))
+- try:
++ while True:
+ ret = get_binary_rpms (apiurl, project, package, repo, arch, rpmdir)
+- if ret == False:
+- print ('Failed to download the binary packages for %s' % package)
+- return
+- except:
+- print "Failed to download the binary rpms."
+- return
+-
++ if ret == True:
++ break
++ while True:
++ answer = raw_input("Please check the binary rpms of %s/%s (%s,%s) are generated and published successfully. Try again?(yes/no)" % (project, package, repo, arch))
++ if answer == "yes":
++ break
++ if answer == "no":
++ return
++
+ try:
+ download_process = Process (target=download_sources, args=(download_pkglist, opts.continuebuild))
+ download_process.daemon = True
++++++ meego-osc-plugins.yaml
--- meego-osc-plugins.yaml
+++ meego-osc-plugins.yaml
@@ -16,6 +16,8 @@
Patches:
- update-repourllist-localcheckbuild.patch
- disable-proxy-cache.patch
+ - add-repo-arch-check.patch
+ - add-opts-repo.patch
Requires:
- osc
Obsoletes:
More information about the MeeGo-commits
mailing list