packit / dist-git-to-source-git

Converting dist-git to source-git
MIT License
4 stars 9 forks source link

c-with-prep: comment out patches in the specfile #26

Closed TomasTomecek closed 4 years ago

TomasTomecek commented 4 years ago

so that packit can create them and can be used during build

this is a short-term solution, we aim to go towards patch metadata

TODO:

Long term todo:

softwarefactory-project-zuul[bot] commented 4 years ago

Build succeeded.

lachmanfrantisek commented 4 years ago

this is a short-term solution, we aim to go towards patch metadata

Is it possible to use metadata also in this case and use present_in_specfile=False to indicate that we are commenting on out those? With those information provided, we might be able to uncomment the correct line when going backwards.

Or that was what you want to do later?

TomasTomecek commented 4 years ago

the problem is that implementing patch metadata is really tricky b/c it needs to be done on RPM macros level

dhodovsk commented 4 years ago

When building drpm converted by this version I got:

+ cd drpm-0.4.1
+ /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ /usr/bin/cat /builddir/build/SOURCES/0001-drpm-0.4.1-base.patch
+ /usr/bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch
The next patch would create the file CMakeLists.txt,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
The next patch would create the file COPYING,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
The next patch would create the file LICENSE.BSD,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
The next patch would create the file doc/CMakeLists.txt,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored

......(some more ignore messages).....

The next patch would create the file test/refseqfile-copy.txt,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
error: Bad exit status from /var/tmp/rpm-tmp.IjgEUe (%prep)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.IjgEUe (%prep)
Child return code was: 1
EXCEPTION: [Error()]
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/mockbuild/trace_decorator.py", line 93, in trace
    result = func(*args, **kw)
  File "/usr/lib/python3.6/site-packages/mockbuild/util.py", line 776, in do_with_status
    raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode)
mockbuild.exception.Error: Command failed:
 # bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/drpm.spec
TomasTomecek commented 4 years ago

When building drpm converted by this version I got:


...
The next patch would create the file test/refseqfile-copy.txt,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
error: Bad exit status from /var/tmp/rpm-tmp.IjgEUe (%prep)

Thank you, I just tried it on "rpm" and sent the PR here. We basically need PACKIT-531 to resolve it (metadata + apply patches in source-git using patch).

dhodovsk commented 4 years ago

When building drpm converted by this version I got:

...
The next patch would create the file test/refseqfile-copy.txt,
which already exists!  Assume -R? [n]
Apply anyway? [n]
1 out of 1 hunk ignored
error: Bad exit status from /var/tmp/rpm-tmp.IjgEUe (%prep)

Thank you, I just tried it on "rpm" and sent the PR here. We basically need PACKIT-531 to resolve it (metadata + apply patches in source-git using patch).

It's happening also on master so I use d1054e6403bbe01d7074b3bcbb4d6cf25a27dfaa now

TomasTomecek commented 4 years ago

@dhodovsk yup, exactly the same use case - I had to git reset --hard HEAD^^

I pushed the tagging changes, so this should be good to merge, I am going to create several test cases (real conversions) now and continue working on the patch/git-apply problem.

softwarefactory-project-zuul[bot] commented 4 years ago

Build succeeded.

TomasTomecek commented 4 years ago

=== 1 failed, 2 passed in 89.62 seconds ===

The test failure is coming from rpm that the patches cannot be applied.

softwarefactory-project-zuul[bot] commented 4 years ago

Build succeeded.

TomasTomecek commented 4 years ago

Merging, feel free to review still