question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Packit doesn't handle Source0 with symbol '-' after %{version}

See original GitHub issue

I was updating our spec file to match Fedora guidelines. One of the things is to make sure your Source0 is actually pointing to the tarball.

I updated Source0 from %{name}-%{version}.tar.gz to %{name}-%{version}-1.tar.gz.

The -1 is created by tito in our case because the tag ends up with -1. Everything was fine and I wanted to create a new build via packit.

I’ve got the following error:

packit.exceptions.PackitSRPMException: Preparing of the upstream to the SRPM build failed: The target archive doesn't use a common extension (.tar.gz, .tar.bz2, .tar.xz, .zip), git archive can't be used. Please provide your own script for archive creation.

I did some debug and I noticed that assumed extension is -1.tar.gz

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TomasTomecekcommented, Apr 1, 2020

So my PR should fix this:

$ git clone git@github.com:beaker-project/restraint.git && cd restraint

$ echo "Change the spec and put the former Source suffix in"

$ git commit -a -m "readd -" .
[master 49f8a12] readd -
 1 file changed, 1 insertion(+), 1 deletion(-)

$ packit srpm
Packit 0.9.0 is being used.
Input is a directory: /home/tt/t/restraint
Input directory is an upstream repository.
SRPM is /home/tt/t/restraint/restraint-restraint.0.1.45.1-1.20200401111425965056.44.g49f8a12.fc31.src.rpm
SRPM: /home/tt/t/restraint/restraint-restraint.0.1.45.1-1.20200401111425965056.44.g49f8a12.fc31.src.rpm

$ git diff
diff --git a/specfiles/restraint-upstream.spec b/specfiles/restraint-upstream.spec
index 3bb7850..9ef43ff 100644
--- a/specfiles/restraint-upstream.spec
+++ b/specfiles/restraint-upstream.spec
@@ -1,12 +1,12 @@
 Name:          restraint
-Version:   0.1.45
-Release:   1%{?dist}
+Version:     restraint.0.1.45.1
+Release:     1.20200401111425965056.44.g49f8a12%{?dist}
 Summary:       Simple test harness which can be used with beaker

 Group:         Applications/Internet
 License:       GPLv3+ and MIT
 URL:           https://github.com/beaker-project/%{name}
-Source0:   https://github.com/beaker-project/restraint/archive/%{name}-%{version}-1.tar.gz
+Source0: restraint-restraint.0.1.45.1.tar.gz

 BuildRequires:         gcc
 BuildRequires:         gcc-c++
@@ -50,7 +50,7 @@ With the restraint client you can run jobs outside of beaker.  This will provide
 restAPI allowing all results and logs to be recorded from the test machine.

 %prep
-%setup -q
+%setup -q -n restraint-restraint.0.1.45.1

 %build
 export CFLAGS="$RPM_OPT_FLAGS"
0reactions
TomasTomecekcommented, Mar 31, 2020

interesting: it was literally a bug that rebase-helper did not commit the Source change to disk - so the old one was kept

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration - Packit
Configuration # Packit uses a configuration file in the upstream repository. The config file is ... PACKIT_PROJECT_VERSION - version from git describe ...
Read more >
FAQ - PackIt
FREEZABLE PRODUCTS How long do PackIt Lunch Bags stay cold? Once they're frozen, PackIt bags can keep food cool for up to 8...
Read more >
Interface and Hardware Component Command ... - Cisco
10.1 20.20.20.1. The bundle-hash command does not display all possible IP addresses in an entire series. It stops displaying addresses after all ...
Read more >
RPM Guide
You can install a package more than once. The rpm command won't complain. The upgrade operation, though, will remove all other versions of...
Read more >
Frequently Asked Questions — DeepStream 6.1.1 Release ...
This is a harmless warning indicating that the DeepStream's nvinferserver plugin cannot be used since “Triton Inference Server” is not installed ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found