diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-22 16:02:56 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-22 16:02:56 +0000 |
commit | 525ddb9ffcfbc77661e6532d28d6c91f08eba93e (patch) | |
tree | 47d9c9914e03b81bec414bd0f409224162845841 | |
parent | 9f9a92b7dee5615ab213a3217fcccbdda01af16c (diff) | |
download | perl-URPM-525ddb9ffcfbc77661e6532d28d6c91f08eba93e.tar perl-URPM-525ddb9ffcfbc77661e6532d28d6c91f08eba93e.tar.gz perl-URPM-525ddb9ffcfbc77661e6532d28d6c91f08eba93e.tar.bz2 perl-URPM-525ddb9ffcfbc77661e6532d28d6c91f08eba93e.tar.xz perl-URPM-525ddb9ffcfbc77661e6532d28d6c91f08eba93e.zip |
(compare_pkgs,compare) style: indent after last changes
-rw-r--r-- | URPM.xs | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -1639,7 +1639,7 @@ Pkg_compare_pkg(lpkg, rpkg) } compare = compare_evrs(lepoch, lversion, lrelease, repoch, rversion, rrelease); // equal? compare arches too - if (!compare) { + if (!compare) { int lscore, rscore; char *eolarch = strchr(larch, '@'); char *eorarch = strchr(rarch, '@'); @@ -1662,7 +1662,7 @@ Pkg_compare_pkg(lpkg, rpkg) } if (eolarch) *eolarch = '@'; if (eorarch) *eorarch = '@'; - } + } /* restore info string modified */ if (lpkg->info) { lrelease[-1] = '-'; @@ -1690,24 +1690,22 @@ Pkg_compare(pkg, evr) if (!get_e_v_r(pkg, &_epoch, &_version, &_release, &_eos)) croak("undefined package"); - char *epoch = NULL, *version, *release; + char *epoch = NULL, *version, *release; - /* extract epoch and version from evr */ + /* extract epoch and version from evr */ + version = evr; + while (*version && isdigit(*version)) version++; + if (*version == ':') { + epoch = evr; + *version++ = 0; + if (!*epoch) epoch = "0"; + version[-1] = ':'; /* restore in memory modification */ + } else { + /* there is no epoch defined, so assume epoch = 0 */ version = evr; - while (*version && isdigit(*version)) version++; - if (*version == ':') { - epoch = evr; - *version++ = 0; - if (!*epoch) epoch = "0"; - version[-1] = ':'; /* restore in memory modification */ - } else { - /* there is no epoch defined, so assume epoch = 0 */ - version = evr; - } - /* continue extracting release if any */ - if ((release = strrchr(version, '-')) != NULL) { - *release++ = 0; - } + } + if ((release = strrchr(version, '-')) != NULL) + *release++ = 0; repoch = epoch && *epoch ? atoi(epoch) : 0; RETVAL = compare_evrs(_epoch, _version, _release, repoch, version, release); |