Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #258 from euanh/planex-0.7.3
Browse files Browse the repository at this point in the history
Planex 0.7.3
  • Loading branch information
euanh committed Mar 14, 2016
2 parents de5772c + 1242e33 commit a67fe29
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.7.3
* planex-fetch: Handle Source URLs with fragments correctly

0.7.2
* planex-pin: It is now possible to pin to a bare Git repository
* planex-cache: Use yum configuration but not mock configuration when
Expand Down
5 changes: 4 additions & 1 deletion planex.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: RPM/deb build tool
Name: planex
Version: 0.7.2
Version: 0.7.3
Release: 1%{?dist}
URL: http://github.com/xenserver/planex
Source0: http://github.com/xenserver/planex/archive/v%{version}/%{name}-%{version}.tar.gz
Expand Down Expand Up @@ -45,6 +45,9 @@ sed -i "s/\(version='\)[^'\"]\+/\1%{version}-%{release}/g" setup.py
%config%{_sysconfdir}/bash_completion.d/planex.bash

%changelog
* Mon Mar 14 2016 Euan Harris <[email protected]> 0.7.3-1
- planex-fetch: Handle Source URLs with fragments correctly

* Tue Nov 10 2015 Euan Harris <[email protected]> - 0.7.2-1
- planex-pin: It is now possible to pin to a bare Git repository
- planex-cache: Use yum configuration but not mock configuration when
Expand Down
27 changes: 9 additions & 18 deletions planex/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os
import re
import rpm
import urlparse

from planex import debianmisc

# Could have a decorator / context manager to set and unset all the RPM macros
Expand Down Expand Up @@ -146,25 +146,16 @@ def source_urls(self):

def source_paths(self):
"""Return the filesystem paths to source files"""
sources = []
for source in self.source_urls():
url = urlparse.urlparse(source)

# Source comes from a remote HTTP server
if url.scheme in ["http", "https", "file"]:
sources.append(os.path.join(sourcedir(),
os.path.basename(url.path)))

# Source comes from a local file or directory
if url.scheme in ["git", "hg"]:
sources.append(
os.path.join(sourcedir(), os.path.basename(url.fragment)))

# Source is an otherwise unqualified file, probably a patch
if url.scheme == "":
sources.append(os.path.join(sourcedir(), url.path))
# RPM only looks at the basename part of the Source URL - the
# part after the rightmost /. We must match this behaviour.
#
# Examples:
# http://www.example.com/foo/bar.tar.gz -> bar.tar.gz
# http://www.example.com/foo/bar.cgi#/baz.tbz -> baz.tbz

return sources
return [os.path.join(sourcedir(), os.path.basename(url))
for url in self.source_urls()]

# RPM build dependencies. The 'requires' key for the *source* RPM is
# actually the 'buildrequires' key from the spec
Expand Down

0 comments on commit a67fe29

Please sign in to comment.