From 1153577dc9a9f62d3f69748c6891abe4d94743b2 Mon Sep 17 00:00:00 2001 From: slakmagik Date: Tue, 30 Oct 2012 03:54:22 +0000 Subject: [PATCH] restore the README files view_app_file(), view_readmes(): This puts the dep info back into the README display by cat'ing the README and grep'ing the .info file into a temporary README. This doesn't touch the command line show_readme() as that actually shows both the README and .info files already. --- src/usr/sbin/sbopkg | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 0c9c6a6..5ab2008 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -1180,6 +1180,7 @@ view_app_file() { local FILE="$2" local PLAIN local AFSP=$SBOPKGTMP/sbopkg_app_files_selection_parsed + local RESTORED_README=$SBOPKGTMP/restored_readme cd $DIR case $FILE in @@ -1192,7 +1193,13 @@ view_app_file() { * ) PLAIN=yes ;; esac if [[ "$PLAIN" == yes ]]; then - dialog --exit-label "OK" --title "$FILE" --textbox "$FILE" 0 0 + # If it's a README, splice the damned deps back into its display. + FILENAME=$FILE + if [[ $FILE == README ]]; then + { cat README; echo; grep '^REQUIRES=' *.info; } > $RESTORED_README + FILE=$RESTORED_README + fi + dialog --exit-label "OK" --title "$FILENAME" --textbox "$FILE" 0 0 else dialog --exit-label "OK" --title "Parsed contents of $FILE" \ --textbox "$AFSP" 0 0 @@ -2209,6 +2216,7 @@ view_readmes() { local NAME ONOFF PICK READMES READMES=$(find $REPO_DIR -mindepth 3 -maxdepth 3 -name README) + INFOS=$(find $REPO_DIR -mindepth 3 -maxdepth 3 -name *.info) printf "$HEADER_STRING\n" > $HEAD_FILE @@ -2227,7 +2235,11 @@ view_readmes() { echo >> $READMES_FILE tin_text $NAME >> $READMES_FILE echo >> $READMES_FILE - cat $(grep /$NAME/README\$ <<< "$READMES") >> $READMES_FILE + { + cat $(grep /$NAME/README\$ <<< "$READMES") + echo + grep '^REQUIRES=' $(grep /$NAME/*.info <<< "$INFOS") + } >> $READMES_FILE done < $INPUT tin_text "$(< $HEAD_FILE)" > $REPORT_FILE