# Metadata-Generator
This script scans a repo and generates the appstream catalogue.

## Usage


Due to the unstable api of appstream this script works against a chrooted environment that must have the apps and versions showed above:

- appstreeam=0.10.6-1~ubuntu16.04.2+lliurex1

- appstram-generator=0.6.6 compiled from lliurex's svn (xenial/devtools/appstream-generator)

If we've a chroot with the right versions and a repo accesible on the machine it's as simple as:

./metadata-generator.sh -suite suite --chroot /path/to/chroot --repo /path/to/repo

suite -> Suite to process (xenial, bionic...)
chroot -> path to the chroot
repo -> path to the repo
 
If we don't define any argument the shell will work with the default values defined in the shell's own code.

When executed the shell will:

1. Check if the asgen-config.json exists at the repo's basedir

2. Copy the mtab of the host machine to the chroot

3. Mount proc, sys, dev and dev/pts on the chroot

4. Mount (bind) the repo on the chroot

5. Enter the chroot
	* Clean the appstream database
	* Remove all processed packages
	* Process the whole suite

6. Exit the chroot and unmount all the mounts of the chroot


When finished there'll be an "export" folder at the repo's basedir wich will contain:

* a data folder with the generated metadata

* a media folder with the generated media (icons)

* a hints folder with the detected errors and warnings in json format

* a html folder. At this folder there's an "index.html" with the result of the process.

