tools/depanneur.git
11 years agoUpdate semantic meaning of %pkgddeps to report circle in time
Zhang Qiang [Sun, 9 Jun 2013 07:03:46 +0000 (15:03 +0800)]
Update semantic meaning of %pkgddeps to report circle in time

In the old design, %pkgddeps only contains package already ready to
be built, that means all it's build dependencies already there.
In that case, some circle will not be reportted earlier.

Now, we changed it, all packages will go into %pkgddeps, and find as
many dependencies as possible.

Change-Id: I766f6c8bef710a22f4906ffa9e8695161985bea1

11 years agobump to version 0.7 for gbs 0.16 realease-0.7 release-0.7 0.7
Zhang Qiang [Tue, 14 May 2013 05:24:38 +0000 (13:24 +0800)]
bump to version 0.7 for gbs 0.16

Change-Id: I467e35697df650a58914aec06499b0879a6dce34

11 years agoavoid export multiple times for same package
Zhang Qiang [Mon, 13 May 2013 06:59:57 +0000 (14:59 +0800)]
avoid export multiple times for same package

Change-Id: I90cea9d29d220cc15e53497dc883717adef5c710

11 years agofix wrong @deps which contain version info
Yigang Wen [Fri, 10 May 2013 07:56:03 +0000 (15:56 +0800)]
fix wrong @deps which contain version info

if Buildrequires like "m4 >= 1.2", depanneur didn't remove version
info in @deps, so it may caused a wrong package dependency analysis.

Change-Id: Ic0e1bbf99c2fcc7835eec0fb48a208c6de5e2744

11 years agoprereqs should be involved for dependency resolving
Zhang Qiang [Tue, 7 May 2013 04:36:02 +0000 (12:36 +0800)]
prereqs should be involved for dependency resolving

Pre-requires: Requirespre/Requirespost/PreReq should be considerred for
dependency resolving

Example:
  fake.spec contails:
    Requires(post):   systemd
    Requires(preun):  systemd
    Requires(postun): systemd

If systemd does not available in remote repo and localrepo, depanneur
should report expansion error, instead of executing building

Change-Id: Ice4dfae9a45325ef19d21e38378a2083ceafdb56

11 years agoquote metacharacters in pattern to fix strip issue if metacharacters exist
Zhang Qiang [Thu, 2 May 2013 01:40:48 +0000 (09:40 +0800)]
quote metacharacters in pattern to fix strip issue if metacharacters exist

Change-Id: Iced588ef2dcc7f96cb7181c41e987eb0e3c0c1f7

11 years agocreate a individual dir:BUILD-ROOTS for all build roots
Zhang Qiang [Thu, 2 May 2013 01:57:53 +0000 (09:57 +0800)]
create a individual dir:BUILD-ROOTS for all build roots

create build roots under an individual dir, instead of GBS-ROOT/local.

In this way, developer can config 'BUILD-ROOTS' as tmpfs to speed up
local build.

Change-Id: Ibca2ca87a6f4d7acef22d2207eb592a152d62099

11 years agoAdd statistical data of each errors
Zhang Qiang [Mon, 29 Apr 2013 15:56:17 +0000 (23:56 +0800)]
Add statistical data of each errors

Change-Id: I85804e38ad4052a7162064f4bf4ac822e9f09a5a

11 years agorefine createrepo
Zhang Qiang [Fri, 12 Apr 2013 07:24:28 +0000 (15:24 +0800)]
refine createrepo

 - add & update group and patterns file
 - use --update option to speed up updating repo

Change-Id: I8c2145efd7fedc16226a627f543d7ac1c3fc0f6b

11 years agooptimization: break recursion if .git directory exist release-0.6
Yigang Wen [Mon, 8 Apr 2013 08:11:12 +0000 (16:11 +0800)]
optimization: break recursion if .git directory exist

without this patch, depanneur will scan all directory to find .git
dir, acturally, that's not needed, if .git exist, all dirs, with
same parent dir of .git, can be skipped.

Change-Id: I934695924edb288d7b3f3a00570b7d6bd341c0ef

11 years agocritical performance fix: remove duplicate dependency packages
Yigang Wen [Mon, 8 Apr 2013 08:10:45 +0000 (16:10 +0800)]
critical performance fix: remove duplicate dependency packages

Without this patch, package dependency and reverse depedency resolving
will take about 1-2G memory while scanning 800 Tizen packages, and
after remove duplicated packages only ~2M.

Change-Id: I220c9cb69e726e2202f98273de5b8a5cb823745a

