diff --git a/convertdb.c b/convertdb.c index 8d38e0d67..613060952 100644 --- a/convertdb.c +++ b/convertdb.c @@ -11,7 +11,8 @@ int convertDB(void); -int convertDB(void) { +int convertDB(void) +{ struct oldrpmdb olddb; rpmdb db; struct oldrpmdbLabel * packageLabels, * label; @@ -196,7 +197,9 @@ int convertDB(void) { return 1; } -int main(int argc, char ** argv) { +int main(int argc, char ** argv) +{ + setprogname(argv[0]); if (argc != 1) { fprintf(stderr, _("rpmconvert: no arguments expected")); exit(EXIT_FAILURE); diff --git a/lib/depends.c b/lib/depends.c index 919e6aa9b..2cc3af3d4 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -292,9 +292,9 @@ static void parseEVR(char *evr, /*@exposed@*/ /*@out@*/const char **ep, /*@expos if (rp) *rp = release; } -static char *rpmName = PACKAGE; -static char *rpmEVR = VERSION; -static int rpmFlags = RPMSENSE_EQUAL; +const char *rpmNAME = PACKAGE; +const char *rpmEVR = VERSION; +int rpmFLAGS = RPMSENSE_EQUAL; static int rangesOverlap(const char *AName, const char *AEVR, int AFlags, const char *BName, const char *BEVR, int BFlags) @@ -826,8 +826,8 @@ static int unsatisfiedDepend(rpmTransactionSet rpmdep, * version. Provide implicit rpm version in last ditch effort to * satisfy an rpm dependency. */ - if (!strcmp(keyName, rpmName)) { - i = rangesOverlap(keyName, keyEVR, keyFlags, rpmName, rpmEVR, rpmFlags); + if (!strcmp(keyName, rpmNAME)) { + i = rangesOverlap(keyName, keyEVR, keyFlags, rpmNAME, rpmEVR, rpmFLAGS); if (i) { rpmMessage(RPMMESS_DEBUG, _("%s: %s satisfied by rpmlib version.\n"), keyType, keyDepend); goto exit; diff --git a/misc/err.c b/misc/err.c index 348294427..8035838ef 100644 --- a/misc/err.c +++ b/misc/err.c @@ -17,19 +17,21 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include -#include +#include "system.h" -#ifdef USE_IN_LIBIO -# define flockfile(s) _IO_flockfile (s) -# define funlockfile(s) _IO_funlockfile (s) +#ifdef HAVE_LIBIO +#define flockfile(s) _IO_flockfile (s) +#define funlockfile(s) _IO_funlockfile (s) +#else +#define flockfile(s) +#define funlockfile(s) +#define putc_unlocked(c,fp) putc(c,fp); +#define fputs_unlocked(s,fp) fputs(s,fp); +#define __set_errno(error) errno = error +#define __ptr_t void * #endif -extern char *__progname; +#include #define VA(call) \ { \ diff --git a/po/rpm.pot b/po/rpm.pot index 8a7eca89a..dacce120a 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-09-25 20:43-0400\n" +"POT-Creation-Date: 1999-09-26 10:55-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -89,7 +89,7 @@ msgstr "" msgid "override build root" msgstr "" -#: ../build.c:348 ../rpm.c:456 +#: ../build.c:348 ../rpm.c:457 msgid "remove build tree when done" msgstr "" @@ -109,7 +109,7 @@ msgstr "" msgid "remove specfile when done" msgstr "" -#: ../build.c:358 ../rpm.c:454 +#: ../build.c:358 ../rpm.c:455 msgid "skip straight to specified stage (only for c,i)" msgstr "" @@ -121,32 +121,32 @@ msgstr "" msgid "lookup I18N strings in specfile catalog" msgstr "" -#: ../convertdb.c:38 +#: ../convertdb.c:39 msgid "RPM database already exists" msgstr "" -#: ../convertdb.c:43 +#: ../convertdb.c:44 msgid "Old db is missing" msgstr "" -#: ../convertdb.c:54 +#: ../convertdb.c:55 msgid "failed to create RPM database /var/lib/rpm" msgstr "" -#: ../convertdb.c:60 +#: ../convertdb.c:61 msgid "Old db is corrupt" msgstr "" -#: ../convertdb.c:69 +#: ../convertdb.c:70 #, c-format msgid "oldrpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n" msgstr "" -#: ../convertdb.c:201 +#: ../convertdb.c:204 msgid "rpmconvert: no arguments expected" msgstr "" -#: ../convertdb.c:207 +#: ../convertdb.c:210 msgid "rpmconvert 1.0 - converting database in /var/lib/rpm\n" msgstr "" @@ -163,1064 +163,1064 @@ msgstr "" msgid "no copyright!\n" msgstr "" -#: ../rpm.c:158 +#: ../rpm.c:159 #, c-format msgid "rpm: %s\n" msgstr "" -#: ../rpm.c:169 +#: ../rpm.c:170 #, c-format msgid "RPM version %s\n" msgstr "" -#: ../rpm.c:173 +#: ../rpm.c:174 msgid "Copyright (C) 1998 - Red Hat Software" msgstr "" -#: ../rpm.c:174 +#: ../rpm.c:175 msgid "This may be freely redistributed under the terms of the GNU GPL" msgstr "" -#: ../rpm.c:182 +#: ../rpm.c:183 msgid "usage: rpm {--help}" msgstr "" -#: ../rpm.c:183 +#: ../rpm.c:184 msgid " rpm {--version}" msgstr "" -#: ../rpm.c:184 +#: ../rpm.c:185 msgid " rpm {--initdb} [--dbpath ]" msgstr "" -#: ../rpm.c:185 +#: ../rpm.c:186 msgid "" " rpm {--install -i} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: ../rpm.c:186 +#: ../rpm.c:187 msgid " [--replacepkgs] [--replacefiles] [--root ]" msgstr "" -#: ../rpm.c:187 -msgid " [--excludedocs] [--includedocs] [--noscripts]" -msgstr "" - #: ../rpm.c:188 -msgid "" -" [--rcfile ] [--ignorearch] [--dbpath ]" +msgid " [--excludedocs] [--includedocs] [--noscripts]" msgstr "" #: ../rpm.c:189 msgid "" -" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" +" [--rcfile ] [--ignorearch] [--dbpath ]" msgstr "" #: ../rpm.c:190 msgid "" +" [--prefix ] [--ignoreos] [--nodeps] [--allfiles]" +msgstr "" + +#: ../rpm.c:191 +msgid "" " [--ftpproxy ] [--ftpport ] [--justdb]" msgstr "" -#: ../rpm.c:191 ../rpm.c:200 ../rpm.c:209 +#: ../rpm.c:192 ../rpm.c:201 ../rpm.c:210 msgid " [--httpproxy ] [--httpport ] " msgstr "" -#: ../rpm.c:192 ../rpm.c:202 +#: ../rpm.c:193 ../rpm.c:203 msgid " [--noorder] [--relocate oldpath=newpath]" msgstr "" -#: ../rpm.c:193 +#: ../rpm.c:194 msgid "" " [--badreloc] [--notriggers] [--excludepath ]" msgstr "" -#: ../rpm.c:194 +#: ../rpm.c:195 msgid " [--ignoresize] file1.rpm ... fileN.rpm" msgstr "" -#: ../rpm.c:195 +#: ../rpm.c:196 msgid "" " rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]" msgstr "" -#: ../rpm.c:196 -msgid " [--oldpackage] [--root ] [--noscripts]" -msgstr "" - #: ../rpm.c:197 -msgid "" -" [--excludedocs] [--includedocs] [--rcfile ]" +msgid " [--oldpackage] [--root ] [--noscripts]" msgstr "" #: ../rpm.c:198 msgid "" -" [--ignorearch] [--dbpath ] [--prefix ] " +" [--excludedocs] [--includedocs] [--rcfile ]" msgstr "" #: ../rpm.c:199 +msgid "" +" [--ignorearch] [--dbpath ] [--prefix ] " +msgstr "" + +#: ../rpm.c:200 msgid " [--ftpproxy ] [--ftpport ]" msgstr "" -#: ../rpm.c:201 +#: ../rpm.c:202 msgid " [--ignoreos] [--nodeps] [--allfiles] [--justdb]" msgstr "" -#: ../rpm.c:203 +#: ../rpm.c:204 msgid "" " [--badreloc] [--excludepath ] [--ignoresize]" msgstr "" -#: ../rpm.c:204 +#: ../rpm.c:205 msgid " file1.rpm ... fileN.rpm" msgstr "" -#: ../rpm.c:205 +#: ../rpm.c:206 msgid " rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]" msgstr "" -#: ../rpm.c:206 +#: ../rpm.c:207 msgid " [--scripts] [--root ] [--rcfile ]" msgstr "" -#: ../rpm.c:207 +#: ../rpm.c:208 msgid " [--whatprovides] [--whatrequires] [--requires]" msgstr "" -#: ../rpm.c:208 +#: ../rpm.c:209 msgid "" " [--triggeredby] [--ftpuseport] [--ftpproxy ]" msgstr "" -#: ../rpm.c:210 +#: ../rpm.c:211 msgid "" " [--ftpport ] [--provides] [--triggers] [--dump]" msgstr "" -#: ../rpm.c:211 +#: ../rpm.c:212 msgid " [--changelog] [--dbpath ] [targets]" msgstr "" -#: ../rpm.c:212 +#: ../rpm.c:213 msgid " rpm {--verify -V -y} [-afpg] [--root ] [--rcfile ]" msgstr "" -#: ../rpm.c:213 +#: ../rpm.c:214 msgid "" " [--dbpath ] [--nodeps] [--nofiles] [--noscripts]" msgstr "" -#: ../rpm.c:214 +#: ../rpm.c:215 msgid " [--nomd5] [targets]" msgstr "" -#: ../rpm.c:215 +#: ../rpm.c:216 msgid " rpm {--setperms} [-afpg] [target]" msgstr "" -#: ../rpm.c:216 +#: ../rpm.c:217 msgid " rpm {--setugids} [-afpg] [target]" msgstr "" -#: ../rpm.c:217 +#: ../rpm.c:218 msgid " rpm {--freshen -F} file1.rpm ... fileN.rpm" msgstr "" -#: ../rpm.c:218 +#: ../rpm.c:219 msgid " rpm {--erase -e} [--root ] [--noscripts] [--rcfile ]" msgstr "" -#: ../rpm.c:219 -msgid " [--dbpath ] [--nodeps] [--allmatches]" -msgstr "" - #: ../rpm.c:220 -msgid "" -" [--justdb] [--notriggers] rpackage1 ... packageN" +msgid " [--dbpath ] [--nodeps] [--allmatches]" msgstr "" #: ../rpm.c:221 msgid "" -" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]" +" [--justdb] [--notriggers] rpackage1 ... packageN" msgstr "" #: ../rpm.c:222 -msgid " [--sign] [--nobuild] [--timecheck ] ]" +msgid "" +" rpm {-b|t}[plciba] [-v] [--short-circuit] [--clean] [--rcfile ]" msgstr "" #: ../rpm.c:223 -msgid " [--target=platform1[,platform2...]]" +msgid " [--sign] [--nobuild] [--timecheck ] ]" msgstr "" #: ../rpm.c:224 -msgid " [--rmsource] specfile" +msgid " [--target=platform1[,platform2...]]" msgstr "" #: ../rpm.c:225 -msgid " rpm {--rmsource} [--rcfile ] [-v] specfile" +msgid " [--rmsource] specfile" msgstr "" #: ../rpm.c:226 -msgid "" -" rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" +msgid " rpm {--rmsource} [--rcfile ] [-v] specfile" msgstr "" #: ../rpm.c:227 msgid "" -" rpm {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" +" rpm {--rebuild} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" msgstr "" #: ../rpm.c:228 -msgid " rpm {--resign} [--rcfile ] package1 package2 ... packageN" +msgid "" +" rpm {--recompile} [--rcfile ] [-v] source1.rpm ... sourceN.rpm" msgstr "" #: ../rpm.c:229 -msgid " rpm {--addsign} [--rcfile ] package1 package2 ... packageN" +msgid " rpm {--resign} [--rcfile ] package1 package2 ... packageN" msgstr "" #: ../rpm.c:230 +msgid " rpm {--addsign} [--rcfile ] package1 package2 ... packageN" +msgstr "" + +#: ../rpm.c:231 msgid "" " rpm {--checksig -K} [--nopgp] [--nogpg] [--nomd5] [--rcfile ]" msgstr "" -#: ../rpm.c:231 +#: ../rpm.c:232 msgid " package1 ... packageN" msgstr "" -#: ../rpm.c:232 +#: ../rpm.c:233 msgid " rpm {--rebuilddb} [--rcfile ] [--dbpath ]" msgstr "" -#: ../rpm.c:233 +#: ../rpm.c:234 msgid " rpm {--querytags}" msgstr "" -#: ../rpm.c:267 +#: ../rpm.c:268 msgid "usage:" msgstr "" -#: ../rpm.c:269 +#: ../rpm.c:270 msgid "print this message" msgstr "" -#: ../rpm.c:271 +#: ../rpm.c:272 msgid "print the version of rpm being used" msgstr "" -#: ../rpm.c:272 +#: ../rpm.c:273 msgid " all modes support the following arguments:" msgstr "" -#: ../rpm.c:273 +#: ../rpm.c:274 msgid " --rcfile " msgstr "" -#: ../rpm.c:274 +#: ../rpm.c:275 msgid "use instead of /etc/rpmrc and $HOME/.rpmrc" msgstr "" -#: ../rpm.c:276 +#: ../rpm.c:277 msgid "be a little more verbose" msgstr "" -#: ../rpm.c:278 +#: ../rpm.c:279 msgid "be incredibly verbose (for debugging)" msgstr "" -#: ../rpm.c:280 +#: ../rpm.c:281 msgid "query mode" msgstr "" -#: ../rpm.c:281 ../rpm.c:343 ../rpm.c:407 ../rpm.c:435 +#: ../rpm.c:282 ../rpm.c:344 ../rpm.c:408 ../rpm.c:436 msgid " --root " msgstr "" -#: ../rpm.c:282 ../rpm.c:344 ../rpm.c:408 ../rpm.c:436 ../rpm.c:498 +#: ../rpm.c:283 ../rpm.c:345 ../rpm.c:409 ../rpm.c:437 ../rpm.c:499 msgid "use as the top level directory" msgstr "" -#: ../rpm.c:283 ../rpm.c:341 ../rpm.c:371 ../rpm.c:423 ../rpm.c:495 +#: ../rpm.c:284 ../rpm.c:342 ../rpm.c:372 ../rpm.c:424 ../rpm.c:496 msgid " --dbpath " msgstr "" -#: ../rpm.c:284 ../rpm.c:342 ../rpm.c:372 ../rpm.c:424 ../rpm.c:496 +#: ../rpm.c:285 ../rpm.c:343 ../rpm.c:373 ../rpm.c:425 ../rpm.c:497 msgid "use as the directory for the database" msgstr "" -#: ../rpm.c:285 +#: ../rpm.c:286 msgid " --queryformat " msgstr "" -#: ../rpm.c:286 +#: ../rpm.c:287 msgid "use as the header format (implies -i)" msgstr "" -#: ../rpm.c:287 +#: ../rpm.c:288 msgid "" " install, upgrade and query (with -p) allow ftp URL's to be used in place" msgstr "" -#: ../rpm.c:288 +#: ../rpm.c:289 msgid " of file names as well as the following options:" msgstr "" -#: ../rpm.c:289 +#: ../rpm.c:290 msgid " --ftpproxy " msgstr "" -#: ../rpm.c:290 +#: ../rpm.c:291 msgid "hostname or IP of ftp proxy" msgstr "" -#: ../rpm.c:291 +#: ../rpm.c:292 msgid " --ftpport " msgstr "" -#: ../rpm.c:292 +#: ../rpm.c:293 msgid "port number of ftp server (or proxy)" msgstr "" -#: ../rpm.c:293 +#: ../rpm.c:294 msgid " --httpproxy " msgstr "" -#: ../rpm.c:294 +#: ../rpm.c:295 msgid "hostname or IP of http proxy" msgstr "" -#: ../rpm.c:295 +#: ../rpm.c:296 msgid " --httpport " msgstr "" -#: ../rpm.c:296 +#: ../rpm.c:297 msgid "port number of http server (or proxy)" msgstr "" -#: ../rpm.c:297 +#: ../rpm.c:298 msgid " Package specification options:" msgstr "" -#: ../rpm.c:299 +#: ../rpm.c:300 msgid "query all packages" msgstr "" -#: ../rpm.c:300 +#: ../rpm.c:301 msgid " -f + " msgstr "" -#: ../rpm.c:301 +#: ../rpm.c:302 msgid "query package owning " msgstr "" -#: ../rpm.c:302 +#: ../rpm.c:303 msgid " -p + " msgstr "" -#: ../rpm.c:303 +#: ../rpm.c:304 msgid "query (uninstalled) package " msgstr "" -#: ../rpm.c:304 +#: ../rpm.c:305 msgid " --triggeredby " msgstr "" -#: ../rpm.c:305 +#: ../rpm.c:306 msgid "query packages triggered by " msgstr "" -#: ../rpm.c:306 +#: ../rpm.c:307 msgid " --whatprovides " msgstr "" -#: ../rpm.c:307 +#: ../rpm.c:308 msgid "query packages which provide capability" msgstr "" -#: ../rpm.c:308 +#: ../rpm.c:309 msgid " --whatrequires " msgstr "" -#: ../rpm.c:309 +#: ../rpm.c:310 msgid "query packages which require capability" msgstr "" -#: ../rpm.c:310 +#: ../rpm.c:311 msgid " Information selection options:" msgstr "" -#: ../rpm.c:312 +#: ../rpm.c:313 msgid "display package information" msgstr "" -#: ../rpm.c:314 +#: ../rpm.c:315 msgid "display the package's change log" msgstr "" -#: ../rpm.c:316 +#: ../rpm.c:317 msgid "display package file list" msgstr "" -#: ../rpm.c:318 +#: ../rpm.c:319 msgid "show file states (implies -l)" msgstr "" -#: ../rpm.c:320 +#: ../rpm.c:321 msgid "list only documentation files (implies -l)" msgstr "" -#: ../rpm.c:322 +#: ../rpm.c:323 msgid "list only configuration files (implies -l)" msgstr "" -#: ../rpm.c:324 +#: ../rpm.c:325 msgid "" "show all verifiable information for each file (must be used with -l, -c, or " "-d)" msgstr "" -#: ../rpm.c:326 +#: ../rpm.c:327 msgid "list capabilities package provides" msgstr "" -#: ../rpm.c:327 +#: ../rpm.c:328 msgid " --requires" msgstr "" -#: ../rpm.c:329 +#: ../rpm.c:330 msgid "list package dependencies" msgstr "" -#: ../rpm.c:331 +#: ../rpm.c:332 msgid "print the various [un]install scripts" msgstr "" -#: ../rpm.c:333 +#: ../rpm.c:334 msgid "show the trigger scripts contained in the package" msgstr "" -#: ../rpm.c:337 +#: ../rpm.c:338 msgid " --pipe " msgstr "" -#: ../rpm.c:338 +#: ../rpm.c:339 msgid "send stdout to " msgstr "" -#: ../rpm.c:340 +#: ../rpm.c:341 msgid "" "verify a package installation using the same same package specification " "options as -q" msgstr "" -#: ../rpm.c:346 ../rpm.c:394 ../rpm.c:428 +#: ../rpm.c:347 ../rpm.c:395 ../rpm.c:429 msgid "do not verify package dependencies" msgstr "" -#: ../rpm.c:348 +#: ../rpm.c:349 msgid "do not verify file md5 checksums" msgstr "" -#: ../rpm.c:350 +#: ../rpm.c:351 msgid "do not verify file attributes" msgstr "" -#: ../rpm.c:353 +#: ../rpm.c:354 msgid "" "set the file permissions to those in the package database using the same " "package specification options as -q" msgstr "" -#: ../rpm.c:356 +#: ../rpm.c:357 msgid "" "set the file owner and group to those in the package database using the same " "package specification options as -q" msgstr "" -#: ../rpm.c:360 +#: ../rpm.c:361 msgid " --install " msgstr "" -#: ../rpm.c:361 +#: ../rpm.c:362 msgid " -i " msgstr "" -#: ../rpm.c:362 +#: ../rpm.c:363 msgid "install package" msgstr "" -#: ../rpm.c:363 +#: ../rpm.c:364 msgid " --excludepath " msgstr "" -#: ../rpm.c:364 +#: ../rpm.c:365 msgid "skip files in path " msgstr "" -#: ../rpm.c:365 +#: ../rpm.c:366 msgid " --relocate =" msgstr "" -#: ../rpm.c:366 +#: ../rpm.c:367 msgid "relocate files from to " msgstr "" -#: ../rpm.c:368 +#: ../rpm.c:369 msgid "relocate files even though the package doesn't allow it" msgstr "" -#: ../rpm.c:369 +#: ../rpm.c:370 msgid " --prefix " msgstr "" -#: ../rpm.c:370 +#: ../rpm.c:371 msgid "relocate the package to , if relocatable" msgstr "" -#: ../rpm.c:374 +#: ../rpm.c:375 msgid "do not install documentation" msgstr "" -#: ../rpm.c:376 +#: ../rpm.c:377 msgid "short hand for --replacepkgs --replacefiles" msgstr "" -#: ../rpm.c:379 +#: ../rpm.c:380 msgid "print hash marks as package installs (good with -v)" msgstr "" -#: ../rpm.c:381 +#: ../rpm.c:382 msgid "install all files, even configurations which might otherwise be skipped" msgstr "" -#: ../rpm.c:384 +#: ../rpm.c:385 msgid "don't verify package architecture" msgstr "" -#: ../rpm.c:386 +#: ../rpm.c:387 msgid "don't check disk space before installing" msgstr "" -#: ../rpm.c:388 +#: ../rpm.c:389 msgid "don't verify package operating system" msgstr "" -#: ../rpm.c:390 +#: ../rpm.c:391 msgid "install documentation" msgstr "" -#: ../rpm.c:392 ../rpm.c:426 +#: ../rpm.c:393 ../rpm.c:427 msgid "update the database, but do not modify the filesystem" msgstr "" -#: ../rpm.c:396 ../rpm.c:430 +#: ../rpm.c:397 ../rpm.c:431 msgid "do not reorder package installation to satisfy dependencies" msgstr "" -#: ../rpm.c:398 +#: ../rpm.c:399 msgid "don't execute any installation scripts" msgstr "" -#: ../rpm.c:400 ../rpm.c:434 +#: ../rpm.c:401 ../rpm.c:435 msgid "don't execute any scripts triggered by this package" msgstr "" -#: ../rpm.c:402 +#: ../rpm.c:403 msgid "print percentages as package installs" msgstr "" -#: ../rpm.c:404 +#: ../rpm.c:405 msgid "install even if the package replaces installed files" msgstr "" -#: ../rpm.c:406 +#: ../rpm.c:407 msgid "reinstall if the package is already present" msgstr "" -#: ../rpm.c:410 +#: ../rpm.c:411 msgid "don't install, but tell if it would work or not" msgstr "" -#: ../rpm.c:412 +#: ../rpm.c:413 msgid " --upgrade " msgstr "" -#: ../rpm.c:413 +#: ../rpm.c:414 msgid " -U " msgstr "" -#: ../rpm.c:414 +#: ../rpm.c:415 msgid "upgrade package (same options as --install, plus)" msgstr "" -#: ../rpm.c:416 +#: ../rpm.c:417 msgid "" "upgrade to an old version of the package (--force on upgrades does this " "automatically)" msgstr "" -#: ../rpm.c:418 +#: ../rpm.c:419 msgid " --erase " msgstr "" -#: ../rpm.c:420 +#: ../rpm.c:421 msgid "erase (uninstall) package" msgstr "" -#: ../rpm.c:422 +#: ../rpm.c:423 msgid "" "remove all packages which match (normally an error is generated if " " specified multiple packages)" msgstr "" -#: ../rpm.c:432 +#: ../rpm.c:433 msgid "do not execute any package specific scripts" msgstr "" -#: ../rpm.c:438 +#: ../rpm.c:439 msgid " -b " msgstr "" -#: ../rpm.c:439 +#: ../rpm.c:440 msgid " -t " msgstr "" -#: ../rpm.c:440 +#: ../rpm.c:441 msgid "build package, where is one of:" msgstr "" -#: ../rpm.c:442 +#: ../rpm.c:443 msgid "prep (unpack sources and apply patches)" msgstr "" -#: ../rpm.c:444 +#: ../rpm.c:445 #, c-format msgid "list check (do some cursory checks on %files)" msgstr "" -#: ../rpm.c:446 +#: ../rpm.c:447 msgid "compile (prep and compile)" msgstr "" -#: ../rpm.c:448 +#: ../rpm.c:449 msgid "install (prep, compile, install)" msgstr "" -#: ../rpm.c:450 +#: ../rpm.c:451 msgid "binary package (prep, compile, install, package)" msgstr "" -#: ../rpm.c:452 +#: ../rpm.c:453 msgid "bin/src package (prep, compile, install, package)" msgstr "" -#: ../rpm.c:458 +#: ../rpm.c:459 msgid "remove sources and spec file when done" msgstr "" -#: ../rpm.c:460 +#: ../rpm.c:461 msgid "generate PGP/GPG signature" msgstr "" -#: ../rpm.c:461 +#: ../rpm.c:462 msgid " --buildroot " msgstr "" -#: ../rpm.c:462 +#: ../rpm.c:463 msgid "use as the build root" msgstr "" -#: ../rpm.c:463 +#: ../rpm.c:464 msgid " --target=+" msgstr "" -#: ../rpm.c:464 +#: ../rpm.c:465 msgid "build the packages for the build targets platform1...platformN." msgstr "" -#: ../rpm.c:466 +#: ../rpm.c:467 msgid "do not execute any stages" msgstr "" -#: ../rpm.c:467 +#: ../rpm.c:468 msgid " --timecheck " msgstr "" -#: ../rpm.c:468 +#: ../rpm.c:469 msgid "set the time check to seconds (0 disables)" msgstr "" -#: ../rpm.c:470 +#: ../rpm.c:471 msgid " --rebuild " msgstr "" -#: ../rpm.c:471 +#: ../rpm.c:472 msgid "" "install source package, build binary package and remove spec file, sources, " "patches, and icons." msgstr "" -#: ../rpm.c:472 +#: ../rpm.c:473 msgid " --rmsource " msgstr "" -#: ../rpm.c:473 +#: ../rpm.c:474 msgid "remove sources and spec file" msgstr "" -#: ../rpm.c:474 +#: ../rpm.c:475 msgid " --recompile " msgstr "" -#: ../rpm.c:475 +#: ../rpm.c:476 msgid "like --rebuild, but don't build any package" msgstr "" -#: ../rpm.c:476 +#: ../rpm.c:477 msgid " --resign + " msgstr "" -#: ../rpm.c:477 +#: ../rpm.c:478 msgid "sign a package (discard current signature)" msgstr "" -#: ../rpm.c:478 +#: ../rpm.c:479 msgid " --addsign + " msgstr "" -#: ../rpm.c:479 +#: ../rpm.c:480 msgid "add a signature to a package" msgstr "" -#: ../rpm.c:481 +#: ../rpm.c:482 msgid " --checksig + " msgstr "" -#: ../rpm.c:482 +#: ../rpm.c:483 msgid "verify package signature" msgstr "" -#: ../rpm.c:484 +#: ../rpm.c:485 msgid "skip any PGP signatures" msgstr "" -#: ../rpm.c:486 +#: ../rpm.c:487 msgid "skip any GPG signatures" msgstr "" -#: ../rpm.c:488 +#: ../rpm.c:489 msgid "skip any MD5 signatures" msgstr "" -#: ../rpm.c:490 +#: ../rpm.c:491 msgid "list the tags that can be used in a query format" msgstr "" -#: ../rpm.c:492 +#: ../rpm.c:493 msgid "make sure a valid database exists" msgstr "" -#: ../rpm.c:494 +#: ../rpm.c:495 msgid "rebuild database from existing database" msgstr "" -#: ../rpm.c:637 ../rpm.c:643 ../rpm.c:650 ../rpm.c:656 ../rpm.c:665 -#: ../rpm.c:672 ../rpm.c:719 ../rpm.c:725 ../rpm.c:759 ../rpm.c:765 -#: ../rpm.c:771 ../rpm.c:779 ../rpm.c:814 ../rpm.c:869 ../rpm.c:876 +#: ../rpm.c:639 ../rpm.c:645 ../rpm.c:652 ../rpm.c:658 ../rpm.c:667 +#: ../rpm.c:674 ../rpm.c:721 ../rpm.c:727 ../rpm.c:761 ../rpm.c:767 +#: ../rpm.c:773 ../rpm.c:781 ../rpm.c:816 ../rpm.c:871 ../rpm.c:878 msgid "only one major mode may be specified" msgstr "" -#: ../rpm.c:658 +#: ../rpm.c:660 msgid "-u and --uninstall are deprecated and no longer work.\n" msgstr "" -#: ../rpm.c:660 +#: ../rpm.c:662 msgid "Use -e or --erase instead.\n" msgstr "" -#: ../rpm.c:676 +#: ../rpm.c:678 msgid "--build (-b) requires one of a,b,i,c,p,l as its sole argument" msgstr "" -#: ../rpm.c:680 +#: ../rpm.c:682 msgid "--tarbuild (-t) requires one of a,b,i,c,p,l as its sole argument" msgstr "" -#: ../rpm.c:732 ../rpm.c:738 ../rpm.c:745 ../rpm.c:752 ../rpm.c:883 +#: ../rpm.c:734 ../rpm.c:740 ../rpm.c:747 ../rpm.c:754 ../rpm.c:885 msgid "one type of query/verify may be performed at a time" msgstr "" -#: ../rpm.c:787 +#: ../rpm.c:789 msgid "arguments to --dbpath must begin with a /" msgstr "" -#: ../rpm.c:820 +#: ../rpm.c:822 msgid "relocations must begin with a /" msgstr "" -#: ../rpm.c:822 +#: ../rpm.c:824 msgid "relocations must contain a =" msgstr "" -#: ../rpm.c:825 +#: ../rpm.c:827 msgid "relocations must have a / following the =" msgstr "" -#: ../rpm.c:834 +#: ../rpm.c:836 msgid "exclude paths must begin with a /" msgstr "" -#: ../rpm.c:843 +#: ../rpm.c:845 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: ../rpm.c:896 +#: ../rpm.c:898 msgid "--dbpath given for operation that does not use a database" msgstr "" -#: ../rpm.c:901 +#: ../rpm.c:903 msgid "--timecheck may only be used during package builds" msgstr "" -#: ../rpm.c:904 +#: ../rpm.c:906 msgid "unexpected query flags" msgstr "" -#: ../rpm.c:907 +#: ../rpm.c:909 msgid "unexpected query format" msgstr "" -#: ../rpm.c:911 +#: ../rpm.c:913 msgid "unexpected query source" msgstr "" -#: ../rpm.c:917 +#: ../rpm.c:919 msgid "only installation, upgrading, rmsource and rmspec may be forced" msgstr "" -#: ../rpm.c:920 +#: ../rpm.c:922 msgid "files may only be relocated during package installation" msgstr "" -#: ../rpm.c:923 +#: ../rpm.c:925 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: ../rpm.c:926 +#: ../rpm.c:928 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: ../rpm.c:929 +#: ../rpm.c:931 msgid "--prefix may only be used when installing new packages" msgstr "" -#: ../rpm.c:932 +#: ../rpm.c:934 msgid "arguments to --prefix must begin with a /" msgstr "" -#: ../rpm.c:935 +#: ../rpm.c:937 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: ../rpm.c:939 +#: ../rpm.c:941 msgid "--percent may only be specified during package installation" msgstr "" -#: ../rpm.c:943 +#: ../rpm.c:945 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: ../rpm.c:947 +#: ../rpm.c:949 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: ../rpm.c:951 +#: ../rpm.c:953 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: ../rpm.c:955 +#: ../rpm.c:957 msgid "--includedocs may only be specified during package installation" msgstr "" -#: ../rpm.c:959 +#: ../rpm.c:961 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: ../rpm.c:963 +#: ../rpm.c:965 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: ../rpm.c:967 +#: ../rpm.c:969 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: ../rpm.c:971 +#: ../rpm.c:973 msgid "--ignoresize may only be specified during package installation" msgstr "" -#: ../rpm.c:975 +#: ../rpm.c:977 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: ../rpm.c:979 +#: ../rpm.c:981 msgid "--allfiles may only be specified during package installation" msgstr "" -#: ../rpm.c:983 +#: ../rpm.c:985 msgid "--justdb may only be specified during package installation and erasure" msgstr "" -#: ../rpm.c:988 +#: ../rpm.c:990 msgid "" "--noscripts may only be specified during package installation, erasure, and " "verification" msgstr "" -#: ../rpm.c:992 +#: ../rpm.c:994 msgid "" "--notriggers may only be specified during package installation, erasure, and " "verification" msgstr "" -#: ../rpm.c:998 +#: ../rpm.c:1000 msgid "" "--nodeps may only be specified during package building, installation, " "erasure, and verification" msgstr "" -#: ../rpm.c:1003 +#: ../rpm.c:1005 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: ../rpm.c:1008 +#: ../rpm.c:1010 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: ../rpm.c:1013 +#: ../rpm.c:1015 msgid "arguments to --root (-r) must begin with a /" msgstr "" -#: ../rpm.c:1016 +#: ../rpm.c:1018 msgid "--oldpackage may only be used during upgrades" msgstr "" -#: ../rpm.c:1021 +#: ../rpm.c:1023 msgid "" "ftp options can only be used during package queries, installs, and upgrades" msgstr "" -#: ../rpm.c:1027 +#: ../rpm.c:1029 msgid "" "http options can only be used during package queries, installs, and upgrades" msgstr "" -#: ../rpm.c:1031 +#: ../rpm.c:1033 msgid "--nopgp may only be used during signature checking" msgstr "" -#: ../rpm.c:1034 +#: ../rpm.c:1036 msgid "--nogpg may only be used during signature checking" msgstr "" -#: ../rpm.c:1037 +#: ../rpm.c:1039 msgid "" "--nomd5 may only be used during signature checking and package verification" msgstr "" -#: ../rpm.c:1061 +#: ../rpm.c:1063 msgid "no files to sign\n" msgstr "" -#: ../rpm.c:1066 +#: ../rpm.c:1068 #, c-format msgid "cannot access file %s\n" msgstr "" -#: ../rpm.c:1081 +#: ../rpm.c:1083 msgid "pgp not found: " msgstr "" -#: ../rpm.c:1085 +#: ../rpm.c:1087 msgid "Enter pass phrase: " msgstr "" -#: ../rpm.c:1087 +#: ../rpm.c:1089 msgid "Pass phrase check failed\n" msgstr "" -#: ../rpm.c:1090 +#: ../rpm.c:1092 msgid "Pass phrase is good.\n" msgstr "" -#: ../rpm.c:1095 +#: ../rpm.c:1097 msgid "Invalid %%_signature spec in macro file.\n" msgstr "" -#: ../rpm.c:1101 +#: ../rpm.c:1103 msgid "--sign may only be used during package building" msgstr "" -#: ../rpm.c:1116 +#: ../rpm.c:1118 msgid "exec failed\n" msgstr "" -#: ../rpm.c:1135 +#: ../rpm.c:1137 msgid "unexpected arguments to --querytags " msgstr "" -#: ../rpm.c:1146 +#: ../rpm.c:1148 msgid "no packages given for signature check" msgstr "" -#: ../rpm.c:1158 +#: ../rpm.c:1160 msgid "no packages given for signing" msgstr "" -#: ../rpm.c:1171 +#: ../rpm.c:1173 msgid "no packages files given for rebuild" msgstr "" -#: ../rpm.c:1228 +#: ../rpm.c:1230 msgid "no spec files given for build" msgstr "" -#: ../rpm.c:1230 +#: ../rpm.c:1232 msgid "no tar files given for build" msgstr "" -#: ../rpm.c:1242 +#: ../rpm.c:1244 msgid "no packages given for uninstall" msgstr "" -#: ../rpm.c:1292 +#: ../rpm.c:1294 msgid "no packages given for install" msgstr "" -#: ../rpm.c:1315 +#: ../rpm.c:1317 msgid "extra arguments given for query of all packages" msgstr "" -#: ../rpm.c:1320 +#: ../rpm.c:1322 msgid "no arguments given for query" msgstr "" -#: ../rpm.c:1337 +#: ../rpm.c:1339 msgid "extra arguments given for verify of all packages" msgstr "" -#: ../rpm.c:1341 +#: ../rpm.c:1343 msgid "no arguments given for verify" msgstr "" -#: ../rpm2cpio.c:42 +#: ../rpm2cpio.c:34 msgid "argument is not an RPM package\n" msgstr "" -#: ../rpm2cpio.c:46 +#: ../rpm2cpio.c:38 msgid "error reading header from package\n" msgstr "" diff --git a/rpm.c b/rpm.c index 1c6959bee..efedcb914 100755 --- a/rpm.c +++ b/rpm.c @@ -20,8 +20,6 @@ #define GETOPT_DEFINEMACRO 1020 #define GETOPT_EVALMACRO 1021 -char * version = VERSION; - enum modes { MODE_QUERY, MODE_INSTALL, MODE_UNINSTALL, MODE_VERIFY, MODE_BUILD, MODE_REBUILD, MODE_CHECKSIG, MODE_RESIGN, MODE_RECOMPILE, MODE_QUERYTAGS, MODE_INITDB, MODE_TARBUILD, @@ -67,7 +65,10 @@ static int showrc; static int signIt; static int test; -static int rpm_version; +static int showVersion; +extern const char * rpmNAME; +extern const char * rpmEVR; +extern int rpmFLAGS; static struct rpmQVArguments rpmQVArgs; static struct rpmBuildArguments buildArgs; @@ -137,7 +138,7 @@ static struct poptOption optionsTable[] = { { "verbose", 'v', 0, 0, 'v', NULL, NULL}, { "verify", 'V', 0, 0, 'V', NULL, NULL}, { NULL, 'y', 0, 0, 'V', NULL, NULL}, - { "version", '\0', 0, &rpm_version, 0, NULL, NULL}, + { "version", '\0', 0, &showVersion, 0, NULL, NULL}, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmQVSourcePoptTable, 0, (void *) &rpmQVArgs, NULL }, { NULL, '\0', POPT_ARG_INCLUDE_TABLE, @@ -166,7 +167,7 @@ static void printUsage(void); static void printHelpLine(char * prefix, char * help); static void printVersion(void) { - fprintf(stdout, _("RPM version %s\n"), version); + fprintf(stdout, _("RPM version %s\n"), rpmEVR); } static void printBanner(void) { @@ -532,6 +533,7 @@ int main(int argc, char ** argv) #if HAVE_MCHECK_H && HAVE_MTRACE mtrace(); /* Trace malloc only if MALLOC_TRACE=mtrace-output-file. */ #endif + setprogname(argv[0]); /* Retrofit glibc __progname */ /* set the defaults for the various command line options */ allFiles = 0; @@ -571,7 +573,7 @@ int main(int argc, char ** argv) showrc = 0; signIt = 0; test = 0; - rpm_version = 0; + showVersion = 0; /* XXX Eliminate query linkage loop */ parseSpecVec = parseSpec; @@ -848,7 +850,7 @@ int main(int argc, char ** argv) if (quiet) rpmSetVerbosity(RPMMESS_QUIET); - if (rpm_version) printVersion(); + if (showVersion) printVersion(); if (help) printHelp(); if (arg < -1) { @@ -1123,7 +1125,7 @@ int main(int argc, char ** argv) switch (bigMode) { case MODE_UNKNOWN: - if (!rpm_version && !help && !noUsageMsg) printUsage(); + if (!showVersion && !help && !noUsageMsg) printUsage(); break; case MODE_REBUILDDB: diff --git a/rpm2cpio.c b/rpm2cpio.c index bc23dcc93..59eb6810d 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -4,15 +4,6 @@ #include "rpmlib.h" -char *zlib_err [] = { - "No", - "Unix", - "Data", - "Memory", - "Buffer", - "Version" -}; - int main(int argc, char **argv) { FD_t fdi, fdo; @@ -22,6 +13,7 @@ int main(int argc, char **argv) int ct; FD_t gzdi; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { diff --git a/system.h b/system.h index 7d6f9747b..39b7ecad3 100644 --- a/system.h +++ b/system.h @@ -203,20 +203,25 @@ void *vmefail(void); #endif -#if HAVE_MCHECK_H && defined(__GNUC__) - /* Memory allocation via macro defs to get meaningful locations from mtrace() */ - +#if HAVE_MCHECK_H && defined(__GNUC__) #define xmalloc(_size) (malloc(_size) ? : vmefail()) - #define xcalloc(_nmemb, _size) (calloc((_nmemb), (_size)) ? : vmefail()) - #define xrealloc(_ptr, _size) (realloc((_ptr), (_size)) ? : vmefail()) - #define xstrdup(_str) (strcpy((malloc(strlen(_str)+1) ? : vmefail()), (_str))) - #endif /* HAVE_MCHECK_H && defined(__GNUC__) */ +/* Retrofit glibc __progname */ +char *__progname; +#if defined __GLIBC__ && __GLIBC__ >= 2 +#define setprogname(pn) +#else +#define setprogname(pn) \ + { if ((__progname = strrchr(pn, '/')) __progname++; \ + else __progname = pn; \ + } +#endif + #if HAVE_NETDB_H #ifndef __LCLINT__ #include diff --git a/tools/dump.c b/tools/dump.c index becec45e7..24ad90277 100644 --- a/tools/dump.c +++ b/tools/dump.c @@ -7,6 +7,7 @@ int main(int argc, char ** argv) Header h; FD_t fdi; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { diff --git a/tools/dumpdb.c b/tools/dumpdb.c index 9cdfc6251..e26aaca18 100644 --- a/tools/dumpdb.c +++ b/tools/dumpdb.c @@ -10,6 +10,7 @@ int main(int argc, char ** argv) int blockNum = 0; rpmdb db; + setprogname(argv[0]); /* Retrofit glibc __progname */ rpmReadConfigFiles(NULL, NULL); if (argc == 2) { diff --git a/tools/rpmarchive.c b/tools/rpmarchive.c index 99f8b08c3..46813fccd 100644 --- a/tools/rpmarchive.c +++ b/tools/rpmarchive.c @@ -14,6 +14,7 @@ int main(int argc, char **argv) Header hd; int ct; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { diff --git a/tools/rpmchecksig.c b/tools/rpmchecksig.c index 645ab842e..f575e6ac3 100644 --- a/tools/rpmchecksig.c +++ b/tools/rpmchecksig.c @@ -15,6 +15,7 @@ int main(int argc, char **argv) char result[1024]; int res; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fd = 0; } else { diff --git a/tools/rpmgettext.c b/tools/rpmgettext.c index 3e3495d4c..d72bbe2be 100644 --- a/tools/rpmgettext.c +++ b/tools/rpmgettext.c @@ -32,7 +32,6 @@ static void dpf(char *format, ...) #define DPRINTF(_lvl, _fmt) #endif -const char *program_name = NULL; int debug = MYDEBUG; int verbose = 0; char *inputdir = NULL; @@ -994,7 +993,7 @@ main(int argc, char **argv) int errflg = 0; FD_t fdi; - program_name = basename(argv[0]); + setprogname(argv[0]); /* Retrofit glibc __progname */ while((c = getopt(argc, argv, "degEMl:C:I:O:Tv")) != EOF) switch (c) { @@ -1047,7 +1046,7 @@ main(int argc, char **argv) fdi = fdDup(STDIN_FILENO); - if (!strcmp(program_name, RPMGETTEXT)) { + if (!strcmp(__progname, RPMGETTEXT)) { if (optind == argc) { rc = rpmgettext(fdi, STDINFN, stdout); } else { @@ -1056,15 +1055,15 @@ main(int argc, char **argv) break; } } - } else if (!strcmp(program_name, RPMPUTTEXT)) { + } else if (!strcmp(__progname, RPMPUTTEXT)) { if (mastercatalogue == NULL) { fprintf(stderr, _("%s: must specify master PO catalogue with -C\n"), - program_name); + __progname); exit(1); } if (optind == argc) { fprintf(stderr, _("%s: no binary rpms on cmd line\n"), - program_name); + __progname); exit(1); } else { string_list_ty *drillp = string_list_alloc(); @@ -1074,7 +1073,7 @@ main(int argc, char **argv) rc = rpmputtext(fdi, mastercatalogue, stdout, drillp); string_list_free(drillp); } - } else if (!strcmp(program_name, RPMCHKTEXT)) { + } else if (!strcmp(__progname, RPMCHKTEXT)) { if (optind == argc) { rc = rpmchktext(fdi, STDINFN, stdout); } else { diff --git a/tools/rpmheader.c b/tools/rpmheader.c index 16b61315a..2627e710d 100644 --- a/tools/rpmheader.c +++ b/tools/rpmheader.c @@ -13,6 +13,7 @@ int main(int argc, char **argv) Header hd; int rc; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { diff --git a/tools/rpminject.c b/tools/rpminject.c index 15559d59b..67bec53ff 100644 --- a/tools/rpminject.c +++ b/tools/rpminject.c @@ -527,6 +527,7 @@ main(int argc, char *argv[]) int ec = 0; injmode_t lastmode = INJ_UNKNOWN; + setprogname(argv[0]); /* Retrofit glibc __progname */ (void)setlocale(LC_ALL, "" ); #ifdef __LCLINT__ diff --git a/tools/rpmlead.c b/tools/rpmlead.c index 99ad334ea..89cbf4e8d 100644 --- a/tools/rpmlead.c +++ b/tools/rpmlead.c @@ -10,6 +10,7 @@ int main(int argc, char **argv) FD_t fdi, fdo; struct rpmlead lead; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else { diff --git a/tools/rpmsignature.c b/tools/rpmsignature.c index 6d81e4ed2..1a80e0684 100644 --- a/tools/rpmsignature.c +++ b/tools/rpmsignature.c @@ -11,6 +11,7 @@ int main(int argc, char **argv) struct rpmlead lead; Header sig; + setprogname(argv[0]); /* Retrofit glibc __progname */ if (argc == 1) { fdi = fdDup(STDIN_FILENO); } else {