Opened 10 years ago

Closed 10 years ago

#4088 enhancement closed fixed (fixed)

tap2rpm can't handle .tac files outside the current directory

Reported by: TimAllen Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: therve Branch: branches/tap2rm-path-4088
branch-diff, diff-cov, branch-cov, buildbot
Author: therve


If I have a .tac file in the current directory, I can package it easily enough:

tap2rpm -t foo.tac

But if the .tac file is in a different directory, things don't work:

# Doesn't work
tap2rpm -t resources/foo.tac

The .spec file that tap2rpm produces is hard-coding the filename in an awkward way, causing rpm to choke:

[... other output ...]
+ cp resources/foo.tac /var/tmp/twisted-foo-1.0-root/etc/twisted-taps/
cp: cannot stat `resources/foo.tac': No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.42424 (%install)

Attachments (1)

tap2rpm-path-handling-4088.patch (916 bytes) - added by Screwtape 10 years ago.
Test that tap2rpm handles .tap files outside the current directory.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 10 years ago by TimAllen

This ticket split off from #3292.

comment:2 Changed 10 years ago by therve

Cc: therve added
Owner: changed from Glyph to TimAllen

It might be fixed in r28572. Could you write a test case for it, Tim? Thanks!

Changed 10 years ago by Screwtape

Test that tap2rpm handles .tap files outside the current directory.

comment:3 Changed 10 years ago by Screwtape

Keywords: review added
Owner: TimAllen deleted

The attached patch against today's SVN trunk passes on my home machine (Ubuntu 9.10, Python 2.6, RPM 4.7.0) although because r28572 is already merged I can't be exactly sure that it would have failed with the previous version of tap2rpm.

tap2rpm takes the tapfile from the command-line, and packages it in a source tarball for RPM to read. I believe the previous version of tap2rpm was using putting the tapfile into the tarball at some path A, but putting the original filesystem path B into the RPM .spec file. Hence, RPM couldn't find the tapfile unless B happened to exactly match A. If I hack the new tap2rpm to make the same parameter/basename confusion:

diff --git a/twisted/scripts/ b/twisted/scripts/
index 4b2ba8e..652c8ad 100755
--- a/twisted/scripts/
+++ b/twisted/scripts/
@@ -263,7 +263,7 @@ def setupBuildFiles(buildDir, config):
             'rpm_file': config['rpmfile'],
             'version': config['set-version'],
             'tarfile_basename': tarballName,
-            'tap_file': tapFileBase,
+            'tap_file': config['tapfile'],
             'date': time.strftime('%a %b %d %Y', time.localtime(time.time())),
             'maintainer': config['maintainer'],
             'long_description': config['long_description'],

...the attached test fails in exactly the way described in comment 0, so I believe this is a correct test.

comment:4 Changed 10 years ago by therve

Author: therve
Branch: branches/tap2rm-path-4088

(In [28591]) Branching to 'tap2rm-path-4088'

comment:5 Changed 10 years ago by therve

(In [28592]) Apply patch with test

Refs #4088

comment:6 Changed 10 years ago by therve

Keywords: review removed
Owner: set to therve

comment:7 Changed 10 years ago by therve

Resolution: fixed
Status: newclosed

(In [28594]) Merge tap2rm-path-4088

Author: TimAllen Reviewer: therve Fixes #4088

Add a test for verifying that tap2rpm handles correctly tac files outside of the current directory.

comment:8 Changed 9 years ago by <automation>

Owner: therve deleted
Note: See TracTickets for help on using tickets.