aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-05-06 09:22:51 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-05-06 09:22:51 +0000
commitec5da158151c83d01c297bf229f4d55d3da54032 (patch)
treec97c7c96f35ffe646691a427e1bedc9808fe56fa /URPM.xs
parent02416c02cb77fdd6ac3c76edb8a070b5f0a6c527 (diff)
downloadperl-URPM-ec5da158151c83d01c297bf229f4d55d3da54032.tar
perl-URPM-ec5da158151c83d01c297bf229f4d55d3da54032.tar.gz
perl-URPM-ec5da158151c83d01c297bf229f4d55d3da54032.tar.bz2
perl-URPM-ec5da158151c83d01c297bf229f4d55d3da54032.tar.xz
perl-URPM-ec5da158151c83d01c297bf229f4d55d3da54032.zip
Add a way to downgrade some errors (file not found) to non-fatal
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs25
1 files changed, 17 insertions, 8 deletions
diff --git a/URPM.xs b/URPM.xs
index 7980c6f..6f0be1b 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3324,9 +3324,14 @@ Urpm_parse_synthesis(urpm, filename, ...)
XPUSHs(sv_2mortal(newSViv(start_id)));
XPUSHs(sv_2mortal(newSViv(av_len(depslist))));
}
- } else croak("unable to uncompress synthesis file %s", filename);
- } else croak("first argument should contains a depslist ARRAY reference");
- } else croak("first argument should be a reference to HASH");
+ } else {
+ SV **nofatal = hv_fetch((HV*)SvRV(urpm), "nofatal", 7, 0);
+ errno = ENOENT;
+ if (!nofatal || !SvIV(*nofatal))
+ croak("unable to uncompress synthesis file %s", filename);
+ }
+ } else croak("first argument should contain a depslist ARRAY reference");
+ } else croak("first argument should be a reference to a HASH");
void
Urpm_parse_hdlist(urpm, filename, ...)
@@ -3418,9 +3423,13 @@ Urpm_parse_hdlist(urpm, filename, ...)
XPUSHs(sv_2mortal(newSViv(start_id)));
XPUSHs(sv_2mortal(newSViv(av_len(depslist))));
}
- } else croak("cannot open hdlist file %s", filename);
- } else croak("first argument should contains a depslist ARRAY reference");
- } else croak("first argument should be a reference to HASH");
+ } else {
+ SV **nofatal = hv_fetch((HV*)SvRV(urpm), "nofatal", 7, 0);
+ if (!nofatal || !SvIV(*nofatal))
+ croak("cannot open hdlist file %s", filename);
+ }
+ } else croak("first argument should contain a depslist ARRAY reference");
+ } else croak("first argument should be a reference to a HASH");
void
Urpm_parse_rpm(urpm, filename, ...)
@@ -3478,8 +3487,8 @@ Urpm_parse_rpm(urpm, filename, ...)
XPUSHs(sv_2mortal(newSViv(av_len(depslist))));
XPUSHs(sv_2mortal(newSViv(av_len(depslist))));
} else free(_pkg);
- } else croak("first argument should contains a depslist ARRAY reference");
- } else croak("first argument should be a reference to HASH");
+ } else croak("first argument should contain a depslist ARRAY reference");
+ } else croak("first argument should be a reference to a HASH");
char *
Urpm_verify_rpm(filename, ...)