DevHeads.net

Postings by Pat Riehecky

Update API path in centos.git.repolist.py

diff --git a/centos.git.repolist.py b/centos.git.repolist.py
index 75122ae..e135ca7 100755
--- a/centos.git.repolist.py
+++ b/centos.git.repolist.py
@@ -13,7 +13,7 @@ import requests
import simplejson as json
import sys

-RPCURL = "https://git.centos.org/rpc?req=LIST_REPOSITORIES"
+RPCURL = "https://git.centos.org/rpc/?req=LIST_REPOSITORIES"

def read_args():
'''
@@ -48,6 +48,11 @@ def get_repo_list(url, branch, projectpath):
print err_msg
sys.exit(1)

+ if req.status_cod

better error reporting on invalid dir

Recently I've found it handy to know where I am when the various commands
complain about an invalid source directory.

So I've added slightly more detail to the resulting error message.
Odds are it shouldn't bug any existing tools and help with troubleshooting
mass commands.

Pat Riehecky (1):
Better error reporting on invalid dirs

get_sources.sh | 3 ++-
into_srpm.sh | 3 ++-
return_disttag.sh | 3 ++-
show_possible_srpms.sh | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)

Some packages seem to want to know where 'topdir' is....

diff --git a/return_disttag.sh b/return_disttag.sh
index 2c1e522..0048cd6 100755
--- a/return_disttag.sh
+++ b/return_disttag.sh
@@ -25,12 +25,12 @@ build_with_dist_scl() {
SCL=${3:-}

if [[ "x${SCL}" == 'x' ]]; then
- result=$(rpm --define "dist ${DIST}" -q --specfile "${SPECFILE}" --qf '%{n}-%{v}-%{r}\n' 2>/dev/null | head -n 1)
+ result=$(rpm --define "%_topdir `pwd`" --define "dist ${DIST}" -q --specfile "${SPECFILE}" --qf '%{n}-%{v}-%{r}\n' 2>/dev/null | head -n 1)
else

Updates for scl 1.2/devtoolset-3

The previous return_disttag code expected a smaller number of '-'
in the SCL name. This newer version now searches a bit more rationally.

I should have written it this way from the start....

Pat Riehecky (1):
Updated for compat with devtoolset-3 software collection name

return_disttag.sh | 25 ++++++++++++-------------
1 files changed, 12 insertions(+), 13 deletions(-)

A few more SCL related changes

rpmbuild fails to parse specfiles that have the SCL macros in them when
the basic macros are not defined.

Send these errors to stderr

diff --git a/get_sources.sh b/get_sources.sh
index 210d9ad..0a22451 100755
--- a/get_sources.sh
+++ b/get_sources.sh
@@ -141,7 +141,7 @@ shopt -s nullglob
set -- .*.metadata
if (( $# == 0 ))
then
- echo 'Missing metadata. Please run from inside a sources git repo'
+ echo 'Missing metadata.

Added option to set explicit %dist per request

diff --git a/into_srpm.sh b/into_srpm.sh
index 6ff2260..8c2434c 100755
--- a/into_srpm.sh
+++ b/into_srpm.sh
@@ -13,7 +13,7 @@
#####################################################################
usage() {
echo '' >&2
- echo "$0 [-htq] [-b branch] [-c shasum]" >&2
+ echo "$0 [-hqts] [-d dist] [-b branch] [-c shasum]" >&2
echo '' >&2
echo 'You need to run t

A few updates to into_srpm.sh

Just adding a few simple features to into_srpm.sh

It now works with software collecions, but only if you want.

I've also added a switch for "preserving" the timestamps of
srpms created by this script, based on the the commit timestamp.
It is off by default as I'm not sure how comfortable various users
are with this script making 'old' files.

Provide link to rpkg upstream comments on patches for downloads

diff --git a/src/centpkg/__init__.py b/src/centpkg/__init__.py
index eff2a72..c1a58aa 100644
--- a/src/centpkg/__init__.py
+++ b/src/centpkg/__init__.py
@@ -78,6 +78,9 @@ class Commands(pyrpkg.Commands):
def sources(self, outdir=None):
"""Download source files"""

+ # See also:
+ # <a href="https://lists.fedoraproject.org/pipermail/buildsys/2014-July/004313.html" title="https://lists.fedoraproject.org/pipermail/buildsys/2014-July/004313.html">https://lists.fedoraproject.org/pipermail/buildsys/2014-July/004313.html</a>
+ #
# in 'super' the sources function expects a file named 'sources' to be in the base directory.

Just curious about accounts on the cbs

Just wondering what authentication software you were looking at.

These days, I've found FreeIPA to be surprisingly feature rich (and
bundled with the OS!).
-LDAP
-Kerberos
-Certificates
-Multi-Master replication
-Password policies

All built in!

There is a Samba hook too, but I'm not sure that is relevant here....

The FreeIPA devs are also very nice people who've been receptive to
feature requests.

Mostly I'm just curious what people are thinking .....

Pat

Somewhat standardize overrides and on getopt

These three patches try and create a generic interface for some basic
overrides, drawing from get_sources.sh

I've also updated get_sources.sh to utilize getopt for arg parsing

Pat Riehecky (3):
Allow overrides of $RHELAUTHOR
May want to set defaults from the override file....
Refactor to use getopt for arg parsing

get_sources.sh | 151 ++++++++++++++++++++++++++++++++++++------------
show_possible_srpms.sh | 11 +++-
2 files changed, 122 insertions(+), 40 deletions(-)

Updated into_srpm.sh

With the recent adjustment of README.md to add GPLv2 as a default licence,
I've updated the into_srpm.sh script to be a bit more flexible and use that
licence by default.

README.md is also updated to reflect this new script

Pat Riehecky (1):
Added script to re-create SRPM from git commit

README.md | 2 +
into_srpm.sh | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 154 insertions(+), 0 deletions(-)
create mode 100755 into_srpm.sh

get_sources.sh to getopt?

Any objections to me switching get_sources.sh to using 'getopt' rather
than shifting off the args?

Pat

Verify SHA sum of source archive download

Not too sure where it happened, but I got some bad source archives
off of git.c.o. Could be the connection terminated and I didn't notice,
could be something else.

Anyway, I've added an optional check to verify the SHA sum of downloaded
files.

Pat Riehecky (1):
Added optional check for sha1sum of downloaded source file

get_sources.sh | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

Added -q to get_sources for less chatty operation

diff --git a/get_sources.sh b/get_sources.sh
index 6451bd0..b43cb51 100755
--- a/get_sources.sh
+++ b/get_sources.sh
@@ -18,6 +18,7 @@ fi

#parse command line args
BRANCH=''
+QUIET=''
while (($# > 0))
do
case $1 in
@@ -31,6 +32,11 @@ do
surl=$2
shift 2
;;
+ -q)
+ # Be less chatty
+ QUIET='--silent'
+ shift
+ ;;
esac
done

@@ -92,7 +98,7 @@ while read -r fsha fname ; do
if [ !

Added switch to filter output based on branch

I also added in Bonnie's patch from
<a href="http://lists.centos.org/pipermail/centos-devel/2014-June/010841.html" title="http://lists.centos.org/pipermail/centos-devel/2014-June/010841.html">http://lists.centos.org/pipermail/centos-devel/2014-June/010841.html</a>

Pat Riehecky (1):
Added branch filtering lines

centos.git.repolist.py | 34 +++++++++++++++++++++++++---------
1 files changed, 25 insertions(+), 9 deletions(-)

Fixes for show_possible_srpms.sh

The last batch of commits for centos changes breaks the previous script's
behavior. I've adjusted the filtering and made -r a bit more aggressive.

Pat Riehecky (1):
Updated -r to be more targeted

show_possible_srpms.sh | 40 +++++++++++++++++-----------------------
1 files changed, 17 insertions(+), 23 deletions(-)

Added script to turn a git.centos.org repo into a source rpm, using these tools.

diff --git a/into_srpm.sh b/into_srpm.sh
new file mode 100755
index 0000000..2e254c4
--- /dev/null
+++ b/into_srpm.sh
@@ -0,0 +1,173 @@
+#!/bin/bash -u
+#
+# Turn a centos git repo into a .src.rpm file
+#
+# Might want to drop this in ~/bin/ and chmod u+x it
+
+#
+# License: GPLv3
+#
+# Initial Author: Pat Riehecky < ... at fnal dot gov>
+#
+
+#####################################################################
+usage() {
+

Starting talks about licenses for the centos-git-common files

I realized the scripts I've been sending in weren't licensed.

So, I've added one to show_possible_srpms.sh.

Perhaps we should talk about getting the rest of the tools
under an open source license.

Pat Riehecky (1):
Realized this was missing a license, added

show_possible_srpms.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

Mostly patches adding show_possible_srpms.sh

I was looking for some automated tooling to determine what SRPMS can be
generated by a given git repo.

Clean up temp src.rpm

diff --git a/return_disttag.sh b/return_disttag.sh
index f7dc610..f850356 100755
--- a/return_disttag.sh
+++ b/return_disttag.sh
@@ -73,6 +73,9 @@ nvr1="${pkg%.src.rpm}"
mydist="XXXjsdf9ur7qlkasdh4gygXXX"
nvr2=$(rpm --define "dist $mydist" -q --specfile "SPECS/$packagename.spec" --qf '%{n}-%{v}-%{r}\n' 2>/dev/null | head -n 1)

+# clean up SRPM, since it is only used for its name
+rm -f ${nvr2} >/dev/null 2>&1
+
#use our placeholder dist to split the nvr
head=${nvr2%$mydist*}

Not all git.c.o repos have SOURCES dir

I've found a few repos without a SOURCES directory.

For example, kpatch source cannot be fetched without this patch.

Pat Riehecky (1):
Fixed so it works on kpatch golang-*

get_sources.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

Finding %{dist}

This should pull out what I think %{dist} looks like based on the previous
commits to git.c.o . At least in theory.

Pat Riehecky (1):
Added script for extracting what I think is the dist tag

return_disttag.sh | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 71 insertions(+), 0 deletions(-)
create mode 100755 return_disttag.sh

Questions about the new git.centos.org repos

Now that there are repos up at git.centos.org, I was wondering if anyone
had a python tool I could use to convert a repo back into a source RPM?

Similarly, does anyone know how gitblit handles repo change
notifications? I'd love to be notified of updates to some repos or
their tags. A programmatic tool for gathering that information would
work just as well... I'm not sure which would work better for my workflow.

There's a fair chance at various intervals I'd be hitting the site
somewhat hard, are there any instructions for mirroring all the parts
necessary for package assembly?

EL7 build packages and http://seven.centos.org/

Per:

<a href="http://seven.centos.org/2014/01/state-of-the-build-20140104/" title="http://seven.centos.org/2014/01/state-of-the-build-20140104/">http://seven.centos.org/2014/01/state-of-the-build-20140104/</a>

I've got a bunch of BZs opened upstream (by me and others) that may help
clarify the build problems you've hit:

args4j-2.0.16-11.el7.src.rpm : 1049615

at-3.1.13-12.el7.src.rpm : 1044707

dapl-2.0.34-1.el7.src.rpm : 1044727

esc-1.1.0-25.el7.src.rpm : 865721

libbase-1.1.3-8.el7.src.rpm : 1038176

istack-commons-2.17-2.el7.src.rpm : 1049582

jboss-ejb-3.1-api-1.0.2-7.el7.src.rpm : 1029971

jboss-interceptors-1.1-api-1.0.2-0.6.20120319git49a904.el7.src.rpm : 1029974

jboss-jaxrpc-1.1-api-1.0.1-4.el7.src.rpm : 1029975

jboss-s