ddodds / instadmg

Automatically exported from code.google.com/p/instadmg
0 stars 0 forks source link

InstallerChoices var not being reset #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I think I may have found out what is going on. The last 6 items in my catalog 
are MS Office, then the 5 updates. I have an installerchoices xml file for ms 
office. It appears in instadmg.bash (line 670) that the CHOICES_FILE variable 
is not cleared 
for each loop. I think the CHOICES_FILE variable needs to be cleared before the 
first if statement, or an else CHOICES_FILE='' need to be added in the first if 
statement.

I may be way off here, and if I am, I apologize. The code changes below do seem 
to solve the issue I am having.

I think I may have found out what is going on. The last 6 items in my catalog 
are MS Office, then the 5 updates. I have an installerchoices xml fil for ms 
office. It appears in instadmg.bash (line 670) that the CHOICES_FILE variable 
is not cleared for 
each loop. I think the CHOICES_FILE variable needs to be cleared before the 
first if statement, or and else CHOICES_FILE='' need to be added in the first 
if statement.

I may be way off here, and if I am, I apologize.

    for UPDATE_PKG in $(/usr/bin/find -L "$TARGET" -maxdepth 1 -iname '*pkg' | /usr/bin/awk 'tolower() ~ /\.(m)?pkg/ && !/\/\._/'); do
        if [ -e "$TARGET/InstallerChoices.xml" ]; then
            CHOICES_FILE="InstallerChoices.xml"
        # TODO: better handle multiple pkg's and InstallerChoice files named for the file they should handle
I added---> else
I added--->     CHOICES_FILE="" 
        fi

        if [ $OS_REV_MAJOR -le 4 ]; then
            CHOICES_FILE="" # 10.4 can not use them
        fi          

        TARGET_FILE_NAME=`/usr/bin/basename "$UPDATE_PKG"`
        INSTALLER_NUMBER_TEXT=""
        if [ "$ORIGINAL_TARGET" == "$TARGET" ]; then
            CONTAINER_PATH="$TARGET"
        else
            # probably a dmg installer
            CONTAINER_PATH=`/usr/bin/readlink "$ORIGINAL_TARGET"`
            INSTALLER_NUMBER_TEXT=`/usr/bin/basename "$ORIGINAL_TARGET"`
            INSTALLER_NUMBER_TEXT=" ($INSTALLER_NUMBER_TEXT)"
        fi

        if [ "$CHOICES_FILE" != "" ]; then
            log "Installing $TARGET_FILE_NAME from ${CONTAINER_PATH}${INSTALLER_NUMBER_TEXT} with XML Choices file: $CHOICES_FILE" information
            /usr/sbin/installer -verbose -applyChoiceChangesXML "$TARGET/$CHOICES_FILE" -pkg "$UPDATE_PKG" -target "$CURRENT_IMAGE_MOUNT" | (while read INPUT; do log "$INPUT " detail; done)
        else
            log "Installing $TARGET_FILE_NAME from ${CONTAINER_PATH}${INSTALLER_NUMBER_TEXT}" information
            /usr/sbin/installer -verbose -pkg "$UPDATE_PKG" -target "$CURRENT_IMAGE_MOUNT" | (while read INPUT; do log "$INPUT " detail; done)

Original issue reported on code.google.com by allanmar...@gmail.com on 25 Mar 2009 at 4:56

GoogleCodeExporter commented 8 years ago
In doing a partial re-write this has effectively been done. The problem should 
no longer be present. 
Confirmation would be appreciated. Try out revs > 199.

Original comment by kuehn.k...@gmail.com on 27 May 2009 at 6:45