11 years agooptimization: no need build %pkgdeps and %pkgrdeps if no --deps/--rdeps 0.6
Zhang Qiang [Wed, 3 Apr 2013 06:44:27 +0000 (14:44 +0800)]
optimization: no need build %pkgdeps and %pkgrdeps if no --deps/--rdeps

Change-Id: I5efdd1143bd3d54f28f3da8bd21edf644d5d3fec

11 years agosupport creating -32bit/-64bit/-x86 rpms for other archs, #852
Zhang Qiang [Thu, 28 Mar 2013 06:42:35 +0000 (14:42 +0800)]
support creating -32bit/-64bit/-x86 rpms for other archs, #852

This option is just like --baselibs of build script

Change-Id: I1fa339a2217acb09c3e71a753f12a355f5fab117

11 years agodepend on createrepo 0.9.8 to remove extra yum-3.2.29 dependency
Zhang Qiang [Wed, 27 Mar 2013 08:22:49 +0000 (16:22 +0800)]
depend on createrepo 0.9.8 to remove extra yum-3.2.29 dependency

Change-Id: I66ec6aa90a2484c4edc1fb5f175bd54a8787675b

11 years agofix a bug when spec file not exist
Yigang Wen [Thu, 7 Mar 2013 05:26:47 +0000 (13:26 +0800)]
fix a bug when spec file not exist

check spec file before push into @packs

Change-Id: I311208145252939b5e90916f43ae2ba8a7dd82b1

11 years agobump to version 0.6 for gbs 0.15
Zhang Qiang [Mon, 25 Mar 2013 22:03:43 +0000 (18:03 -0400)]
bump to version 0.6 for gbs 0.15

Change-Id: I76fb9b9fafaf2107d347a39213120ccde47a18ee

11 years agofix createrepo option error
Zhang Qiang [Mon, 25 Mar 2013 18:20:17 +0000 (14:20 -0400)]
fix createrepo option error

Change-Id: Ic4c5d1292d4eaf1f525dd41dd6e9b9481bc5ff81

11 years agodepend on new version of obs-build and createrepo
Zhang Qiang [Wed, 20 Mar 2013 16:05:28 +0000 (12:05 -0400)]
depend on new version of obs-build and createrepo

Change-Id: I7e43d2fceec7765e59980e25dbb1b2ac4163948f

11 years agoGer rid of security hole created by depanneur_sudo release-0.5 0.5
Ed Bartosh [Wed, 27 Feb 2013 18:01:58 +0000 (20:01 +0200)]
Ger rid of security hole created by depanneur_sudo

Instead of using easily exploitable hole, made by depanneur_sudo
commands, needed to be run from root account added to sudoers file with
as much restrictions as possible .

Fixes: #TZPC-909

Change-Id: I41529ed471a2cc2aca1925b1b0edf25b979e80b3
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
11 years agobump to version 0.5 for gbs 0.14
Zhang Qiang [Thu, 21 Feb 2013 19:56:02 +0000 (14:56 -0500)]
bump to version 0.5 for gbs 0.14

Change-Id: Icb09742e9ba015a2d579ea2549f478d973aec622

11 years agoUpdate --binary-list and add --binary-from-file two options. #720
Huang Hao [Wed, 20 Feb 2013 08:27:15 +0000 (16:27 +0800)]
Update --binary-list and add --binary-from-file two options. #720

Rename old --binary option to --binary-from-file and add a new
option --binary-list to accept a comma-separated string of packages
list to build.

Also remove useless option --build-all, which will always true
in gbs build. and previous logic of $buildall is wrong.

Change-Id: I73214fd58ae81d4d15616115602f5a905451892d

11 years agoCheck dependency circle before generating topological seq
Zhang Qiang [Wed, 6 Feb 2013 16:10:06 +0000 (11:10 -0500)]
Check dependency circle before generating topological seq

Change-Id: If94527cc7b76bfe56ea30b02088982294457f8da

11 years ago--deps and --rdeps support, #704
Zhang Qiang [Mon, 4 Feb 2013 19:26:20 +0000 (14:26 -0500)]
--deps and --rdeps support, #704

--rdeps: build specified packages and packages depend on them
--deps: build all specified packages and packages they depend on

Change-Id: I96b25c898d2901db8be86a414e0d1a158ed7941b

11 years agoCheck all mount point to build root, and list them all. release-0.4 0.4
Zhang Qiang [Tue, 29 Jan 2013 16:06:53 +0000 (11:06 -0500)]
Check all mount point to build root, and list them all.

Change-Id: Ib9598d03aedd50906f129e1a9aaacc8212979d56

