summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-03-25 10:21:54 +0200
committerPanu Matilainen <pmatilai@redhat.com>2022-03-25 10:23:37 +0200
commitf60eaa1e0fba0f0debe51a5c5c7c2bb40124eaf7 (patch)
treeb35eef9d611454b49834dfed4248b9652f668841
parenta6913834d395d6544c2ba1578d6ebd594350b602 (diff)
downloadrpm-f60eaa1e0fba0f0debe51a5c5c7c2bb40124eaf7.tar.gz
Set program name centrally from rpmcliInit()
Most of our tools go through rpmcliInit() so take the opportunity lessen the clutter wrt xsetprogname() calls. No functional changes.
-rw-r--r--lib/poptALL.c2
-rw-r--r--rpm.c2
-rw-r--r--rpmbuild.c2
-rw-r--r--rpmdb.c2
-rw-r--r--rpmkeys.c2
-rw-r--r--rpmsign.c2
-rw-r--r--rpmspec.c2
-rw-r--r--tools/rpmdeps.c2
-rw-r--r--tools/rpmgraph.c2
-rw-r--r--tools/rpmlua.c2
10 files changed, 2 insertions, 18 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c
index ab3241a84..b24c13ed7 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -300,6 +300,8 @@ rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable)
int rc;
const char *ctx, *execPath;
+ xsetprogname(argv[0]);
+
#if defined(ENABLE_NLS)
(void) setlocale(LC_ALL, "" );
diff --git a/rpm.c b/rpm.c
index 00285a903..b752c33e8 100644
--- a/rpm.c
+++ b/rpm.c
@@ -70,8 +70,6 @@ int main(int argc, char *argv[])
int ec = 0;
int i;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
/* Set the major mode based on argv[0] */
diff --git a/rpmbuild.c b/rpmbuild.c
index da51baa9e..de78976ff 100644
--- a/rpmbuild.c
+++ b/rpmbuild.c
@@ -606,8 +606,6 @@ int main(int argc, char *argv[])
poptContext optCon = NULL;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
/* Args required only when building, let lone --eval etc through */
diff --git a/rpmdb.c b/rpmdb.c
index b72f0a598..22b0b3e5d 100644
--- a/rpmdb.c
+++ b/rpmdb.c
@@ -94,8 +94,6 @@ int main(int argc, char *argv[])
poptContext optCon = NULL;
rpmts ts = NULL;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (argc < 2 || poptPeekArg(optCon)) {
diff --git a/rpmkeys.c b/rpmkeys.c
index 2c304de20..afaffe501 100644
--- a/rpmkeys.c
+++ b/rpmkeys.c
@@ -49,8 +49,6 @@ int main(int argc, char *argv[])
rpmts ts = NULL;
ARGV_const_t args = NULL;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (argc < 2) {
diff --git a/rpmsign.c b/rpmsign.c
index 12299379c..dfd63c1bb 100644
--- a/rpmsign.c
+++ b/rpmsign.c
@@ -188,8 +188,6 @@ int main(int argc, char *argv[])
poptContext optCon = NULL;
const char *arg;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (argc <= 1) {
diff --git a/rpmspec.c b/rpmspec.c
index d072da166..0076de656 100644
--- a/rpmspec.c
+++ b/rpmspec.c
@@ -116,8 +116,6 @@ int main(int argc, char *argv[])
poptContext optCon;
int ec = 0;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (rpmcliPipeOutput && initPipe())
diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c
index 62dd6d9e0..70796725b 100644
--- a/tools/rpmdeps.c
+++ b/tools/rpmdeps.c
@@ -80,8 +80,6 @@ main(int argc, char *argv[])
int ec = 1;
char buf[BUFSIZ];
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (optCon == NULL)
goto exit;
diff --git a/tools/rpmgraph.c b/tools/rpmgraph.c
index e1a7b4d92..cdd113f3a 100644
--- a/tools/rpmgraph.c
+++ b/tools/rpmgraph.c
@@ -236,8 +236,6 @@ main(int argc, char *argv[])
poptContext optCon;
int ec = 0;
- xsetprogname(argv[0]); /* Portability call -- see system.h */
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (optCon == NULL)
exit(EXIT_FAILURE);
diff --git a/tools/rpmlua.c b/tools/rpmlua.c
index 229feb8c8..6ebea5e9c 100644
--- a/tools/rpmlua.c
+++ b/tools/rpmlua.c
@@ -56,8 +56,6 @@ int main(int argc, char *argv[])
rpmluarl rlcb = NULL;
#endif
- xsetprogname(argv[0]);
-
optCon = rpmcliInit(argc, argv, optionsTable);
if (optCon == NULL) {