diff options
author | 2011-04-22 10:52:34 +0800 | |
---|---|---|
committer | 2011-04-26 18:53:59 +0800 | |
commit | 53c8fd8af69c2b2120ba52205e3c658d1c5c1b68 (patch) | |
tree | ba079a18ad84695e948b7f08625cdeeb4ba1f768 /utils | |
parent | Utility: improve the output format of metadata_generator (diff) | |
download | libbash-53c8fd8af69c2b2120ba52205e3c658d1c5c1b68.tar.gz libbash-53c8fd8af69c2b2120ba52205e3c658d1c5c1b68.tar.bz2 libbash-53c8fd8af69c2b2120ba52205e3c658d1c5c1b68.zip |
Utility: write a script that generates ebuild metadata
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/meta_gen.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/meta_gen.sh b/utils/meta_gen.sh new file mode 100755 index 0000000..2cddcb0 --- /dev/null +++ b/utils/meta_gen.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +source /etc/make.conf + +outputdir=${1:-$(mktemp -d)} + +if [ -d $outputdir && -w $outputdir] +then + echo "$outputdir is not writable" +fi + +for category_dir in ${PORTDIR:-/usr/portage}/* +do + category=${category_dir##*\/} + mkdir $outputdir/$category + for file in ${category_dir}/*/*.ebuild + do + filename=${file##*\/} + filename=${filename/.ebuild} + metadata_file="$outputdir/$category/$filename" + echo "Generating metadata of $category/$filename to $metadata_file" + LD_LIBRARY_PATH=${srcdir:-..}/.libs ${srcdir:-..}/.libs/metadata_generator $file > $metadata_file + done +done |