contrib/rpm: fix obtaining SOURCE via git-archive
authorThomas Haller <thaller@redhat.com>
Wed, 30 Mar 2016 11:46:36 +0000 (13:46 +0200)
committerThomas Haller <thaller@redhat.com>
Wed, 30 Mar 2016 12:50:55 +0000 (14:50 +0200)
commita348bda6eaadc54298e856ee4229d564b7838f02
tree32591cac2c4d78bbaa3a288ad968f7de546ec38e
parent05e454a98d02e69afd28fe371be48b40c4069a76
contrib/rpm: fix obtaining SOURCE via git-archive

- when user provided a $SOURCE argument, do call abs_path on
  it. abs_path allows the user to provide relative paths in
  the original directory.

- don't call abs_path on "$GITDIR/NetworkManager-$VERSION".tar.xz
  abs_path is there to verify user input and it will abort the script
  if the file doesn't exist.

- when creating a temporary tarball via git-archive, put it
  into the output directory and not overwriting files in
  $GITDIR.

- fix abs_path to return an error code and let callers abort
  the script

- add a new parameter $SOURCE_FROM_GIT so that you can control
  whether git-archive is used. You can now specify either $SOURCE
  or $SOURCE_FROM_GIT. In case of absence of both, it tries to
  detect a tar file in the $GITDIR directory.

Fixes: 9e9ec1a3da47c07bb0bb0b42014292a8df1c1e0b
contrib/fedora/rpm/build.sh