summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2010-04-11 20:12:43 +0000
committerMichał Górny <mgorny@gentoo.org>2010-04-11 20:12:43 +0000
commit4e2fefbd1975d4f209f267b9e637a35841c509e7 (patch)
tree4027f066e44d2e16804eb30b23a39dcda8ba8481 /scripts
parentsunrise/ skel.metadata.xml: Update skel.metadata.xml (diff)
downloadsunrise-4e2fefbd1975d4f209f267b9e637a35841c509e7.tar.gz
sunrise-4e2fefbd1975d4f209f267b9e637a35841c509e7.tar.bz2
sunrise-4e2fefbd1975d4f209f267b9e637a35841c509e7.zip
Minor cleanup and few additional exit-points in case of failures.
svn path=/sunrise/; revision=10438
Diffstat (limited to 'scripts')
-rw-r--r--scripts/use_desc_gen.sh18
1 files changed, 8 insertions, 10 deletions
diff --git a/scripts/use_desc_gen.sh b/scripts/use_desc_gen.sh
index 02e48b5e9..e14dbbd66 100644
--- a/scripts/use_desc_gen.sh
+++ b/scripts/use_desc_gen.sh
@@ -5,22 +5,20 @@
# $Id: use_desc_gen.sh,v 1.6 2008/08/23 21:28:28 robbat2 Exp $
usage() {
- prog=$(basename $1)
-
- echo "${prog} /path/to/portage/tree"
+ echo "$(basename "$1") /path/to/portage/tree"
exit 1;
}
if [ $# -ne 1 ]; then
- usage $0;
+ usage "$0";
fi
if [ "x${1}" = "x-h" -o "x${1}" = "x--help" ]; then
- usage $0;
+ usage "$0";
fi
if [ ! -f "${1}/profiles/use.local.desc" ]; then
- usage $0;
+ usage "$0";
fi
pid=$(echo $$)
@@ -36,19 +34,19 @@ pid=$(echo $$)
#cat "${1}/profiles/use.local.desc" | sed '1,/# The following categories/d;/# End of metadata categories/,$d;s/^..//' > /tmp/${pid}.categories
# take comments from existing use.local.desc
-grep '^#' "${1}/profiles/use.local.desc" > /tmp/${pid}.use.local.desc
-echo "" >> /tmp/${pid}.use.local.desc
+grep '^#' "${1}/profiles/use.local.desc" > /tmp/${pid}.use.local.desc || exit 2
+echo "" >> /tmp/${pid}.use.local.desc || exit 2
# use list from step #1 to filter current use.local.desc and add un-converted categories to new use.local.desc
#grep -v -f /tmp/${pid}.grep "${1}/profiles/use.local.desc" > /tmp/${pid}.new.use
# the secret sauce, append to new use.local.desc
-python scripts/use_desc_gen.py --repo_path "${1}" > /tmp/${pid}.new.use
+python scripts/use_desc_gen.py --repo_path "${1}" > /tmp/${pid}.new.use || exit 2
# let's keep it sorted: use major category, minor category, and package name
# as primary, secondary, and tertiary sort keys, respectively
sort -t: -k1,1 -k2 /tmp/${pid}.new.use | sort -s -t/ -k1,1 \
- >> /tmp/${pid}.use.local.desc
+ >> /tmp/${pid}.use.local.desc || exit 2
# clean up
#rm -rf /tmp/${pid}.categories