| Server IP : 178.212.43.201 / Your IP : 10.100.0.33 Web Server : Apache/2.4.37 (Oracle Linux Server) OpenSSL/1.1.1k System : Linux spa0007.srv.paxillus.pl 5.4.17-2136.355.3.1.el8uek.x86_64 #3 SMP Sat May 9 17:11:55 PDT 2026 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/bin/ |
Upload File : |
#!/bin/bash
# rpmdev-packager -- guess rpm packager info from various sources
#
# Copyright (c) 2009-2016 Ville Skyttä <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
version()
{
cat <<EOF
rpmdev-packager version 1.3
Copyright (c) 2009-2015 Ville Skyttä <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
EOF
}
help()
{
cat <<\EOF
rpmdev-packager guesses rpm packager info from various sources:
$RPM_PACKAGER from environment (full name + email address)
%packager from rpm configuration (full name + email address)
certificates ~/.fedora.cert (email address)
git from git configuration (user.name + user.email)
$MAILTO from environment (email address)
/etc/passwd gecos (full name, username)
EOF
usage
echo ""
echo "Report bugs at <https://github.com/oracle/oracle-linux/>,"
echo "or at <https://pagure.io/rpmdevtools/issues>."
}
usage() {
cat <<EOF
Usage: rpmdev-packager [option]...
Options:
-h, --help Show help message and exit.
-v, --version Print version information and exit.
EOF
}
while [ -n "$1" ] ; do
case "$1" in
-h|--help)
help
exit 0
;;
-v|--version)
version
exit 0
;;
*)
usage
exit 1
;;
esac
done
username="$( id -un )"
fullname="$( getent passwd $username 2>/dev/null | cut -d: -f5 )"
fullname="${fullname%%,*}"
# TODO obsolete, should use kerberos instead? e.g.
# https://pagure.io/rpkg/blob/master/f/pyrpkg/__init__.py#_823
# https://pagure.io/fedora-packager/c/715483c1bbdf5cceaeb63e90410139
certs=(~/.fedora.cert)
# Try $RPM_PACKAGER
packager="$RPM_PACKAGER"
# Try rpm %packager
[ -z "$packager" ] && packager="$( rpm --eval '%packager' )"
[ "$packager" = "%packager" ] && packager=
# Try packager certificates
if [ -z "$packager" ] ; then
for cert in $certs ; do
if [ -f "$cert" ] ; then
packager="$( openssl x509 -noout -email -in "$cert" 2>/dev/null )"
[ -n "$packager" -a -n "$fullname" ] && \
packager="$fullname <$packager>"
[ -n "$packager" ] && break
fi
done
fi
# Try git configuration
if [ -z "$packager" ] ; then
packager="$( git config user.email )"
if [ -n "$packager" ] ; then
gituser="$( git config user.name )"
[ -n "${gituser:-$fullname}" ] && \
packager="${gituser:-$fullname} <$packager>"
fi
fi
# Try $MAILTO
if [ -z "$packager" ] ; then
packager="$MAILTO"
[ -n "$packager" -a -n "$fullname" ] && packager="$fullname <$packager>"
fi
# Try full name
[ -z "$packager" ] && packager="$fullname"
# Fall back to username only
[ -z "$packager" ] && packager="$username"
# Done
[ -n "$packager" ] && echo "$packager"