TARGET_LINK_LIBRARIES (patchcheck libsolvext libsolv ${SYSTEM_LIBRARIES})
ENDIF (SUSE)
+IF (ENABLE_APPDATA)
+ADD_EXECUTABLE (appdata2solv appdata2solv.c)
+TARGET_LINK_LIBRARIES (appdata2solv toolstuff libsolvext libsolv ${SYSTEM_LIBRARIES})
+
+SET (tools_list ${tools_list} appdata2solv)
+ENDIF (ENABLE_APPDATA)
+
ADD_EXECUTABLE (dumpsolv dumpsolv.c )
TARGET_LINK_LIBRARIES (dumpsolv libsolv)
#include "pool.h"
#include "repo_solv.h"
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
#include "common_write.h"
static void
Repo *repo;
const char *basefile = 0;
int with_attr = 0;
+#ifdef SUSE
+ int add_auto = 0;
+#endif
int c;
pool = pool_create();
repo = repo_create(pool, "<mergesolv>");
- while ((c = getopt(argc, argv, "ahb:")) >= 0)
+ while ((c = getopt(argc, argv, "ahb:X")) >= 0)
{
switch (c)
{
case 'b':
basefile = optarg;
break;
+ case 'X':
+#ifdef SUSE
+ add_auto = 1;
+#endif
+ break;
default:
+ usage();
exit(1);
}
}
}
fclose(fp);
}
+#ifdef SUSE
+ if (add_auto)
+ repo_add_autopattern(repo, 0);
+#endif
tool_write(repo, basefile, 0);
pool_free(pool);
return 0;
esac
}
+susetags_findfile() {
+ if test -s "$1.xz" ; then
+ echo "$1.xz"
+ elif test -s "$1.lzma" ; then
+ echo "$1.lzma"
+ elif test -s "$1.bz2" ; then
+ echo "$1.bz2"
+ elif test -s "$1.gz" ; then
+ echo "$1.gz"
+ fi
+}
+
susetags_findfile_cat() {
if test -s "$1.xz" ; then
xz -dc "$1.xz"
findopt="-prune"
repotype=
+addautooption=
while true ; do
if test "$1" = "-o" ; then
findopt=
repotype=plaindir
shift
+ elif test "$1" = "-X" ; then
+ addautooption=-X
+ shift
else
break
fi
repomd_decompress "$deltainfoxml" | deltainfoxml2solv $parser_options > $deltainfofile || exit 4
fi
+ # This contains appdata
+ appdatafile=
+ appdataxml=`repomd_findfile appdata appdata.xml`
+ if test -n "$appdataxml" -a -s "$appdataxml" ; then
+ appdatafile=`mktemp` || exit 3
+ repomd_decompress "$appdataxml" | appdata2solv $parser_options > $appdatafile || exit 4
+ fi
+
# Now merge primary, patches, updateinfo, and deltainfo
- mergesolv $repomdfile $suseinfofile $primfile $prodfile $patternfile $updateinfofile $deltainfofile
- rm -f $repomdfile $suseinfofile $primfile $patternfile $prodfile $updateinfofile $deltainfofile
+ mergesolv $addautooption $repomdfile $suseinfofile $primfile $prodfile $patternfile $updateinfofile $deltainfofile $appdatafile
+ rm -f $repomdfile $suseinfofile $primfile $patternfile $prodfile $updateinfofile $deltainfofile $appdatafile
elif test "$repotype" = susetags ; then
olddir=`pwd`
DESCR=$(get_DESCRDIR)
cd ${DESCR} || exit 2
+ appdatafile=
+ appdataxml=`susetags_findfile appdata.xml`
+ if test -n "$appdataxml" ; then
+ appdatafile=`mktemp` || exit 3
+ repomd_decompress "$appdataxml" | appdata2solv $parser_options > $appdatafile || exit 4
+ parser_options="-M $appdatafile $parser_options"
+ fi
(
# First packages
susetags_findfile_cat packages
esac
done
- ) | susetags2solv -c "${olddir}/content" $parser_options || exit 4
+ ) | susetags2solv $addautooption -c "${olddir}/content" $parser_options || exit 4
+ test -n "$appdatafile" && rm -f "$appdatafile"
cd "$olddir"
elif test "$repotype" = plaindir ; then
- find * -name .\* -prune -o $findopt -name \*.delta.rpm -o -name \*.patch.rpm -o -name \*.rpm -a -type f -print0 | rpms2solv -0 -m -
+ find * -name .\* -prune -o $findopt -name \*.delta.rpm -o -name \*.patch.rpm -o -name \*.rpm -a -type f -print0 | rpms2solv $addautooption -0 -m -
else
echo "unknown repository type '$repotype'" >&2
exit 1
#include "repo_products.h"
#include "repo_solv.h"
#include "common_write.h"
+#ifdef ENABLE_APPDATA
+#include "repo_appdata.h"
+#endif
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
+
static void
usage(int status)
#ifdef ENABLE_PUBKEY
int pubkeys = 0;
#endif
+#ifdef ENABLE_APPDATA
+ int add_appdata = 0;
+#endif
+#ifdef SUSE
+ int add_auto = 0;
+#endif
/*
* parse arguments
*/
- while ((c = getopt(argc, argv, "Phnkxb:r:p:o:")) >= 0)
+ while ((c = getopt(argc, argv, "APhnkxXb:r:p:o:")) >= 0)
switch (c)
{
case 'h':
#endif
break;
case 'x':
- break;
+ break; /* extrapool no longer supported */
+ case 'X':
+#ifdef SUSE
+ add_auto = 1;
+#endif
+ break;
+ case 'A':
+#ifdef ENABLE_APPDATA
+ add_appdata = 1;
+#endif
+ break;
case 'o':
outfile = optarg;
break;
}
}
#endif
+
+#ifdef ENABLE_APPDATA
+ if (add_appdata)
+ repo_add_appdata_dir(repo, "/usr/share/appdata", REPO_USE_ROOTDIR | REPO_REUSE_REPODATA | REPO_NO_INTERNALIZE);
+#endif
repodata_internalize(data);
if (reffp)
fclose(reffp);
+#ifdef SUSE
+ if (add_auto)
+ repo_add_autopattern(repo, 0);
+#endif
+
tool_write(repo, basefile, 0);
pool_free(pool);
exit(0);
#include "solv_xfopen.h"
#endif
#include "repo_solv.h"
+#ifdef SUSE
+#include "repo_autopattern.h"
+#endif
#include "common_write.h"
static char *
#ifdef ENABLE_PUBKEY
int pubkeys = 0;
#endif
+#ifdef SUSE
+ int add_auto = 0;
+#endif
- while ((c = getopt(argc, argv, "0kKb:m:")) >= 0)
+ while ((c = getopt(argc, argv, "0XkKb:m:")) >= 0)
{
switch(c)
{
pubkeys = 2;
break;
#endif
+ case 'X':
+#ifdef SUSE
+ add_auto = 1;
+#endif
+ break;
default:
exit(1);
}
}
}
repo_internalize(repo);
+#ifdef SUSE
+ if (add_auto)
+ repo_add_autopattern(repo, 0);
+#endif
tool_write(repo, basefile, 0);
pool_free(pool);
for (c = 0; c < nrpms; c++)
#include "pool.h"
#include "repo.h"
+#include "repo_solv.h"
#include "repo_susetags.h"
#include "repo_content.h"
#include "common_write.h"
const char *descrdir = 0;
const char *basefile = 0;
const char *query = 0;
+ const char *mergefile = 0;
Id defvendor = 0;
int flags = 0;
int c;
Pool *pool;
Repo *repo;
- while ((c = getopt(argc, argv, "hn:c:d:b:q:")) >= 0)
+ while ((c = getopt(argc, argv, "hn:c:d:b:q:M:")) >= 0)
{
switch (c)
{
case 'q':
query = optarg;
break;
+ case 'M':
+ mergefile = optarg;
+ break;
default:
usage(1);
break;
}
}
repo_internalize(repo);
+ if (mergefile)
+ {
+ FILE *fp = fopen(mergefile, "r");
+ if (!fp)
+ {
+ perror(mergefile);
+ exit(1);
+ }
+ if (repo_add_solv(repo, fp, 0))
+ {
+ fprintf(stderr, "susetags2solv: %s\n", pool_errstr(pool));
+ exit(1);
+ }
+ fclose(fp);
+ }
if (query)
doquery(pool, repo, query);