diff options
author | rudson <rudson@04377dda-e619-0410-9926-eae83683ac58> | 2006-11-19 23:10:09 +0000 |
---|---|---|
committer | rudson <rudson@04377dda-e619-0410-9926-eae83683ac58> | 2006-11-19 23:10:09 +0000 |
commit | 23d388d687c5b2f5f95ef32d3191e2f417b1fdf0 (patch) | |
tree | 06c6a0664cbb9902632c1bedb51df0bfab0620d8 | |
parent | 55e9fd24a85611ecc801d5d32679a48d138db97c (diff) | |
download | simplepkg-23d388d687c5b2f5f95ef32d3191e2f417b1fdf0.tar.gz simplepkg-23d388d687c5b2f5f95ef32d3191e2f417b1fdf0.tar.bz2 |
createpkg: Terminado a seleção de pacotes por nomes com curringas (*, ?, ...)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@35 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r-- | src/createpkg | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/createpkg b/src/createpkg index 8118715..4280a7d 100644 --- a/src/createpkg +++ b/src/createpkg @@ -353,6 +353,25 @@ fi # Get SlackBuild script BUILD_SCRIPT="`find_script $PACKAGE`" +# Select one SlackBuild +if [ "`echo $BUILD_SCRIPT | wc -w`" -gt 1 ]; then + AUX="$PS3" + PS3="Choice: " + LIST=`echo $BUILD_SCRIPT | sed 's/ /\n/g' | sed -r 's/.*\/(.*)\.SlackBuild$/\1/'`" EXIT" + select PACKAGE in `echo $LIST`; do + break + done + if [ "$PACKAGE" = "EXIT" ]; then + echo -e "$CL_ERROR error: None package select $CL_OFF" + exit 1 + fi + # Select only one SlackBuild in BUILD_SCRIPT + BUILD_SCRIPT=`echo $BUILD_SCRIPT | sed 's/ /\n/g' | grep "/$PACKAGE.SlackBuild"` + PS3="$AUX" +else + PACKAGE=`echo $BUILD_SCRIPT | sed -r 's/.*\/(.*)\.SlackBuild$/\1/'` +fi + # Check SlackBuild script found if [ -z "$BUILD_SCRIPT" ]; then handle_error 5 $PACKAGE @@ -389,14 +408,18 @@ echo -e "$CL_MENSG $BASENAME: processing $SCRIPT_NAME $CL_OFF" # Built package cd $SCRIPT_BASE -INTERACT=no ./$SCRIPT_NAME +# Execute SlackBuild script with variables protection +( INTERACT=no ./$SCRIPT_NAME ) # Check if package was built handle_error $? $PACKAGE +PKG_TGZ="`ls -1 -c $REPOS/$PACKAGE-*-*-*tgz | head -n 1`" +mkdir -p $PKG_TGZ $REPOS/${SCRIPT_BASE/$BUILD_SCRIPT} + if [ "$INSTALL" == "1" ]; then # as we dont have the full package file name, we'll # use the newer file name that matches our wildcard: - PACKAGE="`ls -1 -c $REPOS/$PACKAGE-*-*-*tgz | head -n 1`" - upgradepkg --install-new $PACKAGE + + upgradepkg --install-new $PKG_TGZ fi |