aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-04-11 16:06:52 +0000
committerFrancois Pons <fpons@mandriva.com>2003-04-11 16:06:52 +0000
commite6afdabda415104a478da84a09dcb78c73b80ce2 (patch)
treeea1d90d5817fc360e9e74c6f313d539f4e396611 /URPM.xs
parentb73e161f4c85132e6c12d67a4ec413f9118659b1 (diff)
downloadperl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar.gz
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar.bz2
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar.xz
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.zip
brand new 0.82 version (flag_skip, excludedocs, fix NULL get_name)
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs34
1 files changed, 28 insertions, 6 deletions
diff --git a/URPM.xs b/URPM.xs
index 51a0c5d..3e56ecc 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -56,8 +56,9 @@ typedef rpmdb URPM__DB;
typedef struct s_Transaction* URPM__Transaction;
typedef struct s_Package* URPM__Package;
-#define FLAG_ID 0x001fffffU
-#define FLAG_RATE 0x00e00000U
+#define FLAG_ID 0x000fffffU
+#define FLAG_RATE 0x00700000U
+#define FLAG_SKIP 0x00800000U
#define FLAG_BASE 0x01000000U
#define FLAG_FORCE 0x02000000U
#define FLAG_INSTALLED 0x04000000U
@@ -67,10 +68,10 @@ typedef struct s_Package* URPM__Package;
#define FLAG_OBSOLETE 0x40000000U
#define FLAG_NO_HEADER_FREE 0x80000000U
-#define FLAG_ID_MAX 0x001ffffe
-#define FLAG_ID_INVALID 0x001fffff
+#define FLAG_ID_MAX 0x000ffffe
+#define FLAG_ID_INVALID 0x000fffff
-#define FLAG_RATE_POS 21
+#define FLAG_RATE_POS 20
#define FLAG_RATE_MAX 5
#define FLAG_RATE_INVALID 0
@@ -118,7 +119,7 @@ get_name(Header header, int_32 tag) {
char *name;
headerGetEntry(header, tag, &type, (void **) &name, &count);
- return name;
+ return name ? name : "";
}
static int
@@ -1519,6 +1520,25 @@ Pkg_build_header(pkg, fileno)
} else croak("no header available for package");
int
+Pkg_flag_skip(pkg)
+ URPM::Package pkg
+ CODE:
+ RETVAL = pkg->flag & FLAG_SKIP;
+ OUTPUT:
+ RETVAL
+
+int
+Pkg_set_flag_skip(pkg, value=1)
+ URPM::Package pkg
+ int value
+ CODE:
+ RETVAL = pkg->flag & FLAG_SKIP;
+ if (value) pkg->flag |= FLAG_SKIP;
+ else pkg->flag &= ~FLAG_SKIP;
+ OUTPUT:
+ RETVAL
+
+int
Pkg_flag_base(pkg)
URPM::Package pkg
CODE:
@@ -2061,6 +2081,8 @@ Trans_run(trans, data, ...)
if (len == 4 && !memcmp(s, "test", 4)) {
if (SvIV(ST(i+1))) transFlags |= RPMTRANS_FLAG_TEST;
+ } else if (len == 11 && !memcmp(s, "excludedocs", 11)) {
+ if (SvIV(ST(i+1))) transFlags |= RPMTRANS_FLAG_NODOCS;
} else if (len == 5) {
if (!memcmp(s, "force", 5)) {
if (SvIV(ST(i+1))) probFilter |= (RPMPROB_FILTER_REPLACEPKG |