11 years agoread /proc/self/mountinfo for mount info
Zhang Qiang [Mon, 28 Jan 2013 21:35:34 +0000 (16:35 -0500)]
read /proc/self/mountinfo for mount info

the output of 'mount' command are differents for each distros(fedora/
openSUSE/ubuntu), but the format of /proc/self/mountinfo are the same,
and contains all info we need.

Change-Id: I428235b7a08ed666524c99d48a4645aa33663778

11 years agouse sysconf() to get the number of processors
Zhang Qiang [Mon, 28 Jan 2013 19:44:42 +0000 (14:44 -0500)]
use sysconf() to get the number of processors

* use sysconf() to get the number of processors
* set jobs as $nprocessors * 2

Change-Id: Ib83100435f8a160400586f9a993fe46f22ad81dc

11 years agoAdd mounted source check to avoid being deleted unexpectlly, 580
Zhang Qiang [Mon, 28 Jan 2013 16:11:09 +0000 (11:11 -0500)]
Add mounted source check to avoid being deleted unexpectlly, 580

Change-Id: Ifca30dcfb1c0f774b7715bd1e8aaffa78e661e02

11 years agobump to version 0.4
Zhang Qiang [Fri, 18 Jan 2013 16:13:03 +0000 (11:13 -0500)]
bump to version 0.4

depend on new build >= 2012.10.10-tizen20130122

Change-Id: Ibca147e5e35e286dd9f23f5158475fea28cf560f

11 years agoCheck the exsistance of specfile for incremental build
Zhang Qiang [Mon, 21 Jan 2013 22:57:29 +0000 (17:57 -0500)]
Check the exsistance of specfile for incremental build

Change-Id: I876dd23864c1bf517ddd124639f688a73575d566

11 years agoRefine build behavior: don't depend on local copy, #535
Zhang Qiang [Sat, 19 Jan 2013 04:31:16 +0000 (23:31 -0500)]
Refine build behavior: don't depend on local copy, #535

* by default using git ls-files to search spec file
* only use local copy if --include-all specified
* set global $commit as 'HEAD' by default, which make some work
  flow more easier

Change-Id: I708a4d191ee74d91b730498e5f92cd3cd71b9eb0

11 years agouse the processors number instead of hard code 4 to build
Zhang Qiang [Fri, 18 Jan 2013 03:34:07 +0000 (22:34 -0500)]
use the processors number instead of hard code 4 to build

'build' can accept --jobs option to set the %jobs and %_smp_mflags
macros for rpm build, so the proper value should be the max number
of (number of system processors, 4)

Change-Id: I55a8111baf3ed04b99aef6865c39ac6e054af48a

11 years agoUse --target option for build to build specified arch,#673
Zhang Qiang [Thu, 17 Jan 2013 21:43:20 +0000 (16:43 -0500)]
Use --target option for build to build specified arch,#673

Change-Id: I36d5f8fd3b9dd485c235e791284da9fc39727f4f

11 years agomodify depanneur_sudo and sudoers configure
Yigang Wen [Mon, 14 Jan 2013 09:11:19 +0000 (17:11 +0800)]
modify depanneur_sudo and sudoers configure

* data/depanneur_sudo only support commands in depanneur:
  sudo "umount"|"mount"|"-E"|"mkdir"|"cp"|"rm"|"echo"
* date/gbs remove "Defaults targetpw" avoid inputing root passwd
  on ubuntu while using sudo xxx

Change-Id: Iebefe369e9ed5143d8b2e6e9f130e57ca8fce7be

11 years agoArch clean up, #654
Zhang Qiang [Mon, 14 Jan 2013 02:20:51 +0000 (10:20 +0800)]
Arch clean up, #654

Remove unsupportted arches, and only leave x86_64, i586, armv7l,
armv7hl, armv6l.

Update this map list:
i586 -> ["i686", "i586", "i486", "i386", "noarch"].

Change-Id: I8db3d0f453a969de51efaff83c7ef1fa2e4b7b6c

11 years agoAdd --no-patch-export option for source export, #594
Zhang Qiang [Tue, 8 Jan 2013 07:55:10 +0000 (15:55 +0800)]
Add --no-patch-export option for source export, #594

Change-Id: I3b8dc811dd59a5cc1ad20a821c4e056e2802c1dd

11 years agoadd sudoer file to avoid input passwd while build
Yigang Wen [Fri, 28 Dec 2012 06:24:38 +0000 (14:24 +0800)]
add sudoer file to avoid input passwd while build

