- 论坛徽章:
- 0
|
本帖最后由 monster_3j 于 2012-09-28 15:50 编辑
嗯,看不出什么东西啊!
server ftp.itrc.hp.com
user 43dce659797392b78971196d7423027c
patch patch_bundles/hp-ux/QUALITYPACK/QPK1131_B.11.31.1109.367a.depot 1072486400
patch hp-ux_patches/11.X/PHKL_42060 715513
patch hp-ux_patches/11.X/PHCO_42262 27623753
patch hp-ux_patches/11.X/PHKL_41967 113048
patch hp-ux_patches/11.X/PHKL_42496 13240952
patch hp-ux_patches/11.X/PHKL_42310 289133
patch hp-ux_patches/11.X/PHKL_42335 757176
patch patch_bundles/hp-ux/SPECIAL/FEATURE11i_B.11.31.1109.367a.depot 151613440
patch patch_bundles/hp-ux/HWE/HWEnable11i_B.11.31.1109.367a.depot 128696320
MANIFEST=./patch_manifest
RES=`awk '/^patch/ {print $2 " " $3}' $MANIFEST | sed s/.depot//g`
if [ -z "$RES" ]; then
echo "Error 7901: No patches specified in patch_manifest file"
exit 2
fi
set $RES
while [ $# -gt 0 ]; do
PATCH=`basename $1`
PATCH_LIST="${PATCH_LIST:+${PATCH_LIST} }$PATCH"
shift 2
done
#
# NOTE: Check all the options here and see if there are any problems.
#
if [ $INTERACTIVE -eq 1 ]; then
{
echo "Depot name [$DEPOT]: \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
DEPOT=$ANSWER
}
fi
echo "Bundle name [$BUNDLE]: \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
BUNDLE=$ANSWER
}
fi
echo "Bundle title [$TITLE]: \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
TITLE=$ANSWER
}
fi
echo "Unshar patch files ([$UNSHAR]/n): \c"
read ANSWER
if [ -n "$ANSWER" ]; then
{
UNSHAR=$ANSWER
}
fi
}
fi
echo "DEPOT: $DEPOT"
echo "BUNDLE: $BUNDLE"
echo "TITLE: $TITLE"
echo "UNSHAR: $UNSHAR"
echo "PSF: $PSF"
typeset -i ERRORS=0
#
# Check for existence of depot
#
if [ -d "$DEPOT" ]; then
{
if [ $SKIP_DEPOT -eq 0 ]; then
echo "ERROR: Depot already exists: ${DEPOT}."
echo " Use -f option to override or delete depot."
exit 1
else
echo "NOTE: Using existing depot."
fi
}
fi
#
# Unshar all the patch files.
#
if [ "$UNSHAR" = "y" ]; then
{
echo "Expanding patch shar files..."
for PATCH in $PATCH_LIST; do
{
if [[ "$PATCH.depot" = @(HWE|GOLD|QPK|Y2K|BUNDLE|MAINTPACK|FEATURE)* ]];then
SD_LIST="$SD_LIST $PATCH \
"
continue
fi
if [ ! -f $PATCH ]; then
echo "ERROR: Shar file not found for patch $PATCH."
ERRORS=1
else
rm -f ${PATCH}.text ${PATCH}.depot
/bin/sh ${PATCH}
if [ $? -ne 0 ]; then
{
if [ "$PATCH" = @(PHCO_|PHKL_|PHNE_|PHSS_)* ]; then
echo "ERROR: Could not unshar ${PATCH}"
ERRORS=1
else
echo "${PATCH} is a non-SD installable patch, skipping ..."
fi
}
else
SD_LIST="$SD_LIST $PATCH \
"
fi
fi
}
done
}
fi
> $PSF
echo "list of SD installable patches = $SD_LIST "
if [ -z "$SD_LIST" ]; then
echo "No valid SD installable patch found. Exiting..."
exit 1
fi
if [ $ERRORS -eq 1 ]; then
echo "Errors were found but Depot creation will continue."
fi
PATCH_BUNDLE_REVISION=`/bin/date +%Y.%m.%d`
PATCH_LIST=$SD_LIST
ERRORS=0
echo "#" >> $PSF
echo "# Temporary product specification file" >> $PSF
echo "#" >> $PSF
echo "# Bundle: $BUNDLE" >> $PSF
echo "# Title: $TITLE" >> $PSF
echo "# Created: `date`" >> $PSF
echo "#" >> $PSF
echo "vendor" >> $PSF
echo " tag HP" >> $PSF
echo " title Hewlett-Packard Company" >> $PSF
echo " description Software Patches from Hewlett-Packard" >> $PSF
echo "end" >> $PSF
echo "bundle" >> $PSF
echo " tag $BUNDLE" >> $PSF
echo " title $TITLE" >> $PSF
echo " description Custom Patch Bundle" >> $PSF
echo " vendor_tag HP" >> $PSF
echo " revision B.$PATCH_BUNDLE_REVISION" >> $PSF
echo " architecture HP-UX_B.11.00_32/64" >> $PSF
echo " machine_type *" >> $PSF
echo " os_name HP-UX" >> $PSF
echo " os_release B.$OS" >> $PSF
echo " os_version *" >> $PSF
echo " is_reference TRUE" >> $PSF
echo " copyright (c)Copyright 1983-2008 Hewlett-Packard Co., All Rights Reserved" >> $PSF
for PATCH in $PATCH_LIST; do
{
SPEC=`swlist -l product -a software_spec -s $PWD/${PATCH}.depot \
| grep -v "^#" | awk '{print }' -`
SPEC=${SPEC#*,}
echo " contents $PATCH,$SPEC" >> $PSF
}
done
echo "end" >> $PSF
for PATCH in $PATCH_LIST; do
{
echo "Copying $PATCH into depot $DEPOT"
swcopy -x enforce_dependencies=FALSE \
-x mount_all_filesystems=FALSE \
-x reinstall=TRUE \
-x write_remote_files=TRUE \
-d -s $PWD/$PATCH.depot \* @ $DEPOT
if [ $? -ne 0 ]; then
{
echo "ERROR: Could not swcopy $PATCH into depot."
ERRORS=1
}
fi
}
done
if [ "$NOBUNDLE" != "true" ]; then
echo "Bundling patches in depot"
swpackage -s $PSF \
-x write_remote_files=TRUE \
@ $DEPOT
if [ $? -ne 0 ]; then
echo "ERROR: Could not swpackage ${PSF} into depot."
ERRORS=1
fi
fi
echo "Verifying the depot."
swverify -d -x mount_all_filesystems=FALSE \
-x enforce_dependencies=FALSE \
\* @ $DEPOT
if [ $? -ne 0 ]; then
{
echo "ERROR: swverify of depot failed."
ERRORS=1
}
fi
if [ $ERRORS -eq 1 ]; then
echo "ERROR: Errors were found while building depot."
fi |
|