[packages/git-core-slug] - rel 5; work with packet-ref, too

arekm arekm at pld-linux.org
Thu Nov 20 13:20:58 CET 2014


commit 5816899207e8e43e391d17c345822db82e115acc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Thu Nov 20 13:20:53 2014 +0100

    - rel 5; work with packet-ref, too

 git-core-slug-packet-ref.patch | 25 +++++++++++++++++++++++++
 git-core-slug.spec             |  4 +++-
 2 files changed, 28 insertions(+), 1 deletion(-)
---
diff --git a/git-core-slug.spec b/git-core-slug.spec
index 357ea4e..c574912 100644
--- a/git-core-slug.spec
+++ b/git-core-slug.spec
@@ -3,7 +3,7 @@ Summary:	Tools to interact with PLD git repositories
 Summary(pl.UTF-8):	Narzędzia do pracy z repozytoriami gita w PLD
 Name:		git-core-slug
 Version:	0.13.4
-Release:	4
+Release:	5
 License:	GPL v2
 Group:		Development/Building
 Source0:	https://github.com/draenog/slug/tarball/v%{version}/%{name}-%{version}.tar.gz
@@ -12,6 +12,7 @@ Source1:	slug_watch.init
 Source2:	crontab
 Source3:	slug_watch.sysconfig
 Source4:	slug_watch-cron
+Patch0:		%{name}-packet-ref.patch
 URL:		https://github.com/draenog/slug
 BuildRequires:	asciidoc
 BuildRequires:	docbook-dtd45-xml
@@ -52,6 +53,7 @@ do uruchamiania na serwerze gitolite PLD.
 %prep
 %setup -qc
 mv draenog-slug-*/* .
+%patch0 -p1
 
 %build
 %{__python3} setup.py build
diff --git a/git-core-slug-packet-ref.patch b/git-core-slug-packet-ref.patch
new file mode 100644
index 0000000..7c6ca22
--- /dev/null
+++ b/git-core-slug-packet-ref.patch
@@ -0,0 +1,25 @@
+--- a/git_slug/gitrepo.py.org	2014-11-20 12:53:31.342320473 +0100
++++ b/git_slug/gitrepo.py	2014-11-20 12:53:15.482453868 +0100
+@@ -82,12 +82,21 @@ class GitRepo:
+             'refs/notes/*:refs/notes/*'])
+ 
+     def check_remote(self, ref, remote=REMOTE_NAME):
++        localref = EMPTYSHA1
+         ref = ref.replace(REFFILE, os.path.join('remotes', remote))
+         try:
+             with open(os.path.join(self.gdir, ref), 'r') as f:
+                 localref = f.readline().strip()
+         except IOError:
+-            localref = EMPTYSHA1
++            try:
++                with open(os.path.join(self.gdir, 'packed-refs')) as f:
++                    for line in f:
++                        line_data = line.split()
++                        if len(line_data) == 2 and line_data[1] == ref:
++                            localref = line_data[0].strip()
++                            break
++            except IOError:
++                pass
+         return localref
+ 
+     def showfile(self, filename, ref="/".join([REMOTE_NAME, "master"])):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/git-core-slug.git/commitdiff/5816899207e8e43e391d17c345822db82e115acc



More information about the pld-cvs-commit mailing list