]> git.pld-linux.org Git - packages/poldek.git/commitdiff
This commit was manufactured by cvs2git to create branch 'AC-branch'.
authorcvs2git <feedback@pld-linux.org>
Thu, 3 Apr 2008 16:40:38 +0000 (16:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Cherrypick from master 2008-03-19 19:40:29 UTC Elan Ruusamäe <glen@pld-linux.org> '- rpm will win the ordering':
    poldek-abort-on-upgrade.patch -> 1.1
    poldek-as_needed-fix.patch -> 1.1
    poldek-dir-dot.patch -> 1.1
    poldek-install-dist.patch -> 1.1
    poldek-multilib.patch -> 1.1
    poldek-ndie_fix.patch -> 1.1
    poldek-nohold-fix.patch -> 1.2
    poldek-nonoorder.patch -> 1.1
    poldek-reversed-prompt.patch -> 1.1
    poldek-suggests-one-package.patch -> 1.1
    poldek-uri-escape-fix.patch -> 1.1
    poldek-vserver-packages.patch -> 1.2
    poldek.png -> 1.1
Cherrypick from master 2006-04-02 20:24:23 UTC Elan Ruusamäe <glen@pld-linux.org> '- bugfixes from mis':
    poldek-bug-5774.patch -> 1.1
    poldek-cvs-fixes.patch -> 1.3
    poldek-uninstall-multilib.patch -> 1.1
Cherrypick from master 2007-06-18 16:19:28 UTC mis <mis@pld-linux.org> '- 'upgrade lib*' bugfix':
    poldek-desc_in_utf8.patch -> 1.1
    poldek-fix-multilib.patch -> 1.1
Cherrypick from master 2008-04-03 16:40:38 UTC Marcin Banasiak <marcin.banasiak@gmail.com> '- if there is unknown key in pkguinf, don't call n_assert(0). This fix allows':
    poldek-pkguinf-kill-assert.patch -> 1.1
    poldek-uninstall-greedy-fix.patch -> 1.1
Cherrypick from master 2006-05-11 11:57:42 UTC Elan Ruusamäe <glen@pld-linux.org> '- adjust':
    poldek-cli-hist.patch -> 1.2
Cherrypick from unlabeled-1.1.2 2007-06-14 22:43:48 UTC Arkadiusz Miśkiewicz <arekm@maven.pl> 'ignore cpuinfo() and uname() caps':
    poldek-ignorecaps.patch -> 1.1.2.1

22 files changed:
poldek-abort-on-upgrade.patch [new file with mode: 0644]
poldek-as_needed-fix.patch [new file with mode: 0644]
poldek-bug-5774.patch [new file with mode: 0644]
poldek-cli-hist.patch [new file with mode: 0644]
poldek-cvs-fixes.patch [new file with mode: 0644]
poldek-desc_in_utf8.patch [new file with mode: 0644]
poldek-dir-dot.patch [new file with mode: 0644]
poldek-fix-multilib.patch [new file with mode: 0644]
poldek-ignorecaps.patch [new file with mode: 0644]
poldek-install-dist.patch [new file with mode: 0644]
poldek-multilib.patch [new file with mode: 0644]
poldek-ndie_fix.patch [new file with mode: 0644]
poldek-nohold-fix.patch [new file with mode: 0644]
poldek-nonoorder.patch [new file with mode: 0644]
poldek-pkguinf-kill-assert.patch [new file with mode: 0644]
poldek-reversed-prompt.patch [new file with mode: 0644]
poldek-suggests-one-package.patch [new file with mode: 0644]
poldek-uninstall-greedy-fix.patch [new file with mode: 0644]
poldek-uninstall-multilib.patch [new file with mode: 0644]
poldek-uri-escape-fix.patch [new file with mode: 0644]
poldek-vserver-packages.patch [new file with mode: 0644]
poldek.png [new file with mode: 0644]

diff --git a/poldek-abort-on-upgrade.patch b/poldek-abort-on-upgrade.patch
new file mode 100644 (file)
index 0000000..87cff39
--- /dev/null
@@ -0,0 +1,10 @@
+--- poldek-0.21-cvs20070703.00/pm/rpm/rpm.c~   2007-07-02 00:04:27.000000000 +0300
++++ poldek-0.21-cvs20070703.00/pm/rpm/rpm.c    2008-02-15 05:28:23.107186566 +0200
+@@ -221,6 +221,7 @@
+         logn(LOGERR, _("%s%s: open rpm database failed"),
+              rootdir ? rootdir:"", dbpath ? dbpath : pm->default_dbpath);
+         rc = 0;
++              abort(); // XXX maybe re-exec ourselves after poldek binary upgrade?
+     }
+     
+ #if ENABLE_TRACE    
diff --git a/poldek-as_needed-fix.patch b/poldek-as_needed-fix.patch
new file mode 100644 (file)
index 0000000..9aabc46
--- /dev/null
@@ -0,0 +1,12 @@
+diff -Nur poldek-0.20/vfile/Makefile.am poldek-0.20.as_needed-fix/vfile/Makefile.am
+--- poldek-0.20/vfile/Makefile.am      2005-05-15 17:16:13.000000000 +0200
++++ poldek-0.20.as_needed-fix/vfile/Makefile.am        2006-08-02 01:46:42.000000000 +0200
+@@ -22,7 +22,7 @@
+                                     vfffmod.c $(VFCURL_SRCS_) \
+                                         vopen3.c vopen3.h vfile_intern.h
+-libvfile_la_LIBADD = vfff/libvfff.la
++libvfile_la_LIBADD = vfff/libvfff.la -lutil
+ pkgincludedir = $(includedir)/vfile
+ pkginclude_HEADERS = vfile.h p_open.h vopen3.h
diff --git a/poldek-bug-5774.patch b/poldek-bug-5774.patch
new file mode 100644 (file)
index 0000000..d216d71
--- /dev/null
@@ -0,0 +1,25 @@
+===================================================================
+RCS file: /cvsroot/poldek/poldek/vfile/vfetch.c,v
+retrieving revision 1.13
+retrieving revision 1.14
+diff -u -r1.13 -r1.14
+--- poldek/poldek/vfile/vfetch.c       2005/05/15 15:47:00     1.13
++++ poldek/poldek/vfile/vfetch.c       2006/04/02 19:49:12     1.14
+@@ -11,7 +11,7 @@
+ */
+ /*
+-  $Id$
++  $Id$
+ */
+ #ifdef HAVE_CONFIG_H
+ # include "config.h"
+@@ -299,7 +299,7 @@
+             snprintf(url, sizeof(url), req->url);
+             vf_request_free(req);
+             req = NULL;
+-            rc = vf_fetch(req->url, destdir, flags, NULL);
++            rc = vf_fetch(url, destdir, flags, NULL);
+         }
+     }
+     if (req)
diff --git a/poldek-cli-hist.patch b/poldek-cli-hist.patch
new file mode 100644 (file)
index 0000000..ad66fa5
--- /dev/null
@@ -0,0 +1,45 @@
+===================================================================
+RCS file: /cvsroot/poldek/poldek/cli/shell.c,v
+retrieving revision 1.28
+retrieving revision 1.29
+diff -u -r1.28 -r1.29
+--- poldek/poldek/cli/shell.c  2006/01/07 01:06:48     1.28
++++ poldek/poldek/cli/shell.c  2006/05/11 09:51:53     1.29
+@@ -356,22 +356,34 @@
+         snprintf(prompt, sizeof(prompt), "poldek:%s%s> ",
+                  currdir == NULL ? "/" : *currdir->name == '/' ? "" : "/",
+                  currdir == NULL ? "" : currdir->name);
++
+         if ((line = readline(prompt)) == NULL)
+             break;
++        /* add to history? */
++        s = line;
++        while (isspace(*s))
++            s++;
++        
++        if (*s)
++            add_history(line);
++                
+         s = n_str_strip_ws(line);
+         if (*s) {
+             int _verbose = poldek_verbose();
+-            add_history(s);
+-            //print_mem_info("BEFORE");
++            
+             shInCmd = 1;
+             DBGF("(%s)\n", s);
++
++            MEMINF("BEFORE %s\n", s);
+             poclidek_execline(cctx, NULL, s);
++            MEMINF("AFTER  %s\n", s);
++            
+             sigint_reset();
+             shDone = 0;
+             shInCmd = 0;
++
+             poldek_set_verbose(_verbose);
+-            //print_mem_info("AFTER ");
+         }
+         free(line);
+         
diff --git a/poldek-cvs-fixes.patch b/poldek-cvs-fixes.patch
new file mode 100644 (file)
index 0000000..41f4575
--- /dev/null
@@ -0,0 +1,356 @@
+===================================================================
+RCS file: /cvsroot/installer/poldek/pkgset-install.c,v
+retrieving revision 1.147
+retrieving revision 1.148
+diff -u -r1.147 -r1.148
+--- installer/poldek/pkgset-install.c  2005/10/24 15:30:40     1.147
++++ installer/poldek/pkgset-install.c  2005/11/01 19:36:36     1.148
+ #ifdef HAVE_CONFIG_H
+@@ -1174,7 +1174,9 @@
+     memset(&successor, 0, sizeof(successor));
+     if (process_as == PROCESS_AS_ORPHAN &&
+         upg->ts->getop(upg->ts, POLDEK_OP_AGGREEDY)) {
+-        if (pkg_drags(pkg, ps, upg) == 0) {
++      int ndrags = pkg_drags(pkg, ps, upg);
++      DBGF("%s, ndrags %d\n", pkg_id(pkg), ndrags);
++        if (ndrags == 0 || 1) { /* XXX cond temporary disabled - needs test */
+             struct pkg *p;
+             int is_marked = 0, ndragged = 0, by_obsoletes = 0;
+@@ -1186,9 +1188,10 @@
+             successor.realpkg = p;
+             successor.by_obsoletes = by_obsoletes;
+             
+-            /* do not follow successor if package drags something and
+-              is not marked */
+-            if (p && (ndragged = pkg_drags(p, ps, upg)) > 0 && is_marked == 0) {
++            /* do not follow successor if it drags more packages than orphaned one
++           * and successor is not marked */
++          
++            if (p && (ndragged = pkg_drags(p, ps, upg)) > ndrags && is_marked == 0) {
+                 DBGF("OMIT select_successor %s -> %s (%d)\n",
+                      pkg_id(pkg), pkg_id(p), ndragged);
+                 p = NULL;
+===================================================================
+RCS file: /cvsroot/installer/poldek/vfile/misc.c,v
+retrieving revision 1.11
+retrieving revision 1.12
+diff -u -r1.11 -r1.12
+--- installer/poldek/vfile/misc.c      2005/07/17 15:04:34     1.11
++++ installer/poldek/vfile/misc.c      2005/11/02 19:45:40     1.12
+@@ -58,7 +58,7 @@
+     
+     p = path;
+     p++;
+-    ndots = 0;
++    ndots = -1;
+     
+     while (*p) {
+         switch (*p) {
+@@ -71,11 +71,12 @@
+                 break;
+             case '.':
+-                ndots++;
++                if (ndots >= 0)
++                    ndots++;
+                 break;
+             default:
+-                ndots = 0;
++                ndots = -1;
+                 
+                 if (!isalnum(*p) && strchr("-+/._@!~", *p) == NULL) {
+                     vf_logerr("%s:%c non alphanumeric characters not allowed\n",
+===================================================================
+RCS file: /cvsroot/installer/poldek/vfile/extcompr.c,v
+retrieving revision 1.7
+retrieving revision 1.8
+diff -u -r1.7 -r1.8
+--- installer/poldek/vfile/extcompr.c  2005/05/15 15:46:59     1.7
++++ installer/poldek/vfile/extcompr.c  2005/11/02 20:10:36     1.8
+@@ -195,7 +195,7 @@
+     if (uncompr == NULL)
+         return -1;
+-    if (*vfile_verbose) 
++    if (*vfile_verbose > 0) 
+         vf_loginfo(_("Decompressing %s...\n"), n_basenam(path));
+     return vf_do_compr(uncompr, "-d", path, destpath);
+ }
+===================================================================
+RCS file: /cvsroot/installer/poldek/cli/uninstall.c,v
+retrieving revision 1.25
+retrieving revision 1.26
+diff -u -r1.25 -r1.26
+--- installer/poldek/cli/uninstall.c   2005/07/12 17:29:09     1.25
++++ installer/poldek/cli/uninstall.c   2005/11/05 00:14:38     1.26
+@@ -171,6 +171,7 @@
+                 
+                 ts->setop(ts, POLDEK_OP_GREEDY, bool);
+             }
++            break;
+             
+         case 't':
+             if (ts->getop(ts, POLDEK_OP_TEST))
+===================================================================
+RCS file: /cvsroot/installer/poldek/vfcompr,v
+retrieving revision 1.4
+retrieving revision 1.6
+diff -u -r1.4 -r1.6
+--- installer/poldek/vfcompr   2004/07/05 19:15:10     1.4
++++ installer/poldek/vfcompr   2005/11/02 20:25:37     1.6
+@@ -19,7 +22,7 @@
+     typeset src=$1
+     typeset dest=$2
+-    md5file="${src}-vfcompr.md5"
++    md5file="${dest}-vfcompr.md5"
+     #echo "$md5file"
+     if [ -f $dest -a -f "$md5file" ]; then
+         #echo md5sum --check "$md5file"
+===================================================================
+RCS file: /cvsroot/poldek/poldek/pkg.c,v
+retrieving revision 1.107
+retrieving revision 1.108
+diff -u -r1.107 -r1.108
+--- poldek/poldek/pkg.c        2005/10/13 15:39:27     1.107
++++ poldek/poldek/pkg.c        2006/03/18 16:29:00     1.108
+@@ -1,5 +1,5 @@
+ /*
+-  Copyright (C) 2000 - 2004 Pawel A. Gajda <mis@k2.net.pl>
++  Copyright (C) 2000 - 2006 Pawel A. Gajda (mis@k2.net.pl)
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License, version 2 as
+@@ -15,7 +15,7 @@
+  */
+ /*
+-  $Id$
++  $Id$
+ */
+ #ifdef HAVE_CONFIG_H
+@@ -694,8 +694,8 @@
+     int n;
+         
+     DBGF("\npkg_caps_match_req %s %s\n", pkg_snprintf_s(pkg), 
+-         capreq_snprintf_s(req));
+-        
++           capreq_snprintf_s(req));
++    
+     if (pkg->caps == NULL || n_array_size(pkg->caps) == 0)
+         return 0;     /* not match */
+     
+@@ -703,40 +703,25 @@
+         return 0;
+             
+     } else {
+-        struct capreq *cap;
+         int i;
++        for (i = n; i < n_array_size(pkg->caps); i++) {
++            struct capreq *cap = n_array_nth(pkg->caps, i);
+-        cap = n_array_nth(pkg->caps, n);
+-        if (cap_xmatch_req(cap, req, flags)) {
+-            DBGF("chk%d (%s-%s-%s) -> match (flags=%d)\n", n, capreq_name(cap),
+-                 capreq_ver(cap), capreq_rel(cap), flags);
+-            return 1;
+-        }
+-        n++;
+-            
+-        for (i = n; i<n_array_size(pkg->caps); i++) {
+-            struct capreq *cap;
+-
+-            cap = n_array_nth(pkg->caps, n);
+-            if (strcmp(capreq_name(cap), capreq_name(req)) != 0) {
+-                DBGF("chk%d %s-%s-%s -> NOT match IRET\n", i,
+-                     capreq_name(cap), capreq_ver(cap),
+-                     capreq_rel(cap));
++            /* names not equal -> return with false;
++               eq test omitting for first cap */
++            if (i > n && n_str_ne(capreq_name(cap), capreq_name(req))) {
++                DBGF("  cap[%d] %s -> NOT match, IRET\n", i,
++                       capreq_snprintf_s(cap));
+                 return 0;
+             }
+-                
+-                
++            
+             if (cap_xmatch_req(cap, req, flags)) {
+-                DBGMSG("chk %s-%s-%s -> match\n", capreq_name(cap),
+-                       capreq_ver(cap), capreq_rel(cap));
++                DBGF("  cap[%d] %s -> match\n", i, capreq_snprintf_s(cap));
+                 return 1;
+-            } else {
+-                DBGMSG("chk%d %s-%s-%s -> NOT match\n", i,
+-                       capreq_name(cap), capreq_ver(cap),
+-                       capreq_rel(cap));
+             }
++            
++            DBGF("  cap[%d] %s -> NOT match\n", i, capreq_snprintf_s(cap));
+         }
+-        DBGMSG("NONE\n");
+     }
+     
+     return 0;
+--- poldek/poldek/pm/pkgdb.c   2005/10/24 15:25:58     1.21
++++ poldek/poldek/pm/pkgdb.c   2006/03/18 15:18:04     1.22
+@@ -11,7 +11,7 @@
+ */
+ /*
+-  $Id$
++  $Id$
+ */
+ #include <stdlib.h>
+@@ -440,6 +440,9 @@
+                                     tn_array *unistdbpkgs, unsigned ldflags)
+ {
+     tn_array *dbpkgs = NULL;
++
++    n_assert(db);
++    n_assert(cap);
+     pkgdb_search(db, &dbpkgs, PMTAG_CAP, capreq_name(cap),
+                  unistdbpkgs, ldflags);
+     return dbpkgs;
+diff -u poldek/poldek/uninstall.c poldek/poldek/uninstall.c
+--- poldek/poldek/uninstall.c  2006/03/18 15:18:04     1.38
++++ poldek/poldek/uninstall.c  2006/03/18 17:03:48     1.39
+@@ -1,5 +1,5 @@
+ /*
+-  Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
++  Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl>
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License, version 2 as
+@@ -11,7 +11,7 @@
+ */
+ /*
+-  $Id$
++  $Id$
+ */
+ #include <errno.h>
+@@ -407,7 +407,7 @@
+     tn_array *dbpkgs;
+     int i, nmatches = 0;
+-    
++    n_assert(cr);
+     DBGF("get_provides %s\n", capreq_snprintf_s(cr));
+     dbpkgs = pkgdb_get_provides_dbpkgs(ts->db, cr, NULL, uninst_LDFLAGS);
+@@ -431,7 +431,8 @@
+         } else {                /* with version */
+             if (ts->getop(ts, POLDEK_OP_CAPLOOKUP)) {
+                 if (pkg_xmatch_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
+-                            matched = 1;
++                    matched = 1;
++                
+             } else {
+                 if (strcmp(dbpkg->name, capreq_name(cr)) == 0) {
+                     DBGF("n (%s, %s) %d\n", dbpkg->name,
+@@ -457,15 +458,20 @@
+     return nmatches;
+ }
+-static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts, const char *mask)
++static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
++                           const char *mask)
+ {
+     char           *p;
+     struct capreq  *cr, *cr_evr;
+     int            resolved = 0;
+     
+     cr = NULL; cr_evr = NULL;
+-    
+-    if ((p = strchr(mask, '#')) == NULL) {
++
++    DBGF("mask=%s\n", mask); 
++    /* No EVR mask or empty EVR (last char '#') */
++    if ((p = strchr(mask, '#')) == NULL || *(p + 1) == '\0') {
++        if (p)
++            *p = '\0';
+         capreq_new_name_a(mask, cr);
+             
+     } else {
+@@ -479,8 +485,10 @@
+         *p = '\0';
+         p++;
+-        if (poldek_util_parse_evr(p, &epoch, &ver, &rel))
++        if (poldek_util_parse_evr(p, &epoch, &ver, &rel)) {
+             cr = cr_evr = capreq_new(NULL, tmp, epoch, ver, rel, REL_EQ, 0);
++            DBGF("cap=%s\n", capreq_snprintf_s(cr)); 
++        }
+     }
+     
+     if (do_resolve_package(uctx, ts, mask, cr))
+@@ -529,7 +537,6 @@
+                     int32_t e = 0;
+                     n_strdupap(mask, &tmp);
+-                    
+                     if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
+                         if (e)
+                             n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
+@@ -538,7 +545,7 @@
+                         msgn(2, "    Trying %s\n", nmask);
+                         DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
+-                        matched = resolve_package(uctx, ts, tmp);
++                        matched = resolve_package(uctx, ts, nmask);
+                     }
+                 }
+             }
+--- poldek/poldek/conf.c       2005/11/05 17:47:55     1.79
++++ poldek/poldek/conf.c       2006/03/18 15:27:47     1.80
+@@ -1,5 +1,5 @@
+ /*
+-  Copyright (C) 2000 - 2005 Pawel A. Gajda <mis@k2.net.pl>
++  Copyright (C) 2000 - 2006 Pawel A. Gajda <mis@k2.net.pl>
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License, version 2 as
+@@ -137,9 +137,15 @@
+         sep = " \t,";
+     
+     p = v = n_str_tokl(vstr, sep);
+-    if (v == NULL)
++
++    if (v == NULL)              /* n_str_tokl error */
+         return 0;
++    if (*v == NULL) {             /* empty option value */
++        n_str_tokl_free(v);
++        return 1;
++    }
++
+     if (n_hash_exists(ht, name)) {
+         opt = n_hash_get(ht, name);
+         
+@@ -166,6 +172,7 @@
+         }
+         p++;
+     }
++
+     n_str_tokl_free(v);
+     return 1;
+ }
+--- poldek/poldek/cli/main.c   2005/11/06 19:26:27     1.54
++++ poldek/poldek/cli/main.c   2006/03/18 15:55:37     1.55
+@@ -115,8 +115,8 @@
+ {"upconf", OPT_UPCONF, 0, 0, N_("Update remote configuration files (if any)"),
+      OPT_GID },
+-{"version", OPT_BANNER, 0, 0, N_("Display program version information and exit"),
+-     OPT_GID },
++{"version", OPT_BANNER, 0, OPTION_HIDDEN,
++     N_("Display program version information and exit"), OPT_GID },
+     
+ {"log", OPT_LOG, "FILE", 0, N_("Log program messages to FILE"), OPT_GID },
+ {"runas", OPT_RUNAS, "USER", 0, N_("Run program as user USER"), OPT_GID },
diff --git a/poldek-desc_in_utf8.patch b/poldek-desc_in_utf8.patch
new file mode 100644 (file)
index 0000000..6390132
--- /dev/null
@@ -0,0 +1,70 @@
+--- poldek-0.20.1-cvs20070108.22/pkgdir/pndir/description.c.stare      2007-05-29 22:39:55.000000000 +0200
++++ poldek-0.20.1-cvs20070108.22/pkgdir/pndir/description.c    2007-05-30 15:11:58.000000000 +0200
+@@ -166,6 +166,7 @@
+         for (i = n_array_size(langs) - 1; i >= 0; i--) {
+             struct tndb *db;
+             const char *lang;
++            char lang_utf8[24];
+             char dkey[512];
+             int  dklen;
+@@ -176,6 +177,19 @@
+             if ((db = pndir_db_dscr_h_get(db_dscr_h, lang)) == NULL)
+                 continue;
++            snprintf(lang_utf8, sizeof(lang_utf8), "%s.UTF-8", lang);
++
++            dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang_utf8);
++            vlen = tndb_get(db, dkey, dklen, val, sizeof(val));
++            DBGF("ld %s: %s (%d)\n", pkg_snprintf_s(pkg), lang_utf8, vlen);
++            if (vlen > 0) {
++                tn_buf_it it;
++                n_buf_clean(nbuf);
++                n_buf_init(nbuf, val, vlen);
++                n_buf_it_init(&it, nbuf);
++                pkguinf_restore_i18n(pkgu, &it, lang_utf8);
++            }
++    
+             dklen = n_snprintf(dkey, sizeof(dkey), "%s%s", key, lang);
+             vlen = tndb_get(db, dkey, dklen, val, sizeof(val));
+             DBGF("ld %s: %s (%d)\n", pkg_snprintf_s(pkg), lang, vlen);
+--- poldek-0.20.1-cvs20070108.22/pkgu.c.stare  2007-05-29 21:40:39.000000000 +0200
++++ poldek-0.20.1-cvs20070108.22/pkgu.c        2007-05-30 16:37:16.000000000 +0200
+@@ -15,6 +15,8 @@
+ */
+ #include <ctype.h>
++#include <iconv.h>
++#include <langinfo.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -576,7 +576,27 @@
+         return 0;
+     description = n_buf_it_getz(it, &dlen);
+-    inf = pkguinf_i18n_new(pkgu->_na, summary, description);
++    if (strstr(lang, "UTF-8")) {
++        iconv_t cd;
++        size_t u_slen = slen, u_dlen = dlen;
++        char *new_s, *new_d;
++        char *summary_utf8 = n_malloc(u_slen + 1);
++        char *description_utf8 = n_malloc(u_dlen + 1);
++
++        new_s = summary_utf8;
++        new_d = description_utf8;
++        cd = iconv_open(nl_langinfo(CODESET), "UTF-8");
++        iconv(cd, &summary, &slen, &new_s, &u_slen);
++        iconv(cd, &description, &dlen, &new_d, &u_dlen);
++        iconv_close(cd);
++        *new_s = '\0';
++        *new_d = '\0';
++        inf = pkguinf_i18n_new(pkgu->_na, summary_utf8, description_utf8);
++        n_free(summary_utf8);
++        n_free(description_utf8);
++    } else {
++        inf = pkguinf_i18n_new(pkgu->_na, summary, description);
++    }
+     n_hash_insert(pkgu->_ht, lang, inf);
+     
+     pkgu->summary = inf->summary;
diff --git a/poldek-dir-dot.patch b/poldek-dir-dot.patch
new file mode 100644 (file)
index 0000000..20e2e34
--- /dev/null
@@ -0,0 +1,13 @@
+diff -urN poldek-0.21-cvs20070703.00.org/misc.c poldek-0.21-cvs20070703.00/misc.c
+--- poldek-0.21-cvs20070703.00.org/misc.c      2007-07-02 20:30:48.000000000 +0200
++++ poldek-0.21-cvs20070703.00/misc.c  2007-11-22 18:09:26.899099602 +0100
+@@ -526,6 +526,9 @@
+ {
+     if (strstr(path, "./") == NULL)
+         return NULL;
++
++    if (strncmp(path, ".", 1) == 0)
++      return get_current_dir_name();
+     
+ #ifdef HAVE_CANONICALIZE_FILE_NAME /* have safe GNU ext? */
+     return realpath(path, NULL);
diff --git a/poldek-fix-multilib.patch b/poldek-fix-multilib.patch
new file mode 100644 (file)
index 0000000..52fa124
--- /dev/null
@@ -0,0 +1,49 @@
+Index: install/install.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/install/install.c,v
+retrieving revision 1.6
+retrieving revision 1.7
+diff -u -r1.6 -r1.7
+--- install/install.c  17 Jun 2007 20:24:47 -0000      1.6
++++ install/install.c  18 Jun 2007 16:12:43 -0000      1.7
+@@ -11,7 +11,7 @@
+ */
+ /*
+-  $Id$
++  $Id$
+ */
+ #include <vfile/vfile.h>
+@@ -315,7 +315,8 @@
+ {
+     struct pkg *pkg, *pkg2;
+     int i, n, nmarked = 0;
+-    
++    int multilib = poldek_conf_MULTILIB; /* just for short */
++
+     if (n_array_size(pkgs) < 2)
+         return n_array_size(pkgs);
+     
+@@ -334,14 +335,16 @@
+         
+         if (i == n_array_size(pkgs))
+             break;
+-        
++
+         pkg2 = n_array_nth(pkgs, i);
+         while (pkg_cmp_name(pkg, pkg2) == 0) {
+-            pkg_unmark(pms, pkg2);
+-            DBGF("unmark %s\n", pkg_id(pkg2));
+-
++            if (!multilib || (multilib && pkg_cmp_arch(pkg, pkg2) == 0)) {
++                pkg_unmark(pms, pkg2);
++                DBGF("unmark %s\n", pkg_id(pkg2));
++                n++;
++            }
++            
+             i++;
+-            n++;
+             if (i == n_array_size(pkgs))
+                 break;
+             pkg2 = n_array_nth(pkgs, i);
diff --git a/poldek-ignorecaps.patch b/poldek-ignorecaps.patch
new file mode 100644 (file)
index 0000000..e00906f
--- /dev/null
@@ -0,0 +1,13 @@
+diff -urN poldek-0.20.org/pkgset-req.c poldek-0.20/pkgset-req.c
+--- poldek-0.20.org/pkgset-req.c       2005-10-20 19:27:27.000000000 +0200
++++ poldek-0.20/pkgset-req.c   2007-06-15 00:42:42.499942887 +0200
+@@ -332,6 +332,9 @@
+          n_assert(0);
+     */ 
+     
++    if (strncmp("cpuinfo(", capreq_name(req), sizeof("cpuinfo(")-1) == 0 || strncmp("uname(", capreq_name(req), sizeof("uname(")-1) == 0)
++      matched = 1;
++
+     if (capreq_is_rpmlib(req)) {
+         if (matched) {
+             int i;
diff --git a/poldek-install-dist.patch b/poldek-install-dist.patch
new file mode 100644 (file)
index 0000000..a460584
--- /dev/null
@@ -0,0 +1,11 @@
+--- poldek/install-dist.c~     2007-07-01 23:04:26.000000000 +0200
++++ poldek/install-dist.c      2007-09-23 15:45:51.812485873 +0200
+@@ -232,6 +232,8 @@
+     rc = 1;
++    pkgs = pkgmark_get_packages(ts->pms, PKGMARK_MARK | PKGMARK_DEP);
++
+     ignorer = ts->getop(ts, POLDEK_OP_NODEPS);
+     if (!packages_verify_dependecies(pkgs, ts->ctx->ps) && !ignorer)
+         nerr++;
diff --git a/poldek-multilib.patch b/poldek-multilib.patch
new file mode 100644 (file)
index 0000000..30684c6
--- /dev/null
@@ -0,0 +1,10 @@
+--- poldek-0.20/conf/poldek.conf~      2006-05-31 22:11:32.000000000 +0300
++++ poldek-0.20/conf/poldek.conf       2006-05-31 22:19:15.000000000 +0300
+@@ -9,6 +9,7 @@
+ # Both local and remote files may be included. Included files may not contain
+ # [global] section, it will be ignored anyway. 
+ %include %{_distro}-source.conf
++%include %{_distro}-multilib-source.conf
+ # local sources
+ %include source.conf
diff --git a/poldek-ndie_fix.patch b/poldek-ndie_fix.patch
new file mode 100644 (file)
index 0000000..6718063
--- /dev/null
@@ -0,0 +1,44 @@
+Index: install/install.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/install/install.c,v
+retrieving revision 1.10
+diff -u -r1.10 install.c
+--- install/install.c  1 Jul 2007 21:04:26 -0000       1.10
++++ install/install.c  4 Jul 2007 13:41:03 -0000
+@@ -327,6 +327,12 @@
+     return nmarked;
+ }
++static void ts_reset(struct poldek_ts *ts) 
++{
++    pkgmark_massset(ts->pms, 0, PKGMARK_MARK | PKGMARK_DEP);
++    n_hash_clean(ts->ts_summary);
++}
++
+ int in_do_poldek_ts_install(struct poldek_ts *ts)
+ {
+     int i, nmarked = 0, nerr = 0, n, is_particle;
+@@ -422,7 +428,7 @@
+             if (!do_install(&ictx))
+                 nerr++;
+-            pkgmark_massset(ts->pms, 0, PKGMARK_MARK | PKGMARK_DEP);
++            ts_reset(ictx.ts);
+             install_ctx_reset(&ictx);
+         }
+     }
+Index: log.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/log.c,v
+retrieving revision 1.32
+diff -u -r1.32 log.c
+--- log.c      2 Jul 2007 17:08:38 -0000       1.32
++++ log.c      4 Jul 2007 13:44:04 -0000
+@@ -173,7 +173,6 @@
+     /* auto line break for errors and warnings */
+     if (!last_endlined && !is_continuation && (pri & (LOGERR|LOGWARN))) {
+         buf[buf_len++] = '\n';
+-        n_assert(0);
+     }
+     
+     last_endlined = is_endlined;
diff --git a/poldek-nohold-fix.patch b/poldek-nohold-fix.patch
new file mode 100644 (file)
index 0000000..3cb1a79
--- /dev/null
@@ -0,0 +1,38 @@
+diff -urN poldek/cli/install.c poldek.new/cli/install.c
+--- poldek/cli/install.c       2007-07-01 23:04:26.000000000 +0200
++++ poldek.new/cli/install.c   2007-11-17 18:19:06.000000000 +0100
+@@ -174,6 +174,9 @@
+ {"hold", OPT_INST_HOLD, "PACKAGE[,PACKAGE]...", 0,
+  N_("Prevent packages listed from being upgraded if they are already installed."),
+      OPT_GID },
++
++{"nohold", OPT_INST_NOHOLD, 0, 0,
++ N_("Do not hold any packages. Disables --hold settings."), OPT_GID },
+                                                 
+ {"ignore", OPT_INST_IGNORE, "PACKAGE[,PACKAGE]...", 0,
+  N_("Make packages listed invisible."), OPT_GID },
+@@ -323,17 +326,21 @@
+             poldek_configure(ts->ctx, POLDEK_CONF_ROOTDIR, arg);
+             break;
+-
+         case OPT_INST_HOLD:
+             poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_HOLD, 1);
+             poldek_configure(ts->ctx, POLDEK_CONF_HOLD, arg);
+             break;
+-            
++        
++        case OPT_INST_NOHOLD:
++            ts->setop(ts, POLDEK_OP_HOLD, 0);
++            poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_HOLD, 0);
++            break;
++        
+         case OPT_INST_IGNORE:
+             poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_IGNORE, 1);
+             poldek_configure(ts->ctx, POLDEK_CONF_IGNORE, arg);
+             break;
+-
++      
+         case OPT_INST_NOIGNORE:
+             ts->setop(ts, POLDEK_OP_IGNORE, 0);
+             poldek_configure(ts->ctx, POLDEK_CONF_OPT, POLDEK_OP_IGNORE, 0);
diff --git a/poldek-nonoorder.patch b/poldek-nonoorder.patch
new file mode 100644 (file)
index 0000000..f2e7b42
--- /dev/null
@@ -0,0 +1,11 @@
+--- poldek-0.21-cvs20070703.00/pm/rpm/rpminstall.c~    2008-03-19 21:28:45.000000000 +0200
++++ poldek-0.21-cvs20070703.00/pm/rpm/rpminstall.c     2008-03-19 21:29:42.010639258 +0200
+@@ -374,8 +374,6 @@
+         argv[nargs++] = (char*)ts->rootdir;
+     }
+-    argv[nargs++] = "--noorder";    /* packages always ordered by me */
+-
+     if (ts->rpmacros) 
+         for (i=0; i<n_array_size(ts->rpmacros); i++) {
+             argv[nargs++] = "--define";
diff --git a/poldek-pkguinf-kill-assert.patch b/poldek-pkguinf-kill-assert.patch
new file mode 100644 (file)
index 0000000..f2b244a
--- /dev/null
@@ -0,0 +1,13 @@
+diff -urN poldek-0.30-cvs20080225.00/pkgu.c poldek-0.30-cvs20080225.00.new/pkgu.c
+--- poldek-0.30-cvs20080225.00/pkgu.c  2008-02-24 23:14:08.000000000 +0100
++++ poldek-0.30-cvs20080225.00.new/pkgu.c      2008-04-03 18:05:23.000000000 +0200
+@@ -493,9 +493,6 @@
+                 case PKGUINF_DISTRO:
+                     set_member(pkgu, &pkgu->distro, val, len);
+                     break;
+-
+-                default:
+-                    n_assert(0);
+             }
+         }
+     }
diff --git a/poldek-reversed-prompt.patch b/poldek-reversed-prompt.patch
new file mode 100644 (file)
index 0000000..ef93034
--- /dev/null
@@ -0,0 +1,12 @@
+diff -urN poldek-0.21-cvs20070703.00/pm/rpm/rpminstall.c poldek-0.21-cvs20070703.00.new/pm/rpm/rpminstall.c
+--- poldek-0.21-cvs20070703.00/pm/rpm/rpminstall.c     2007-07-01 23:04:27.000000000 +0200
++++ poldek-0.21-cvs20070703.00.new/pm/rpm/rpminstall.c 2008-02-20 21:34:24.000000000 +0100
+@@ -434,7 +434,7 @@
+         int can_ask = poldek_ts_is_interactive_on(ts);
+         if (nsignerr) {
+-            if (!can_ask || poldek__confirm(ts, 0,
++            if (!can_ask || !poldek__confirm(ts, 0,
+                                             _("There were signature verification errors. "
+                                               "Proceed?")))
+                 goto l_err_end;
diff --git a/poldek-suggests-one-package.patch b/poldek-suggests-one-package.patch
new file mode 100644 (file)
index 0000000..85f7164
--- /dev/null
@@ -0,0 +1,264 @@
+diff -urN poldek/ask.c poldek.new/ask.c
+--- poldek/ask.c       2007-07-08 18:48:11.000000000 +0200
++++ poldek.new/ask.c   2007-11-18 18:55:32.000000000 +0100
+@@ -87,6 +87,38 @@
+     return answer;
+ }
++static int term_sugs_confirm(void *foo, const struct poldek_ts *ts, int hint,
++                        const char *question) 
++{
++    const char *yn = "[Y/n/c]";
++    int a;
++
++    foo = foo;
++    ts = ts;
++    
++    if (!isatty(STDIN_FILENO))
++        return hint;
++
++    if (hint == 0) /* no */
++        yn = "[N/y/c]";
++
++    poldek_log(LOGINFO, "%s %s", question, yn);
++    
++    a = poldek_term_ask(STDIN_FILENO, "YyNnCc\n", NULL);
++    a = toupper(a);
++    switch(a) {
++        case 'Y': a = 1; break;
++        case 'N': a = 0; break;
++        case 'C': a = -1; break;
++        case '\n': a = hint; break;
++        default:
++            n_assert(0);
++    }
++    
++    msg(-1, "_\n");
++    return a;
++}
++
+ static int term_choose_pkg(void *foo, const struct poldek_ts *ts,
+                            const char *capname, tn_array *pkgs, int hint)
+ {
+@@ -152,6 +184,15 @@
+     return ts->ctx->ts_confirm_fn(ts->ctx->data_ts_confirm_fn, ts);
+ }
++int poldek__sugs_confirm(const struct poldek_ts *ts, int hint, const char *message)
++{
++    if (ts->ctx->sugs_confirm_fn == NULL)
++        return hint;
++
++    return ts->ctx->sugs_confirm_fn(ts->ctx->data_sugs_confirm_fn, ts, hint, message);
++}
++
++
+ int poldek__choose_equiv(const struct poldek_ts *ts,
+                          const char *capname, tn_array *pkgs, struct pkg *hint)
+ {
+@@ -181,6 +222,9 @@
+     ctx->data_ts_confirm_fn = NULL;
+     ctx->ts_confirm_fn = term_ts_confirm;
++    ctx->data_sugs_confirm_fn = NULL;
++    ctx->sugs_confirm_fn = term_sugs_confirm;
++
+     ctx->data_choose_equiv_fn = NULL;
+     ctx->choose_equiv_fn = term_choose_pkg;
+ }
+diff -urN poldek/install/requirements.c poldek.new/install/requirements.c
+--- poldek/install/requirements.c      2007-07-12 23:29:26.000000000 +0200
++++ poldek.new/install/requirements.c  2007-11-18 18:42:27.000000000 +0100
+@@ -244,46 +244,94 @@
+ }
+ /* just append sugs to reqs if user wants to */
+-static tn_array *process_suggets(struct pkg *pkg, struct poldek_ts *ts) 
++static tn_array *process_suggests(struct pkg *pkg, struct install_ctx *ictx) 
+ {
+     char *confirmation, message[2048];
+-    tn_array *reqs;
++    tn_array *reqs, *sugs;
+     tn_buf *nbuf;
+-    int n;
++    int i, j, n;
+     
+     reqs = pkg->reqs;
+     
+-    if (pkg->sugs == NULL || !in_is_user_choosable_equiv(ts))
++    if (pkg->sugs == NULL || !in_is_user_choosable_equiv(ictx->ts))
+         return reqs;
+     
+-    if (!ts->getop(ts, POLDEK_OP_SUGGESTS))
++    if (!ictx->ts->getop(ictx->ts, POLDEK_OP_SUGGESTS))
+         return reqs;
+     
+-    nbuf = capreq_arr_join(pkg->sugs, NULL, NULL);
+-
+-
++    /* Array sugs will contain packages which are suggested and not installed */
++    sugs = capreq_arr_new(n_array_size(pkg->sugs));
++    
++    for (i = 0; i < n_array_size(pkg->sugs); i++)
++    {
++      struct capreq *suggest = n_array_nth(pkg->sugs, i);
++      
++      /* Check if package is already installed */
++      if (!pkgdb_match_req(ictx->ts->db, suggest, ictx->strict, ictx->uninst_set->dbpkgs))
++      {
++          n_array_push(sugs, suggest);
++      }
++    }
++    
++    if (n_array_size(sugs) == 0)
++      return reqs;
++    
++    nbuf = capreq_arr_join(sugs, NULL, NULL);
+     n = n_snprintf(message, sizeof(message), _("%s suggests installation of: %s"),
+                    pkg_id(pkg), n_buf_ptr(nbuf));
+     n_buf_free(nbuf);
+     
+-    confirmation = ngettext("Try to install it?", "Try to install them?",
+-                            n_array_size(pkg->sugs));    
++    confirmation = ngettext("Try to install it?", "Try to install them?", n_array_size(sugs));
+     n_snprintf(&message[n], sizeof(message) - n, "\n%s", confirmation);
+     
+-    if (poldek__confirm(ts, 0, message)) {
+-        int i;
+-        
+-        reqs = capreq_arr_new(n_array_size(pkg->reqs) + n_array_size(pkg->sugs));
++    if (n_array_size(sugs) > 1)
++    {
++      int answer;
++      
++      answer = poldek__sugs_confirm(ictx->ts, 0, message);
++      
++      /* Install all suggested packages */
++      if (answer == 1)
++      {
++          reqs = capreq_arr_new(n_array_size(pkg->reqs) + n_array_size(sugs));
+             
+-        for (i=0; i < n_array_size(pkg->reqs); i++)
+-            n_array_push(reqs, n_array_nth(pkg->reqs, i));
++          for (i=0; i < n_array_size(pkg->reqs); i++)
++              n_array_push(reqs, n_array_nth(pkg->reqs, i));
++          for (i=0; i < n_array_size(sugs); i++)
++              n_array_push(reqs, n_array_nth(sugs, i));
++          
++          n_array_ctl_set_freefn(reqs, NULL); /* "weak" refs */
++          
++          return reqs;
++      }
++      /* Don't install  */
++      else if (answer == 0)
++          return reqs;
++    }
++    
++    for (j = 0; j < n_array_size(sugs); j++)
++    {
++      n = n_snprintf(message, sizeof(message), _("%s suggests installation of: %s"),
++                   pkg_id(pkg), capreq_snprintf_s(n_array_nth(sugs, j)));
+         
+-        for (i=0; i < n_array_size(pkg->sugs); i++)
+-            n_array_push(reqs, n_array_nth(pkg->sugs, i));
+-
+-        n_array_ctl_set_freefn(reqs, NULL); /* "weak" refs */
++        n_snprintf(&message[n], sizeof(message) - n, "\n%s", _("Try to install it?"));
++        
++        if (poldek__confirm(ictx->ts, 0, message))
++        {
++          tn_array *tmpreqs;
++          
++          tmpreqs = capreq_arr_new(n_array_size(reqs) + 1);
++          
++          for (i = 0; i < n_array_size(reqs); i++)
++              n_array_push(tmpreqs, n_array_nth(reqs, i));
++          
++          n_array_push(tmpreqs, n_array_nth(sugs, j));
++          
++          reqs = tmpreqs;
++          
++          n_array_ctl_set_freefn(reqs, NULL); /* "weak" refs */           
++        }
+     }
+-
+     return reqs;
+ }
+@@ -345,7 +393,7 @@
+     reqs = pkg->reqs;
+     if (process_as == PROCESS_AS_NEW)
+-        reqs = process_suggets(pkg, ictx->ts);
++        reqs = process_suggests(pkg, ictx);
+     
+     for (i=0; i < n_array_size(reqs); i++) {
+         struct capreq *req = n_array_nth(reqs, i);
+diff -urN poldek/lib_init.c poldek.new/lib_init.c
+--- poldek/lib_init.c  2007-07-09 20:31:14.000000000 +0200
++++ poldek.new/lib_init.c      2007-11-17 22:42:56.000000000 +0100
+@@ -1226,6 +1226,15 @@
+                 ctx->data_ts_confirm_fn = vv;
+             break;
++      case POLDEK_CONF_SUGSCONFIRM_CB:
++            if ((vv = va_arg(ap, void*)))
++                ctx->sugs_confirm_fn = vv;
++            
++            if ((vv = va_arg(ap, void*)))
++                ctx->data_sugs_confirm_fn = vv;
++
++            break;
++
+         case POLDEK_CONF_CHOOSEEQUIV_CB:
+             if ((vv = va_arg(ap, void*)))
+                 ctx->choose_equiv_fn = vv;
+diff -urN poldek/poldek.h poldek.new/poldek.h
+--- poldek/poldek.h    2007-07-01 23:04:26.000000000 +0200
++++ poldek.new/poldek.h        2007-11-17 21:33:31.000000000 +0100
+@@ -53,7 +53,8 @@
+ #define POLDEK_CONF_GOODBYE_CB      22
+ #define POLDEK_CONF_CONFIRM_CB      23
+ #define POLDEK_CONF_TSCONFIRM_CB    24
+-#define POLDEK_CONF_CHOOSEEQUIV_CB  25
++#define POLDEK_CONF_SUGSCONFIRM_CB  25
++#define POLDEK_CONF_CHOOSEEQUIV_CB  26
+ int poldek_configure(struct poldek_ctx *ctx, int param, ...);
+diff -urN poldek/poldek_intern.h poldek.new/poldek_intern.h
+--- poldek/poldek_intern.h     2007-07-08 18:59:15.000000000 +0200
++++ poldek.new/poldek_intern.h 2007-11-17 22:47:39.000000000 +0100
+@@ -38,6 +38,10 @@
+     void *data_ts_confirm_fn;
+     int  (*ts_confirm_fn)(void *data, const struct poldek_ts *ts); /* confirm transaction */
++    void *data_sugs_confirm_fn;
++    int  (*sugs_confirm_fn)(void *data, const struct poldek_ts *ts, int hint,
++                       const char *message); /* confirm suggests */
++
+     void *data_choose_equiv_fn;
+     int  (*choose_equiv_fn)(void *data, const struct poldek_ts *ts,
+                             const char *cap, tn_array *pkgs, int hint);
+@@ -74,6 +78,10 @@
+ int poldek__ts_confirm(const struct poldek_ts *ts);
++int poldek__sugs_confirm(const struct poldek_ts *ts,
++                    int default_answer, const char *message);
++
++
+ int poldek__choose_equiv(const struct poldek_ts *ts,
+                          const char *capname, tn_array *pkgs, struct pkg *hint);
+diff -urN poldek/poldek_ts.c poldek.new/poldek_ts.c
+--- poldek/poldek_ts.c 2007-07-11 00:56:17.000000000 +0200
++++ poldek.new/poldek_ts.c     2007-11-17 22:56:19.000000000 +0100
+@@ -54,6 +54,7 @@
+ extern int poldek_term_confirm(int default_answer, const char *msg);
+ extern int poldek_term_ts_confirm(const struct poldek_ts *ts);
++extern int poldek_term_sugs_confirm(int default_answer, const char *msg);
+ extern int poldek_term_choose_pkg(const char *capname, tn_array *pkgs,
+                                   struct pkg *hint);
diff --git a/poldek-uninstall-greedy-fix.patch b/poldek-uninstall-greedy-fix.patch
new file mode 100644 (file)
index 0000000..a7ceae1
--- /dev/null
@@ -0,0 +1,76 @@
+Index: uninstall.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/uninstall.c,v
+retrieving revision 1.47
+retrieving revision 1.48
+diff -u -r1.47 -r1.48
+--- uninstall.c        2 Feb 2008 21:49:04 -0000       1.47
++++ uninstall.c        2 Mar 2008 20:05:56 -0000       1.48
+@@ -11,7 +11,7 @@
+ */
+ /*
+-  $Id$
++  $Id$
+ */
+ #include <errno.h>
+@@ -122,17 +122,22 @@
+ static int pkg_leave_orphans(struct uninstall_ctx *uctx, struct pkg *pkg)
+ {
+     struct capreq *selfcap;
++    tn_array *exclude;
+     int i;
+     
++    exclude = n_array_dup(uctx->unpkgs, (tn_fn_dup)pkg_link);
++    /* yep, there are packages which requires themselves */
++    n_array_push(exclude, pkg_link(pkg)); 
++    
+     capreq_new_name_a(pkg->name, selfcap);
+-    if (pkgdb_q_is_required(uctx->db, selfcap, uctx->unpkgs))
+-        return 1;
++    if (pkgdb_q_is_required(uctx->db, selfcap, exclude))
++        goto l_yes;
+     if (pkg->caps)
+         for (i=0; i < n_array_size(pkg->caps); i++) {
+             struct capreq *cap = n_array_nth(pkg->caps, i);
+-            if (pkgdb_q_is_required(uctx->db, cap, uctx->unpkgs))
+-                return 1;
++            if (pkgdb_q_is_required(uctx->db, cap, exclude))
++                goto l_yes;
+         }
+     
+     if (pkg->fl) {
+@@ -143,13 +148,20 @@
+         while ((path = pkgfl_it_get(&it, NULL))) {
+             struct capreq *cap;
+             capreq_new_name_a(path, cap);
+-            if (pkgdb_q_is_required(uctx->db, cap, uctx->unpkgs))
+-                return 1;
++            if (pkgdb_q_is_required(uctx->db, cap, exclude))
++                goto l_yes;
+         }
+     }
++
+     
++    n_array_free(exclude);
+     return 0;
++    
++l_yes:
++    n_array_free(exclude);
++    return 1;
+ }
++        
+ /*
+@@ -194,6 +206,8 @@
+             pkg_set_mf(uctx->pms, dbpkg, DBPKG_REV_ORPHANED);
+             pkg_dep_mark(uctx->ts->pms, dbpkg);
+             n_array_push(uctx->unpkgs, pkg_link(dbpkg));
++            uctx->ndep++;
++            
+             if (uctx->rev_orphans_deep > deep)
+                 process_pkg_rev_orphans(indent + 2, uctx, dbpkg, deep + 1);
+         }
diff --git a/poldek-uninstall-multilib.patch b/poldek-uninstall-multilib.patch
new file mode 100644 (file)
index 0000000..9e43887
--- /dev/null
@@ -0,0 +1,283 @@
+Index: arg_packages.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/arg_packages.c,v
+retrieving revision 1.24
+retrieving revision 1.25
+diff -u -r1.24 -r1.25
+--- arg_packages.c     7 Jan 2006 01:13:20 -0000       1.24
++++ arg_packages.c     2 Apr 2006 19:10:36 -0000       1.25
+@@ -42,6 +42,8 @@
+ #include "pkgset.h"
+ #include "pm/pm.h"
++extern int poldek_conf_MULTILIB;
++
+ #define ARG_PACKAGES_SETUPDONE    (1 << 0)
+ /* @VIRTUAL [DEFAULT_MASK [EVR]] */
+@@ -227,36 +229,6 @@
+ //        n_hash_size(aps->resolved_caps);
+ }
+-#if 0  /* XXX: disabled, #5702  */
+-/* tries to convert N-[E:]V-R to N#[E:]V-R */
+-static char *mask2evrhashedmask(const char *mask) 
+-{
+-    const char *name, *ver, *rel, *p;
+-    char nmask[1024], e[32] = "", *tmp;
+-    int32_t epoch = 0;
+-    int n;
+-    
+-    n_strdupap(mask, &tmp);
+-    if (!poldek_util_parse_nevr(tmp, &name, &epoch, &ver, &rel))
+-        return NULL;
+-    
+-    p = ver;          /* check if it is really version */
+-    while (*p) {
+-        if (isdigit(*p))
+-            break;
+-        p++;
+-    }
+-    
+-    if (*p == '\0')    /* no digits => part of name propably */
+-        return NULL;
+-            
+-    if (epoch)
+-        snprintf(e, sizeof(e), "%d:", epoch);
+-    n = n_snprintf(nmask, sizeof(nmask), "%s#%s%s-%s", name, e, ver, rel);
+-    return n_strdupl(nmask, n);
+-}
+-#endif
+-
+ tn_array *arg_packages_get_masks(struct arg_packages *aps, int hashed)
+ {
+     tn_array *masks;
+@@ -264,19 +236,11 @@
+     masks = n_array_clone(aps->package_masks);
+     for (i=0; i < n_array_size(aps->package_masks); i++) {
+-        const char *mask;
+-
+-        mask = n_array_nth(aps->package_masks, i);
+-        if (hashed && strchr(mask, '-') && strchr(mask, '*') == NULL) {
+-#if 0  /* XXX: disabled so smart NEVR parsing, #5702  */
+-            char *nmask;
+-            if ((nmask = mask2evrhashedmask(mask)))
+-                mask = nmask;
+-#endif            
+-        }
++        const char *mask = n_array_nth(aps->package_masks, i);
+         n_array_push(masks, n_strdup(mask));
+     }
+-    
++
++    hashed = 0;                 /* disabled for a while */
+     for (i=0; i < n_array_size(aps->packages); i++) {
+         struct pkg *pkg = n_array_nth(aps->packages, i);
+         char mask[1024], e[32] = "";
+@@ -284,9 +248,13 @@
+         
+         if (pkg->epoch)
+             snprintf(e, sizeof(e), "%d:", pkg->epoch);
+-        
++
+         n = n_snprintf(mask, sizeof(mask), "%s%s%s%s-%s", pkg->name,
+-                   hashed ? "#" : "-", e, pkg->ver, pkg->rel);
++                       hashed ? "#" : "-", e, pkg->ver, pkg->rel);
++
++        if (0 && poldek_conf_MULTILIB && pkg_arch(pkg))
++            n += n_snprintf(&mask[n], sizeof(mask) - n, ".%s", pkg_arch(pkg));
++        
+         n_array_push(masks, n_strdupl(mask, n));
+     }
+                    
+Index: uninstall.c
+===================================================================
+RCS file: /cvsroot/poldek/poldek/uninstall.c,v
+retrieving revision 1.39
+retrieving revision 1.40
+diff -u -r1.39 -r1.40
+--- uninstall.c        18 Mar 2006 17:03:48 -0000      1.39
++++ uninstall.c        2 Apr 2006 19:10:36 -0000       1.40
+@@ -227,6 +227,7 @@
+     MEMINF("START");
+     DBGF("%s\n", pkg_id(pkg));
++    msg_i(3, indent, "%s\n", pkg_id(pkg));
+     for (i=0; i < n_array_size(pkg->reqs); i++) {
+         struct capreq *req = n_array_nth(pkg->reqs, i);
+         
+@@ -235,7 +236,7 @@
+         DBGF("req %s\n", capreq_snprintf_s(req));
+-        if (pkg_satisfies_req(pkg, req, 1)) { /* self match, should be handled
++        if (pkg_satisfies_req(pkg, req, 1)) { /* XXX: self match, should be handled
+                                                  at lower level; TOFIX */
+             DBGF("%s: satisfied by itself\n", capreq_snprintf_s(req));
+@@ -243,7 +244,7 @@
+                                    uctx->uninst_set->dbpkgs)) {
+             DBGF("%s: satisfied by db\n", capreq_snprintf_s(req));
+-            msg_i(3, indent, "%s: satisfied by db\n", capreq_snprintf_s(req));
++            msg_i(3, indent, "  %s: satisfied by db\n", capreq_snprintf_s(req));
+             
+         } else if (!uctx->ts->getop(uctx->ts, POLDEK_OP_FOLLOW)) {
+             logn(LOGERR, _("%s (cap %s) is required by %s"),
+@@ -402,7 +403,8 @@
+ static
+ int do_resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
+-                 const char *mask, const struct capreq *cr)
++                       const char *mask, const struct capreq *cr,
++                       const char *arch)
+ {
+     tn_array *dbpkgs;
+     int i, nmatches = 0;
+@@ -446,6 +448,12 @@
+                     pkg_evr_match_req(dbpkg, cr, POLDEK_MA_PROMOTE_REQEPOCH))
+                     matched = 1;
+             }
++            
++            if (matched && arch) {
++                const char *dbarch = pkg_arch(dbpkg);
++                matched = n_str_eq(arch, dbarch ? dbarch : "none");
++            }
++            
+         }
+         if (matched) {
+@@ -459,7 +467,7 @@
+ }
+ static int resolve_package(struct uninstall_ctx *uctx, struct poldek_ts *ts,
+-                           const char *mask)
++                           const char *mask, const char *arch)
+ {
+     char           *p;
+     struct capreq  *cr, *cr_evr;
+@@ -491,7 +499,7 @@
+         }
+     }
+     
+-    if (do_resolve_package(uctx, ts, mask, cr))
++    if (do_resolve_package(uctx, ts, mask, cr, arch))
+         resolved = 1;
+     if (cr_evr)
+@@ -500,6 +508,58 @@
+     return resolved;
+ }
++static int resolve_mask(struct uninstall_ctx *uctx, struct poldek_ts *ts,
++                        const char *mask)
++{
++    char *p, *tmp;
++    const char *n, *v, *r;
++    char nmask[256];
++    int32_t e = 0;
++    int matched = 0;
++    
++    msgn(2, "Trying %s\n", mask);
++    if (resolve_package(uctx, ts, mask, NULL))
++        return 1;
++            
++    if ((p = strchr(mask, '-')) == NULL) /* try N-[E:]V */
++        return 0;
++
++    /* try N-[E:]V-R */
++    n_strdupap(mask, &tmp);
++    p = strrchr(tmp, '-');
++    *p = '#';
++        
++    msgn(2, "  Trying %s\n", tmp);
++                
++    if (resolve_package(uctx, ts, tmp, NULL))
++        return 1;
++    
++    n_strdupap(mask, &tmp);
++    if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
++        if (e)
++            n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
++        else
++            n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
++
++        msgn(2, "    Trying %s\n", nmask);
++        DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
++        matched = resolve_package(uctx, ts, nmask, NULL);
++        
++        if (!matched && (p = strchr(r, '.'))) { /* try N-[E:]-V-R.ARCH */
++            *p = '\0';
++            p++;
++            
++            if (e)
++                n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
++            else
++                n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
++            msgn(2, "      Trying %s (arch=%s)\n", nmask, p);
++            matched = resolve_package(uctx, ts, nmask, p);
++        }
++    }
++
++    return matched;
++}
+ static int resolve_packages(struct uninstall_ctx *uctx, struct poldek_ts *ts)
+ {
+@@ -509,51 +569,11 @@
+     masks = poldek_ts_get_args_asmasks(ts, 1);
+     
+     for (i=0; i < n_array_size(masks); i++) {
+-        char            *mask = n_array_nth(masks, i);
+-        int             matched = 0;
+-
+-        msgn(2, "Trying %s\n", mask);
+-        if (resolve_package(uctx, ts, mask)) {
+-            matched = 1;
+-            
+-        } else {
+-            char *p;
+-            
+-            if ((p = strchr(mask, '-'))) { /* try N-[E:]V */
+-                char *tmp;
+-                n_strdupap(mask, &tmp);
+-                
+-                p = strrchr(tmp, '-');
+-                *p = '#';
++        char *mask = n_array_nth(masks, i);
+-                msgn(2, "  Trying %s\n", tmp);
+-                
+-                if (resolve_package(uctx, ts, tmp)) {
+-                    matched = 1;
+-                    
+-                } else {        /* try N-[E:]V-R */
+-                    const char *n, *v, *r;
+-                    char nmask[256];
+-                    int32_t e = 0;
+-
+-                    n_strdupap(mask, &tmp);
+-                    if (poldek_util_parse_nevr(tmp, &n, &e, &v, &r)) {
+-                        if (e)
+-                            n_snprintf(nmask, sizeof(nmask), "%s#%d:%s-%s", n, e, v, r);
+-                        else
+-                            n_snprintf(nmask, sizeof(nmask), "%s#%s-%s", n, v, r);
+-
+-                        msgn(2, "    Trying %s\n", nmask);
+-                        DBGF("try %s => %s (%s, %s, %s)\n", mask, nmask, n, v, r);
+-                        matched = resolve_package(uctx, ts, nmask);
+-                    }
+-                }
+-            }
+-            
+-            if (!matched) {
+-                logn(LOGERR, _("%s: no such package"), mask);
+-                nerr++;
+-            }
++        if (!resolve_mask(uctx, ts, mask)) {
++            logn(LOGERR, _("%s: no such package"), mask);
++            nerr++;
+         }
+     }
+     
diff --git a/poldek-uri-escape-fix.patch b/poldek-uri-escape-fix.patch
new file mode 100644 (file)
index 0000000..52b9da5
--- /dev/null
@@ -0,0 +1,19 @@
+--- vfile/vfff/http.c.orig     2007-07-16 22:05:47.000000000 +0200
++++ vfile/vfff/http.c  2007-07-16 22:06:10.000000000 +0200
+@@ -123,16 +123,8 @@
+ static char *make_req_line(char *buf, int size, const char *method, const char *uri) 
+ {
+-    char *escaped = NULL;
+-    
+-    if ((escaped = vfff_uri_escape(uri)))
+-        uri = escaped;
+-    
+     n_snprintf(buf, size, "%s %s HTTP/1.1\r\n", method, uri);
+-    if (escaped)
+-        free(escaped);
+-    
+     return buf;
+ }
diff --git a/poldek-vserver-packages.patch b/poldek-vserver-packages.patch
new file mode 100644 (file)
index 0000000..ad0040c
--- /dev/null
@@ -0,0 +1,11 @@
+--- poldek/conf/poldek.conf~   2008-02-26 17:10:23.000000000 +0100
++++ poldek/conf/poldek.conf    2008-02-26 17:11:24.789742706 +0100
+@@ -138,7 +138,7 @@
+ # Ignore package list - packages fits given mask will be invisible.
+ # ignore = *-smp-* foo*
+-# ignore = vserver-packages
++ignore = vserver-packages
+ #ignore = 
+ # Conflicts with already installed packages are treated as resolved 
diff --git a/poldek.png b/poldek.png
new file mode 100644 (file)
index 0000000..ec4ead6
Binary files /dev/null and b/poldek.png differ
This page took 0.184565 seconds and 4 git commands to generate.