+# Parse options
+for opt; do
+ case "$opt" in
+ "--debug")
+ DEBUG=1
+ ;;
+ "--dry-run")
+ DRY_RUN=1
+ ;;
+ "--no-index")
+ GEN_IDX=0
+ ;;
+ "-*")
+ usage
+ ;;
+ "")
+ echo "Empty parameter" >&2
+ echo "" >&2
+ usage
+ ;;
+ *)
+ if [ -z "$dists_parent_dir" ]; then
+ # Removing trailing /
+ dists_parent_dir=${opt%/}
+ elif [ -z "$PACKAGES_LISTS_DIR" ]; then
+ PACKAGES_LISTS_DIR=$opt
+ else
+ echo "$0: Invalid option: $opt" >&2
+ usage
+ fi
+ ;;
+ esac
+done
+PACKAGES_LISTS_DIR=${opt:-.}
+
+if [ ! -d "$dists_parent_dir" ]; then
+ echo "missing dists_parent_dir, or not a directory" >&2
+ echo "" >&2
+ usage
+elif [ ! -d "$PACKAGES_LISTS_DIR" ]; then
+ echo "missing packages_lists_directory, or not a directory" >&2
+ echo "" >&2