Add a sudoers file for gbs to avoid input passwd for developer
* add data/gbs (sudoers file)
  data/depanneur_sudo (bash script)
* update depanneur and Makefile

Change-Id: I43a2681c7dc17be58ad3f7b6ca1e51895260258c

11 years agoShow the package name for arch incompatible warning
Zhang Qiang [Tue, 25 Dec 2012 04:58:56 +0000 (12:58 +0800)]
Show the package name for arch incompatible warning

Change-Id: I26fe9e4e33d42debbeafb630dcc84b44391fcb78

11 years agouse 'sudo echo' avoid request passwd everytime if NOPASSWD set release-0.3 0.3
Zhang Qiang [Mon, 10 Dec 2012 13:54:26 +0000 (21:54 +0800)]
use 'sudo echo' avoid request passwd everytime if NOPASSWD set

Change-Id: I203ad2384d758d4902d836a3ad78e38d226ff48f

11 years agoAdd archpolicies for supporting more x86 and arm archs
Zhang Qiang [Thu, 29 Nov 2012 08:03:04 +0000 (16:03 +0800)]
Add archpolicies for supporting more x86 and arm archs

Change-Id: I7e22b8ec623316fbc2403187ee0e6deee93c71b0

11 years agoupdate depends and bump to version 0.3
Zhang Qiang [Mon, 26 Nov 2012 07:38:39 +0000 (15:38 +0800)]
update depends and bump to version 0.3

Change-Id: I6b1272608433d681b1b18f7da64540ff80d98ba4

11 years agoAdd --clean-repos option, #548
Zhang Qiang [Tue, 27 Nov 2012 05:20:23 +0000 (13:20 +0800)]
Add --clean-repos option, #548

This option is used to cleanup local repos generated by 'gbs build'

If there're some old RPMs in 'gbs build's local repo, this option
can be used to clean up them.

Change-Id: I905c594d5b9c4b90cd5db8f382512072d74dd5b0

11 years agogive warning if build arch not compatible, #552
Zhang Qiang [Tue, 27 Nov 2012 05:31:42 +0000 (13:31 +0800)]
give warning if build arch not compatible, #552

Change-Id: I7d14fdbee434205c17996a77fc59ad46f8cefbe1

11 years agoWarn user and try again if umount failed
Huang Hao [Mon, 26 Nov 2012 04:02:15 +0000 (12:02 +0800)]
Warn user and try again if umount failed

* use lazy umount to avoid "device is busy" problem
* if umount failed, warn user and add -f to try again

Change-Id: I44bab019d41124002aa191d3d85649f553f016ba

11 years agoNo need archive tar ball for incremental build, #465
Zhang Qiang [Tue, 20 Nov 2012 04:34:03 +0000 (12:34 +0800)]
No need archive tar ball for incremental build, #465

* add is_archive_filename() to check if SOURCE in spec is archive,
  only archive file can be considerd while creating fake tar ball
* parse local copy of spec file directly
* Create fake tarball for rpmbuild

Change-Id: I2a5d9909e8448eb2a54f17287c348faa33cf8b6b

11 years agoSet signal handler before building packages
Zhang Qiang [Fri, 23 Nov 2012 07:09:41 +0000 (15:09 +0800)]
Set signal handler before building packages

Change-Id: I800bbb5aa8f7e8320269b356b05aa88d08771869

11 years agox86_64 support, #527
Zhang Qiang [Tue, 20 Nov 2012 09:40:29 +0000 (17:40 +0800)]
x86_64 support, #527

Change-Id: I59d7919bfa17567c06efd007f19e0435ff28bbb2

11 years agoKeep src rpm for each arch. #365
Huang Hao [Wed, 21 Nov 2012 06:26:40 +0000 (14:26 +0800)]
Keep src rpm for each arch. #365

src rpm files built by different archs are also different, even in
file size. Move src rpm into each repo/$arch dir directly fix #365.

Change-Id: I3627b5ba04caf0ba459c9339b2b4b4fbbec11cd9

11 years agoMerge remote-tracking branch 'origin/release-0.2.1' into devel
Zhang Qiang [Wed, 21 Nov 2012 05:26:54 +0000 (13:26 +0800)]
Merge remote-tracking branch 'origin/release-0.2.1' into devel

11 years agolock shared vars operations to avoid race condition
Zhang Qiang [Sun, 18 Nov 2012 12:46:09 +0000 (20:46 +0800)]
lock shared vars operations to avoid race condition

Basic workflow:

Main thread:
%to_build: all packages need to be built
%order: ready packages queue
<*> scheduler to resolve ready packages in time

