diff --git a/Makefile b/Makefile index 7441226..d99bf71 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ PROGRAMS_PERL=beefind.pl HELPER_BEE_SHELL=bee-init bee-check bee-remove bee-install bee-list bee-query bee-download bee-update HELPER_BEE_C=bee-dep -HELPER_SHELL=compat-filesfile2contentfile filelist2content +HELPER_SHELL=compat-filesfile2contentfile filelist2content content2filelist LIBRARY_SHELL=beelib.config.sh diff --git a/src/content2filelist.sh.in b/src/content2filelist.sh.in new file mode 100644 index 0000000..9c08c4a --- /dev/null +++ b/src/content2filelist.sh.in @@ -0,0 +1,44 @@ +#!/bin/bash +# +# content2filelist - extract files from content file +# +# Copyright (C) 2009-2012 +# Tobias Dreyer +# Marius Tolzmann +# and other bee developers +# +# This file is part of bee. +# +# bee is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +: ${BEESEP=@BINDIR@/beesep} + +while read line ; do + unset type + data=$(${BEESEP} ${line}) + + if [ "$?" -gt 0 ] ; then + echo >&2 "**ERROR** INVALID CONTENT: ${line}" + exit 1 + fi + + eval ${data} + + if [ "$?" -gt 0 -o -z "${type}" ] ; then + echo >&2 "**ERROR** UNPARSABLE CONTENT: ${line}" + exit 1 + fi + + echo ${file%//*} +done < <(cat ${@})