Jul 26, 2011
I've noticed quite a few times that people add comments to their
Source0: urls without macros to seemingly simplify manual
downloading. It looks like this:
*Edit*: Probably much nicer way to do the same thing already present on your system (courtesy of Alexander Kurtakov):
Name: jsoup
Version: 1.6.1
...
# http://jsoup.org/packages/jsoup-1.6.1-sources.jar
Source0: http://%{name}.org/packages/%{name}-%{version}-sources.jar
This creates burden on maintainers to keep those urls
up-to-date as version changes, so I created simple python script for
printing out Source urls from spec files:
#!/usr/bin/python
import rpm
import sys
ts=rpm.TransactionSet()
spec_obj = ts.parseSpec(sys.argv[1])
sources = spec_obj.sources
for url, num, flags in sources:
print url
Chmod this +x, put into your PATH and enjoy by giving it path to spec file.*Edit*: Probably much nicer way to do the same thing already present on your system (courtesy of Alexander Kurtakov):
spectool X.specI knew there was something like this, but forgot what it was. Oh well...2 minutes lost.
Why didn't use just use spectool -s
And actually there is also
spectool -g name.spec
which downloads Source files. Usually when rebasing a package, I change .spec file and then run spectool -g specfile. By that I know I have Source tags right.