shared data:
@done:
@building:

threads:
* Push packages from @building to @done
* Trigger local repo update

Change-Id: Ib48b1c5225a045a8bd3017ff8e0ea656ccc72c97

11 years agoshow build progress for multiple packages build
Zhang Qiang [Sun, 18 Nov 2012 12:26:51 +0000 (20:26 +0800)]
show build progress for multiple packages build

Change-Id: I86e34c28438fe6bb94bc2db3a44be4f11e4cbce7

11 years agoAdd --spec to support multi-spec project
Huang Hao [Wed, 14 Nov 2012 07:33:59 +0000 (15:33 +0800)]
Add --spec to support multi-spec project

--spec can only be used in building one project which contains
several spec files. Argument of --spec should be base file name.
If --commit is also given, depanneur should checkout spec file from
that specific commit to use.

Change-Id: Ie633e73f17a26b0e5b5353c3fd8c1408cea6d293

11 years agoAdd --define option. #540
Huang Hao [Mon, 19 Nov 2012 03:53:00 +0000 (11:53 +0800)]
Add --define option. #540

Change-Id: I2a4d7fa38b2f82f7261e23702e146b1a231cdb06

11 years agoModify SUDOV_PERIOD smaller, fix #526
Yigang Wen [Wed, 14 Nov 2012 07:26:57 +0000 (15:26 +0800)]
Modify SUDOV_PERIOD smaller, fix #526

By default, sudo keeps the password in "memory" for 5 minutes (at
least on Fedora16 and openSUSE12.2). So if you build a big package,
you need input password again while build going, otherwise you will
get a chaos output.

Change-Id: Icfaa36c9aac70ac40df4d64b34bd0c4ee0b4cca4

11 years agoAdd more output info about building status
Zhang Qiang [Wed, 14 Nov 2012 06:03:44 +0000 (14:03 +0800)]
Add more output info about building status

Change-Id: Ie7fd110cbac435e3a28dc1e4072abd1e663f8faa

11 years agoAdd --keep-packs to keep unused packages in buildroot, #516
Zhang Qiang [Wed, 14 Nov 2012 06:01:29 +0000 (14:01 +0800)]
Add --keep-packs to keep unused packages in buildroot, #516

Change-Id: If11f926ee3462e5822daace19d6e0e6d2ca6518b

11 years agouse pkgddeps to resolve build order.
Zhang Qiang [Thu, 8 Nov 2012 16:37:40 +0000 (00:37 +0800)]
use pkgddeps to resolve build order.

pkgdeps include indirect dependency and some pre-install
packges defined in build config, so use pkgdeps will make
dependency of packages with more unexpectted circle, pkgddeps
should be used to calculate build order

Change-Id: I952d53c6bd88542b2b6d45c1c37643c431cd806e

11 years agoShow more complete RPM/SRPM package output path
Zhang Qiang [Wed, 14 Nov 2012 04:48:05 +0000 (12:48 +0800)]
Show more complete RPM/SRPM package output path

* define two vars for rpm local repo patch and srpm repo path
* show complete rpm/srpm repo path

Change-Id: I3d10db28328d0ce86bf53798e6107f19aee2f2d3

11 years agobump to version 0.2.1 release-0.2.1 0.2.1
Zhang Qiang [Tue, 13 Nov 2012 00:53:05 +0000 (08:53 +0800)]
bump to version 0.2.1

Update dependency: tizen-build >= 2012.10.10.1

Change-Id: Ib89981b76be5c4f6dc20145c09098da96883d071

11 years agonoinit support
Zhang Qiang [Fri, 9 Nov 2012 06:54:06 +0000 (14:54 +0800)]
noinit support

* Save build conf to build root for --noinit usage
* --noinit only support building one package
* don't go through scheduler for --noinit and --incremental build
* create a function sunmary_report() to report build status.

Change-Id: If3636458c8ed815231469480263b87d59ff43576

11 years agoSupport build RPM packages for incremental build
Zhang Qiang [Wed, 7 Nov 2012 08:22:57 +0000 (16:22 +0800)]
Support build RPM packages for incremental build

* call --short-circuit --stage=-bs to build PRMs
* copy RPMs to local repo
* make incremental build in scratch.{arch}.*

Change-Id: Idbe915bef86785776bfc755efb1399d232cd5f9a

11 years agoShow local repo and build root info, #482
Zhang Qiang [Thu, 8 Nov 2012 01:53:27 +0000 (09:53 +0800)]
Show local repo and build root info, #482

Change-Id: I8a45ba609f418c305416730361ab2c14e44016b0

