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

Allow to use "tar" service also standalone. #483

Merged

Conversation

adrianschroeter
Copy link
Member

One use case is to maintain a package in git repo and just create tar balls at buildtime.

Example (in this case with submodule) can be found here

https://github.com/adrianschroeter/git-example-4

TarSCM/scm/tar.py Outdated Show resolved Hide resolved
TarSCM/scm/tar.py Outdated Show resolved Hide resolved
TarSCM/scm/tar.py Outdated Show resolved Hide resolved
TarSCM/scm/tar.py Outdated Show resolved Hide resolved
@adrianschroeter adrianschroeter force-pushed the tar_with_git_package branch 2 times, most recently from 82fdcd4 to bedf1ea Compare February 14, 2024 11:47
TarSCM/scm/tar.py Outdated Show resolved Hide resolved
@adrianschroeter adrianschroeter force-pushed the tar_with_git_package branch 2 times, most recently from 5573047 to b5b1742 Compare February 14, 2024 11:52
@M0ses
Copy link
Collaborator

M0ses commented Feb 20, 2024

Try this patch to get the behavior like before and fix the test suite

diff --git a/TarSCM/scm/tar.py b/TarSCM/scm/tar.py
index a38f74d..868f766 100644
--- a/TarSCM/scm/tar.py
+++ b/TarSCM/scm/tar.py
@@ -26,7 +26,7 @@ class Tar(Scm):
         if self.args.filename:
             self.basename = self.clone_dir = self.args.filename
 
-        if self.args.version:
+        if self.args.version and self.args.version != '_auto_':
             version = self.args.version
 
         if not self.basename or not self.clone_dir:
@@ -37,7 +37,7 @@ class Tar(Scm):
             sys.exit("name in obsinfo contains '/'.")
 
         if "/" in version or '..' in version:
-            sys.exit("version in obsinfo contains '/' or '..'.")
+            raise SystemExit("version in obsinfo contains '/' or '..'.")
 
         if version != '' and version != '_none_':
             self.clone_dir += "-" + version
diff --git a/tests/unittestcases.py b/tests/unittestcases.py
index 26866c2..917afdf 100644
--- a/tests/unittestcases.py
+++ b/tests/unittestcases.py
@@ -316,7 +316,7 @@ class UnitTestCases(unittest.TestCase):
         six.assertRaisesRegex(
             self,
             SystemExit,
-            re.compile("verion in obsinfo contains '/' or '..'."),
+            re.compile("version in obsinfo contains '/' or '..'."),
             scm_object.fetch_upstream
         )
 
@@ -330,7 +330,7 @@ class UnitTestCases(unittest.TestCase):
         six.assertRaisesRegex(
             self,
             SystemExit,
-            re.compile("verion in obsinfo contains '/' or '..'."),
+            re.compile("version in obsinfo contains '/' or '..'."),
             scm_object.fetch_upstream
         )
 

One use case is to maintain a package in git repo and just
create tar balls at buildtime.

Example (in this case with submodule) can be found here

  https://github.com/adrianschroeter/git-example-4

CC-Author: Frank Schreiner <fschreiner@suse.de>
@adrianschroeter adrianschroeter merged commit 6f1365a into openSUSE:master Feb 21, 2024
7 checks passed
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.

3 participants