ADD_EXECUTABLE( helix2solv ${helix2solv_REPOS} )
TARGET_LINK_LIBRARIES( helix2solv satsolver ${EXPAT_LIBRARY})
-SET(susetags2solv_REPOS susetags2solv.c repo_susetags.h repo_susetags.c repo_write.c common_write.c)
+SET(susetags2solv_REPOS susetags2solv.c repo_susetags.h repo_susetags.c repo_content.c repo_write.c common_write.c)
ADD_EXECUTABLE( susetags2solv ${susetags2solv_REPOS} )
TARGET_LINK_LIBRARIES( susetags2solv satsolver)
TARGET_LINK_LIBRARIES( patchxml2solv satsolver ${EXPAT_LIBRARY})
-SET(content2solv_REPOS
- content2solv.c
- repo_content.h
- repo_content.c
- repo_write.c common_write.c)
-ADD_EXECUTABLE( content2solv ${content2solv_REPOS} )
-TARGET_LINK_LIBRARIES( content2solv satsolver)
-
-
SET(dumpsolv_REPOS dumpsolv.c)
ADD_EXECUTABLE( dumpsolv ${dumpsolv_REPOS} )
TARGET_LINK_LIBRARIES( dumpsolv satsolver)
helix2solv
rpmmd2solv
rpmdb2solv
- content2solv
DESTINATION ${BIN_INSTALL_DIR} )
install(PROGRAMS repo2solv.sh DESTINATION ${BIN_INSTALL_DIR} )
+++ /dev/null
-/*
- * Copyright (c) 2007, Novell Inc.
- *
- * This program is licensed under the BSD license, read LICENSE.BSD
- * for further information
- */
-
-#include <sys/types.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "pool.h"
-#include "repo.h"
-#include "repo_content.h"
-#include "common_write.h"
-
-int
-main(int argc, char **argv)
-{
- Pool *pool = pool_create();
- Repo *repo = repo_create(pool, "<stdin>");
- repo_add_content(repo, stdin);
- tool_write(repo, 0, 0);
- pool_free(pool);
- return 0;
-}
elif test -d suse/setup/descr && test -s content; then
olddir=`pwd`
cd suse/setup/descr || exit 2
- filepack=`mktemp` || exit 3
- filecont=`mktemp` || exit 3
(
# First packages
if test -s packages.gz; then
esac
done
fi
- ) | susetags2solv -a > $filepack
+ ) | susetags2solv -a -c "${olddir}/content"
cd "$olddir"
- content2solv < content > $filecont
- mergesolv $filecont $filepack
- rm -f $filepack $filecont
fi
#include "pool.h"
#include "repo.h"
-#if 0
-#include "attr_store.h"
-#endif
#include "tools_util.h"
#include "repo_susetags.h"
return repo_addid_dep(pd->repo, olddeps, id, marker);
}
-#if 0
-Attrstore *attr;
-#endif
-
/*
* add_location
*
if (pd->dirs[i][1] || pd->dirs[i][2])
{
repodata_add_dirnumnum(pd->data, entry, id_diskusage, pd->dirs[i][0], pd->dirs[i][1], pd->dirs[i][2]);
-#if 0
- add_attr_intlist_int (attr, entry, id_diskusage, pd->dirs[i][0]);
- add_attr_intlist_int (attr, entry, id_diskusage, pd->dirs[i][1]);
- add_attr_intlist_int (attr, entry, id_diskusage, pd->dirs[i][2]);
-#endif
}
pd->ndirs = 0;
}
struct parsedata pd;
Repodata *data = 0;
-#if 1
if (with_attr)
{
-#if 0
- attr = new_store(pool);
-#endif
data = repo_add_repodata(repo);
init_attr_ids(pool);
}
-#endif
memset(&pd, 0, sizeof(pd));
line = malloc(1024);
#include "pool.h"
#include "repo.h"
#include "repo_susetags.h"
+#include "repo_content.h"
#include "common_write.h"
int
{
int with_attr = 0;
int test_separate = 0;
+ const char *contentfile = 0;
+ Id vendor = 0;
argv++;
argc--;
while (argc--)
{
case 'a': with_attr = 1; break;
case 's': test_separate = 1; break;
+ case 'c':
+ if (argc)
+ {
+ contentfile = argv[1];
+ argv++;
+ argc--;
+ }
+ break;
default : break;
}
argv++;
}
Pool *pool = pool_create();
Repo *repo = repo_create(pool, "<stdin>");
- repo_add_susetags(repo, stdin, 0, with_attr);
+ if (contentfile)
+ {
+ FILE *fp = fopen (contentfile, "r");
+ if (!fp)
+ {
+ perror("opening content file");
+ exit (1);
+ }
+ repo_add_content(repo, fp);
+ if (!strncmp (id2str(pool, pool->solvables[repo->start].name), "product:", 8))
+ vendor = pool->solvables[repo->start].vendor;
+ fclose (fp);
+ }
+ repo_add_susetags(repo, stdin, vendor, with_attr);
tool_write(repo, 0, with_attr && test_separate);
pool_free(pool);
exit(0);