11 years agoAdd --packagind-dir option release-0.2 0.2
Markus Lehtonen [Fri, 2 Nov 2012 07:10:27 +0000 (09:10 +0200)]
Add --packagind-dir option

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agochange ccache option as bool type
Zhang Qiang [Wed, 31 Oct 2012 07:36:50 +0000 (15:36 +0800)]
change ccache option as bool type

Change-Id: Ia21883b0d6817b3c3e2ebd367bc466913c56685f

11 years agobump up to version 0.2
Zhang Qiang [Thu, 25 Oct 2012 01:49:56 +0000 (09:49 +0800)]
bump up to version 0.2

Change-Id: I7c16247721283e80e9df8d8f70d2166e54ca8788

11 years agofix typo: lossing ';'
Zhang Qiang [Thu, 25 Oct 2012 01:43:49 +0000 (09:43 +0800)]
fix typo: lossing ';'

Change-Id: Ic852db81e3f0ed43574e6b0b8eae4cfe222d6098

11 years agodepend on tizen-build-2012.10.10
Zhang Qiang [Wed, 24 Oct 2012 06:52:10 +0000 (14:52 +0800)]
depend on tizen-build-2012.10.10

From now on, our owned build will provide 'tizen-build-%{version}',
which can be used to distinguish upstream version, and let depanneur
to depend on our own build.

Change-Id: I7a2e066a6115841bd3b1280176b7126f97375665

11 years agoCheck circle and exit if circle exists, fix#457
Zhang Qiang [Thu, 18 Oct 2012 07:28:50 +0000 (15:28 +0800)]
Check circle and exit if circle exists, fix#457

* split expand_deps into two functions, one is for generating %repo
  and the other is calling Build::readdeps to get build deps
* generate pkgddeps, which is the direct dependency dict, and this
  structure can be used to check dependency circle
* use global $config, and don't need parse everytime

Note: only direct dependency can be used while checking circle.

Change-Id: I47e8374876e043b70b8e50ecf441bf3852d9a30a

11 years agoBuild spec files in ARGV
Huang Hao [Wed, 17 Oct 2012 10:47:19 +0000 (18:47 +0800)]
Build spec files in ARGV

