Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make requirement on rpm-build strong on OpenSUSE #1

Open
wants to merge 150 commits into
base: experimental-rpm
Choose a base branch
from

Conversation

kaharlichenko
Copy link
Contributor

Even though OpenSUSE is the only rpm-based distro
that supports so called weak requirements
requirement on rpm-build should be strong.

Otherwise gbp just cannot build the package.

Git-buildpackage-rpm now always updates the 'VCS:' tag in the exported
spec file. A new config option 'spec-vcs-tag' controls the format:
- if empty, no 'VCS' tag is inserted and possible old 'VCS' tag is
  removed
- otherwise, a 'VCS' tag is inserted or the old 'VCS' tag is updated

- '%(tag)s' expands to the long tag name (from git-describe)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add a new commandline option to ignore untracked files. Untracked files
are ignored and do not cause an error. However, an error is given if
there are changes to tracked files.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add support for reading the local config file(s) from a given git
tree-ish.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Read the local gbp config (.gbp.conf, debian/gbp.conf) from the exported
tree instead of the current working copy. This makes sure that we build
correctly even if building something else than the current working copy.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Use the --all option of git-add so that all tracked files are updated in
all conditions. Previously deletion of tracked files was not staged, for
example.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
With this option you can either only update already tracked files to
index the (untracked=False) or add new files, too.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Whether to ignore untracked files (untracked=False) or not
(untracked=True). Now, clones the temporary index file from the actual
index, in order to correctly update files.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Add support for building different kind of "working copies", when using
the --git-export option:
- 'WC.TRACKED': only take files that are already tracked
- 'WC.UNTRACKED': take untracked files, too
- 'WC.IGNORED': also add files that'd normally be ignored

Using '--git-export=WC' behaves like before.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add new possible keywords to be used in packaging-tag format string:
'nowtime', 'authortime', 'committime', 'nowtimenum', 'authortimenum' and
'committimenum'.

The '*timenum' keyword denote the corresponding '*time' keyword appended
with an additional incremental serial number. E.g. if 'nowtime' would
produce '20120531', 'nowtimenum' would (the first time) produce
'20120531.1'. If a new tag would be created on the same date, the field
would expand to '20120531.2' etc.

What is completely missing is a way to support these new tag keywords in
git-import-srpm tool. So, if you use these tags, git-import-srpm is not
able to reproduce the tags, (and, it is not necessarily able to
correctly tell if you've already imported a certain version of the
package).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Redirect stdout and stderr of the (child) command to sys.stdout and
sys.stderr of the caller, respectively. This change is mainly for the
unit tests. It makes Python nose to correctly capture the output of the
child command, too, which in turn suppresses a lot of spurious output
when running nosetests.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Reduces spurious output from rpmbuild.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Separate keywords for packaging and upstream tag names. Also, add more
tests for tagging options.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
The name of the package containing zipmerge varies, e.g. 'libzip' in
Fedora 22 vs. 'libzip-tools' in Fedora 23.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Corresponding the --skip-debian-tag options of import-dsc.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Prevent a crash when the author (for a raw diff) was None because no
name/email could be determined from git config or environment variables.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add some missing (build) dependencies if unit tests are enabled as part
of the build process.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Similar to what the option does in git-import-orig-[rpm].

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This updates all remote-tracking branches (for the remote that is
fetched from) whose local branch name is identical to the remote branch
name.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Makes it possible to only checkout certain files from a branch, instead
of switching to the branch. Add a new method instead of extending
checkout() in order to keep it consistent. That is, otherwise checkout()
would have totally different outcome depending on whether paths were
defined of not.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Treat non-checked-out branches similarly to the current branch when
forcing update. That is, do git merge, instead of just setting the ref.

Also, renames fast_forward_branch() to update_branch() to better match
the functionality.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
The new option can be used to "copy" files from the packaging branch to
the patch-queue branch when doing pq import. The files defined with this
option will appear as new files in one monolithic commit in the
development/patch-queue branch.

By default, the local gbp conf files are imported in order to try to
ensure that gbp sees the same settings on the patch-queue branch as
on the packaging branch.

NOTE: This option does not affect the importing (i.e. apply and commit)
of patches.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This allows initialization of a GitRepository object, even if the
current working directory (or path given to GitRepository) is not the
top level directory of the git repository.

Don't guess the git meta data dir, but, take it as reported by git
itself.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add a new _git_inout2() helper method that returns the git output
(stdout) as a generator - instead of all stdout data in one string.
Useful for handling git commands that are expected to have a lot of
stdout data, like git-archive.

Also, changes the private __git_inout() method to return a generator.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Return tar data as a generator object, if the 'output' option is not
defined.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Make dump_tree() utilize the GitRepository.archive() method - similarly
to git_archive_submodules() - instead of ad-hoc Python pipes. This makes
dump_tree() work independent of the callers current working directory.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This should make the usage of gbp-pq more flexible and prevent mistakes
caused by e.g. running gbp-pq import under some subdirectory.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
marquiz and others added 19 commits December 14, 2015 11:59
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Add tests for features that didn't have one, yet.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Three split packages: git-buildpackage-{common,rpm,doc}

