#!/bin/bash

USER=ystk
OUTPUTFILE="src-jessie_meta-debian_all.txt"

function abort
{
	echo "ERROR: $@" 1>&2
	exit 1
}

# Get the last page number.
LASTPAGE=`curl -I "https://api.github.com/users/"$USER"/repos?per_page=100" 2> /dev/null \
			| grep "rel=\"last\"" | cut -d";" -f2 | cut -d"=" -f4 | cut -d">" -f1`
[ -z $LASTPAGE ] && abort "Cannot get the last page number from github."
LASTPAGE=`expr $LASTPAGE + 1`

if [ -f $OUTPUTFILE ]; then
	rm $OUTPUTFILE
fi

# Get all name of "debian-*" repository and write output files.
for ((i=1; i<$LASTPAGE; i++));
do
	curl "https://api.github.com/users/"$USER"/repos?page="$i"&per_page=100" 2> /dev/null \
		| jq '[.[] .name]' | grep "\"debian-" | cut -d"\"" -f2 >> $OUTPUTFILE;
done
sed -e 's/^/ystk\//g' -i $OUTPUTFILE
echo "meta-debian/linux-ltsi" >> $OUTPUTFILE

#!/bin/bash

USER=ystk
OUTPUTFILE="src-jessie_meta-debian_all.txt"

function abort
{
	echo "ERROR: $@" 1>&2
	exit 1
}

# Get the last page number.
LASTPAGE=`curl -I "https://api.github.com/users/"$USER"/repos?per_page=100" 2> /dev/null \
			| grep "rel=\"last\"" | cut -d";" -f2 | cut -d"=" -f4 | cut -d">" -f1`
[ -z $LASTPAGE ] && abort "Cannot get the last page number from github."
LASTPAGE=`expr $LASTPAGE + 1`

if [ -f $OUTPUTFILE ]; then
	rm $OUTPUTFILE
fi

# Get all name of "debian-*" repository and write output files.
for ((i=1; i<$LASTPAGE; i++));
do
	curl "https://api.github.com/users/"$USER"/repos?page="$i"&per_page=100" 2> /dev/null \
		| jq '[.[] .name]' | grep "\"debian-" | cut -d"\"" -f2 >> $OUTPUTFILE;
done
sed -e 's/^/ystk\//g' -i $OUTPUTFILE
echo "meta-debian/linux-ltsi" >> $OUTPUTFILE
echo "meta-debian/qemu" >> $OUTPUTFILE
echo "meta-debian/gnu-config" >> $OUTPUTFILE
echo "meta-debian/pseudo" >> $OUTPUTFILE

Add git repositories under meta-debian.
repo-lists: Add git repositories under meta-debian.

Signed-off-by: Masahiro Yamada <76d6c03d331b29d77eaac66c3113243c4dd22703@toshiba.co.jp>