* If specify spec files in ARGV, build them
* If not, find spec files in $package_path and build
* If --buildall is on, build both of them
* In this way to support building one spec file(Fix #386)

Change-Id: Ide633e81e29b436bae61f03d8e7f8587a8a54b8c

11 years agoUpdate dependency to use build-2012-10.10
Zhang Qiang [Thu, 18 Oct 2012 07:06:54 +0000 (15:06 +0800)]
Update dependency to use build-2012-10.10

Change-Id: I41344215acd2c6bd92d6cf7c1de244db87dcf7ad

11 years agoreturn directly if specified specfile is not in a git project
Zhang Qiang [Wed, 17 Oct 2012 07:59:59 +0000 (15:59 +0800)]
return directly if specified specfile is not in a git project

Also change the msg type from debug to warning.

Change-Id: Ib147d051289842df355e0fc16ff1b461f8594251

11 years agoCheck return value of 'gbs export'
Huang Hao [Wed, 17 Oct 2012 08:04:46 +0000 (16:04 +0800)]
Check return value of 'gbs export'

* Fix #403. Exit with no-zero if any error occurs.
* Show error summary at the end. There are three types of errors:
    exporting error, dependency error and rmpbuild error.

Change-Id: I42128c327266f6b4f215ed708fd8caf18452d829

11 years agoIncremantal build on dir that contains only one packages
Huang Hao [Tue, 16 Oct 2012 10:36:37 +0000 (18:36 +0800)]
Incremantal build on dir that contains only one packages

* Fix #400
* Record project base path of packages in %to_build, this base
    path will be used for mount command in incremental building
* Project base path can only be found in git style packages

Change-Id: I3412a6005d1f80c8b01544f705041e26d5150b1c

11 years agoOnly import getpw() when using User::pwent
Huang Hao [Wed, 17 Oct 2012 07:20:51 +0000 (15:20 +0800)]
Only import getpw() when using User::pwent

Otherwise this module will overrite default function getpwuid()

Change-Id: I2bb07069204c8cc6f6b6b2f0644e8e14f68ae02e

11 years agorun sudo -v outof scheduler in main thread
Zhang Qiang [Tue, 16 Oct 2012 23:38:39 +0000 (07:38 +0800)]
run sudo -v outof scheduler in main thread

This also can fix an endless running error if sudo -v timeout in
sub threads

Change-Id: I3c23328279971784651281dfa57927dfd6787b3d

11 years agoextend ~ in env variable
Yigang Wen [Fri, 12 Oct 2012 07:27:59 +0000 (15:27 +0800)]
extend ~ in env variable

extend ~ of $ENV{'TIZEN_BUILD_ROOT'} for #485

11 years agoRevert "Remove trailing slash for proxy env."
Anas Nashif [Tue, 16 Oct 2012 13:31:14 +0000 (06:31 -0700)]
Revert "Remove trailing slash for proxy env."

Sorry, but proxy settings and handling is not part of depanneur, fix it where it occurs.

This reverts commit c5c7b796ad5d67c6bf5fb0e9e7d1c7d7443ae4e7

11 years agoadd alarm to execute "sudo -v" periodly
Yigang Wen [Fri, 12 Oct 2012 09:43:10 +0000 (17:43 +0800)]
add alarm to execute "sudo -v" periodly

Avoid inputing twice password when building a package last long
time, in main thread add alarm to execute "sudo -v" periodly.
fix #460

11 years ago"^C" problem when multithreads stop at "sudo -v"
Yigang Wen [Tue, 16 Oct 2012 08:41:42 +0000 (16:41 +0800)]
"^C" problem when multithreads stop at "sudo -v"

when multithreads stop at "sudo -v", you need input ^C more than
one time to terminate depanneur. The reason is main thread blocked
by "lock($DETACHING)" and it can't response to ^C immediately. So
use another lock variable "$SUDOV_LOCK" for "sudo -v".

11 years agoAdd --debug parameter to gbs export if debug on
Huang Hao [Tue, 16 Oct 2012 02:09:03 +0000 (10:09 +0800)]
Add --debug parameter to gbs export if debug on

Fix #402

Change-Id: I6b3e3d117b03a687e0d3408f3db5de5ae63555c6

11 years agoMore clear and readable info for final error report
Zhang Qiang [Fri, 12 Oct 2012 22:19:39 +0000 (06:19 +0800)]
More clear and readable info for final error report

for build error packages, build log is printed, and for
expansion error packages, details expansion errors are
printed. fix #462.

Change-Id: Ie6b03dec2f61baf7494d48a0af5bbc2b5c0a3f2f

11 years agoUnify color of debug message in gbs, gbp and depanneur.
Huang Hao [Fri, 12 Oct 2012 10:35:59 +0000 (18:35 +0800)]
Unify color of debug message in gbs, gbp and depanneur.

Fix #450.

Change-Id: Ic51970c7b656e843154f3310b31094129a4edb5c

11 years agoRemove trailing slash for proxy env.
Huang Hao [Fri, 12 Oct 2012 08:02:04 +0000 (16:02 +0800)]
Remove trailing slash for proxy env.

Fix #467.

Change-Id: I3dd6957593b3b9645f08dc936afe439ee0acebd9

11 years agoSupport multi spec files in single package.
Huang Hao [Wed, 10 Oct 2012 10:26:09 +0000 (18:26 +0800)]
Support multi spec files in single package.

fix #438.

* get all spec files in fill_packs_from_git()
* split codes that deal with reversion cache codes into three
    functions read_cache(), write_cache() and clean_cache()
* split exporting codes into gbs_export()
* split codes that query git reversion into query_git_commit_rev()
* add a debug message for my_system call
* comment a debug message of checking dependence, it print out
    every second and overwhelm other useful debug message.

Change-Id: I5b295015818d9953b34386e65c74c1b204ede120

11 years agoAdd function worker_thread to cleanup thread status in one place.
Huang Hao [Wed, 10 Oct 2012 05:14:00 +0000 (13:14 +0800)]
Add function worker_thread to cleanup thread status in one place.

The exit condition in main thread loop is to check whether all
tasks had been completed, so any thread should update @done var
when it's about to exit, otherwise main thread would wait it
forever.

Add a function worker_thread which take the jobs of calling detach,
update @running, @done, $dirty, @errors according to value returned
from build_package which focus really on building package.

Change-Id: I2d5bba3265f15b48a853155d9b607edc39800256

11 years agofixed error messages
Anas Nashif [Thu, 11 Oct 2012 16:04:02 +0000 (09:04 -0700)]
fixed error messages

11 years agouse bsd_glob instead of glob in func build_package
Yigang Wen [Thu, 11 Oct 2012 06:07:57 +0000 (14:07 +0800)]
use bsd_glob instead of glob in func build_package

On openSuse 12.2 with perl 5.16 there is 'Segmentation fault'
caused by multithreads while running a depanneur

11 years agoCheck if getlogin fails use getpwuid($<) instead.
Zhang Qiang [Thu, 27 Sep 2012 08:13:30 +0000 (16:13 +0800)]
Check if getlogin fails use getpwuid($<) instead.

getlogin may return empty string in active directory authentication
system, in this case getpwuid($<) is used instead.

Change-Id: I2bfe65caf0518e4eb187fee5c817355988b78bb5

11 years agoUse '/' as VIRTUAL_ENV if VIRTUAL_ENV not set in %ENV
Zhang Qiang [Thu, 27 Sep 2012 05:10:34 +0000 (13:10 +0800)]
Use '/' as VIRTUAL_ENV if VIRTUAL_ENV not set in %ENV

Change-Id: I81c7e3993e533c8168541a8dedfd610b70f88e69

11 years agoSet ENV variable in main thread.
Huang Hao [Thu, 27 Sep 2012 04:14:28 +0000 (12:14 +0800)]
Set ENV variable in main thread.

Change-Id: If968325d996cd991db01887073d4d20af90450e2

11 years agoDon't call exit() in thread.
Huang Hao [Wed, 26 Sep 2012 09:37:28 +0000 (17:37 +0800)]
Don't call exit() in thread.

11 years agofix perlcritic's warning
Huang Hao [Tue, 25 Sep 2012 08:05:22 +0000 (16:05 +0800)]
fix perlcritic's warning

eliminate warning of serverity 5 reported by perlcritic

- code after "use strict"
- default value for $ENV{VIRTUAL_ENV}
- use lexical file handler instead of bareword file handler
- use three-arguments of open
- use "return" instead of "return undef", the latter could evalute
    to one-element list (undef) in list context

11 years agoUse absolute path for --path.
Huang Hao [Tue, 25 Sep 2012 03:14:44 +0000 (11:14 +0800)]
Use absolute path for --path.

- fix bug: can't find spec file if --path is a relative path
- remove tailing white spaces
- remove useless variables in git_wanted
- remove useless $config argument when calling fill_packs_from_git
- remove useless sub wanted

11 years agoAdd missing i386 to the x86 arch_list
Markus Lehtonen [Tue, 25 Sep 2012 11:14:43 +0000 (14:14 +0300)]
Add missing i386 to the x86 arch_list

Otherwise some builds with deps to .i386 rpms may fail.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
11 years agoRemove prototypes of subroutine.
Huang Hao [Mon, 24 Sep 2012 05:38:44 +0000 (13:38 +0800)]
Remove prototypes of subroutine.

Prototype of sub may lead to confusion and is not recommended.

11 years agoLock $dirty to fix for Issue#388
jdong7 [Fri, 21 Sep 2012 02:54:18 +0000 (10:54 +0800)]
Lock $dirty to fix for Issue#388

Change-Id: Ic01d2469c5d50d07dd2988e004711822371b7b9f

11 years agoreport error if building multiple packages for incremental build release-0.1 0.1
Zhang Qiang [Fri, 21 Sep 2012 08:25:57 +0000 (16:25 +0800)]
report error if building multiple packages for incremental build

Change-Id: I759d302f46400f6aba7d4c3445dcb9847885adaa

11 years agoshow full build log path for incremental build
Zhang Qiang [Fri, 21 Sep 2012 07:05:51 +0000 (15:05 +0800)]
show full build log path for incremental build

for incremental build mode, this patch is necessary, as if buildlog
is redirectted to /dev/null, some user don't know where's the log,
and the build results.

Change-Id: I738193275bc5ecc5cd42b9fb0c8df2a879ac2530

11 years ago--clean option should not be used for incremental build mode
Zhang Qiang [Fri, 21 Sep 2012 06:34:18 +0000 (14:34 +0800)]
--clean option should not be used for incremental build mode

If --clean option used for incremental build, all source code will be
removed.

Change-Id: Ie1caa94f57c1a2285d6ecc7c076c2011f91bc559

11 years agoexit thread if killed in the middle of creating build root
Zhang Qiang [Thu, 20 Sep 2012 13:20:05 +0000 (21:20 +0800)]
exit thread if killed in the middle of creating build root

Change-Id: Ia1ada20f3a521ed4d78b08e18c871c83a4e159f8

11 years agoSupport local plain RPM packages dir
Zhang Qiang [Thu, 20 Sep 2012 03:30:37 +0000 (11:30 +0800)]
Support local plain RPM packages dir

Change-Id: I30d71f8a23aacbf97d2322f5f3b0d7b5283abc13