Signed-off-by: Junchun Guan <junchunx.guan@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Better compatibility with 3rd party modules that have their own logging
initializations.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This is the first tool in an effort of enabling gbp in the BitBake build
environment. Gbp-import-bb is a tool for importing packages from a
BitBake-based "combined" distro repository into individual per-package
Git repositories.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This is a tool for managing patch-queues for packages maintained in the
BitBake packaging format (.bb recipes).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Initial version of the tool for building BitBake packages from Git.

NOTE: The buildpackage-bb tool itself is able to operate even without an
initialized BitBake build environment although the build likely fails in
this case. However, this makes it possible to export the packaging meta
data, for example.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This is a new tool for helping to clone remote per-package Git
repositories when working in BitBake-based "full distro" build
environment. This is useful in the case that individual packages are
actually maintained in per-package Git repositories (like Tizen). That
is, the full distro repository that the developer operates in is
composed of the packaging meta data from the individual per-package
repositories. When willing to contribute to a package the developer
would use clone-bb to clone the correct per-package repository and make
his changes there.

NOTE: clone-bb uses GBP_PACKAGING_REPO variable to determine the remote
repository URI. This variable should be defined in the package recipes
in order to make clone-bb usable.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
For forcing the creation of annotated tags. Causes the an editor to be
spawned if no message is given.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
This is a Tizen-specific tool for creating and pushing special submit
tags.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Change-Id: I3123ca6f024dcdd380e745f3bbadaba3f5bfc098
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Old versions of python-six shipped on e.g. Debian 7, Ubuntu 12.04 and
openSUSE 12.3 do not contain urllib.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Even though OpenSUSE is the only rpm-based distro
that supports so called weak requirements
requirement on rpm-build should be strong.

Otherwise gbp just cannot build the package.
@marquiz
Copy link
Owner

marquiz commented Jan 7, 2016

I'm not sure I agree, because one doesn't necessarily use 'rpmbuild' to build the package. E.g. in the case of openSUSE you possibly use 'osc' and don't need rpm-build at all.

@kaharlichenko
Copy link
Contributor Author

Hm, maybe I misunderstand something. Here's how I usually use gbp to build a package:

  1. start a clean environment (a Docker or an LXC container);
  2. put the whole git repo into the container;
  3. install git-buildpackage (on DEB based distros) or git-buildpackage-rpm (on RPM based distros);
  4. extract and install the build dependencies (via mk-build-deps on DEB based distros, rpmspec --query --buildrequires on RPM distros);
  5. run gbp buildpackage or gbp buildpackage-rpm.

This flow works like a charm for building the packages on Jenkins for all the distros we are shipping our products to. The trick is that git-buildpackage or git-buildpackage-rpm package installed in (3) above pulls all the necessary build tools at least on Debian, Ubuntu, Fedora and CentOS. The only distro that fails is OpenSUSE, because it has a weak dependency on rpmbuild which is used internally by gbp rpm.

The question is: why is OpenSUSE any different from the rest of RPM based distros? I'm not using OBS, but even if I would - from what I know it uses rpmbuild internally anyway.

@marquiz
Copy link
Owner

marquiz commented Jan 13, 2016

git-buildpackage-rpm does not necessarily use rpmbuild at all. You can define the builder command with '--git-builder'. rpmbuild is the default builder but git-buildpackage-rpm works perfectly fine without it. In openSUSE people might use the 'osc' tool for building packages. Similarly, on Fedora systems people probably want to use the 'mock' tool for building packages. These tools do not require the presence rpmbuild on the host system. This reminds me that rpm in newer Fedora systems support weak dependencies, as well, so rpmbuild could be a weak dependency there, too.

@kaharlichenko
Copy link
Contributor Author

This reminds me that rpm in newer Fedora systems support weak dependencies, as well, so rpmbuild could be a weak dependency there, too.

It looks like with these comments I made it even worse - instead of getting a strong dependency on rpm-build on OpenSUSE I might get a weak dependency on Fedora 😄 .

I'm currently trying to create a generic solution to build the RPM's for git-buildpackage-rpm for each of the RPM based distro (to start from Fedora, CentOS and OpenSUSE) and for each of their current versions. The solution is based on Docker, would you be interested in a pull request with it?

@marquiz
Copy link
Owner

marquiz commented Jan 13, 2016

It looks like with these comments I made it even worse - instead of getting a strong dependency on rpm-build on OpenSUSE I might get a weak dependency on Fedora 😄 .

Can't you just install git-buildpackage-rpm AND rpm-build, if you're solution is depending on rpmbuild?

I'm currently trying to create a generic solution to build the RPM's for git-buildpackage-rpm for each of the RPM based distro (to start from Fedora, CentOS and OpenSUSE) and for each of their current versions. The solution is based on Docker, would you be interested in a pull request with it?

Yeah, why not. OTOH, you could try to push your patches directly to upstream, i.e.
https://github.com/agx/git-buildpackage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants