List of reports associated
Test name:Version: 5.3.9
Goto: PHPInfo Build environment
PHPInfo
phpinfo() PHP Version => 5.3.9 System => Linux mee-v3 2.6.9-101.ELsmp #1 SMP Fri May 27 18:57:30 EDT 2011 i686 Build Date => Jan 17 2012 09:07:57 Configure Command => './configure' '--prefix=/openpkg' '--sysconfdir=/openpkg/etc/php' '--with-config-file-path=/openpkg/etc/php' '--with-apxs2=/openpkg/sbin/apxs' '--libdir=/openpkg/lib/php' '--disable-all' '--enable-pdo' '--enable-filter' '--with-pcre-regex=/openpkg' '--without-sqlite' '--without-pdo-sqlite' '--without-mysql' '--without-pdo-mysql' '--with-pgsql=/openpkg' '--with-pdo-pgsql=/openpkg' '--with-gd=/openpkg' '--with-jpeg-dir=/openpkg' '--with-png-dir=/openpkg' '--enable-gd-native-ttf' '--with-freetype-dir=/openpkg' '--disable-debug' '--with-zlib=/openpkg' '--with-zlib-dir=/openpkg' '--with-openssl=/openpkg' '--enable-session' '--disable-json' '--disable-tokenizer' '--disable-xml' '--without-xsl' '--disable-dom' '--without-pear' '--disable-simplexml' '--without-tidy' '--enable-cli' '--enable-cgi' Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /openpkg/etc/php Loaded Configuration File => /home/openpkg/etc/php/php.ini Scan this dir for additional .ini files => (none) Additional .ini files parsed => (none) PHP API => 20090626 PHP Extension => 20090626 Zend Extension => 220090626 Zend Extension Build => API220090626,NTS PHP Extension Build => API20090626,NTS Debug Build => no Thread Safety => disabled Zend Memory Manager => enabled Zend Multibyte Support => disabled IPv6 Support => enabled Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls Registered Stream Filters => zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk This program makes use of the Zend Scripting Language Engine: Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies _______________________________________________________________________ Configuration Core PHP Version => 5.3.9 Directive => Local Value => Master Value allow_call_time_pass_reference => On => On allow_url_fopen => Off => Off allow_url_include => Off => Off always_populate_raw_post_data => Off => Off arg_separator.input => & => & arg_separator.output => & => & asp_tags => Off => Off auto_append_file => no value => no value auto_globals_jit => On => On auto_prepend_file => no value => no value browscap => no value => no value default_charset => no value => no value default_mimetype => text/html => text/html define_syslog_variables => Off => Off disable_classes => no value => no value disable_functions => no value => no value display_errors => STDERR => STDERR display_startup_errors => Off => Off doc_root => no value => no value docref_ext => no value => no value docref_root => no value => no value enable_dl => On => On error_append_string => no value => no value error_log => no value => no value error_prepend_string => no value => no value error_reporting => 30719 => 30719 exit_on_timeout => Off => Off expose_php => On => On extension_dir => /openpkg/lib/php/extensions/no-debug-non-zts-20090626 => /openpkg/lib/php/extensions/no-debug-non-zts-20090626 file_uploads => On => On highlight.bg => <font style="color: #FFFFFF">#FFFFFF</font> => <font style="color: #FFFFFF">#FFFFFF</font> highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font> highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font> highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font> highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font> highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font> html_errors => Off => Off ignore_repeated_errors => Off => Off ignore_repeated_source => Off => Off ignore_user_abort => Off => Off implicit_flush => On => On include_path => .:/openpkg/lib/php:/openpkg/lib/php/php-jpgraph => .:/openpkg/lib/php:/openpkg/lib/php/php-jpgraph log_errors => On => On log_errors_max_len => 1024 => 1024 magic_quotes_gpc => On => On magic_quotes_runtime => Off => Off magic_quotes_sybase => Off => Off mail.add_x_header => Off => Off mail.force_extra_parameters => no value => no value mail.log => no value => no value max_execution_time => 0 => 0 max_file_uploads => 20 => 20 max_input_nesting_level => 64 => 64 max_input_time => -1 => -1 max_input_vars => 1000 => 1000 memory_limit => 32M => 32M open_basedir => no value => no value output_buffering => 0 => 0 output_handler => no value => no value post_max_size => 8M => 8M precision => 14 => 14 realpath_cache_size => 16K => 16K realpath_cache_ttl => 120 => 120 register_argc_argv => On => On register_globals => Off => Off register_long_arrays => On => On report_memleaks => On => On report_zend_debug => Off => Off request_order => no value => no value safe_mode => Off => Off safe_mode_exec_dir => /usr/local/php/bin => /usr/local/php/bin safe_mode_gid => Off => Off safe_mode_include_dir => /openpkg/lib/php => /openpkg/lib/php sendmail_from => no value => no value sendmail_path => /bin/false -t -i => /bin/false -t -i serialize_precision => 17 => 17 short_open_tag => On => On SMTP => localhost => localhost smtp_port => 25 => 25 sql.safe_mode => Off => Off track_errors => Off => Off unserialize_callback_func => no value => no value upload_max_filesize => 2M => 2M upload_tmp_dir => no value => no value user_dir => no value => no value user_ini.cache_ttl => 300 => 300 user_ini.filename => .user.ini => .user.ini variables_order => EGPCS => EGPCS xmlrpc_error_number => 0 => 0 xmlrpc_errors => Off => Off y2k_compliance => On => On zend.enable_gc => On => On date date/time support => enabled "Olson" Timezone Database Version => 2011.14 Timezone Database => internal Default timezone => America/Denver Directive => Local Value => Master Value date.default_latitude => 31.7667 => 31.7667 date.default_longitude => 35.2333 => 35.2333 date.sunrise_zenith => 90.583333 => 90.583333 date.sunset_zenith => 90.583333 => 90.583333 date.timezone => no value => no value ereg Regex Library => Bundled library enabled filter Input Validation and Filtering => enabled Revision => $Revision: 321634 $ Directive => Local Value => Master Value filter.default => unsafe_raw => unsafe_raw filter.default_flags => no value => no value gd GD Support => enabled GD Version => 2.0 FreeType Support => enabled FreeType Linkage => with freetype FreeType Version => 2.4.8 GIF Read Support => enabled GIF Create Support => enabled JPEG Support => enabled libJPEG Version => unknown PNG Support => enabled libPNG Version => 1.4.8 WBMP Support => enabled Directive => Local Value => Master Value gd.jpeg_ignore_warning => 0 => 0 openssl OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.0.0f 4 Jan 2012 OpenSSL Header Version => OpenSSL 1.0.0f 4 Jan 2012 pcre PCRE (Perl Compatible Regular Expressions) Support => enabled PCRE Library Version => 8.21 2011-12-12 Directive => Local Value => Master Value pcre.backtrack_limit => 1000000 => 1000000 pcre.recursion_limit => 100000 => 100000 PDO PDO support => enabled PDO drivers => pgsql pdo_pgsql PDO Driver for PostgreSQL => enabled PostgreSQL(libpq) Version => 9.1.2 Module version => 1.0.2 Revision => $Id: pdo_pgsql.c 321634 2012-01-01 13:15:04Z felipe $ pgsql PostgreSQL Support => enabled PostgreSQL(libpq) Version => 9.1.2 Multibyte character support => enabled SSL support => enabled Active Persistent Links => 0 Active Links => 0 Directive => Local Value => Master Value pgsql.allow_persistent => On => On pgsql.auto_reset_persistent => Off => Off pgsql.ignore_notice => Off => Off pgsql.log_notice => Off => Off pgsql.max_links => Unlimited => Unlimited pgsql.max_persistent => Unlimited => Unlimited Reflection Reflection => enabled Version => $Revision: 321634 $ session Session Support => enabled Registered save handlers => files user Registered serializer handlers => php php_binary Directive => Local Value => Master Value session.auto_start => Off => Off session.bug_compat_42 => On => On session.bug_compat_warn => On => On session.cache_expire => 180 => 180 session.cache_limiter => nocache => nocache session.cookie_domain => no value => no value session.cookie_httponly => Off => Off session.cookie_lifetime => 0 => 0 session.cookie_path => / => / session.cookie_secure => Off => Off session.entropy_file => no value => no value session.entropy_length => 0 => 0 session.gc_divisor => 100 => 100 session.gc_maxlifetime => 1440 => 1440 session.gc_probability => 1 => 1 session.hash_bits_per_character => 4 => 4 session.hash_function => 0 => 0 session.name => PHPSESSID => PHPSESSID session.referer_check => no value => no value session.save_handler => files => files session.save_path => no value => no value session.serialize_handler => php => php session.use_cookies => On => On session.use_only_cookies => On => On session.use_trans_sid => 0 => 0 SPL SPL support => enabled Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException standard Dynamic Library Support => enabled Path to sendmail => /bin/false -t -i Directive => Local Value => Master Value assert.active => 1 => 1 assert.bail => 0 => 0 assert.callback => no value => no value assert.quiet_eval => 0 => 0 assert.warning => 1 => 1 auto_detect_line_endings => 0 => 0 default_socket_timeout => 60 => 60 from => no value => no value safe_mode_allowed_env_vars => PHP_ => PHP_ safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATH url_rewriter.tags => a=href,area=href,frame=src,form=,fieldset= => a=href,area=href,frame=src,form=,fieldset= user_agent => no value => no value zlib ZLib Support => enabled Stream Wrapper support => compress.zlib:// Stream Filter support => zlib.inflate, zlib.deflate Compiled Version => 1.2.5 Linked Version => 1.2.5 Directive => Local Value => Master Value zlib.output_compression => Off => Off zlib.output_compression_level => -1 => -1 zlib.output_handler => no value => no value Additional Modules Module Name Environment Variable => Value MANPATH => /openpkg/man:/openpkg/local/man::/usr/share/man OPENPKG_PKGGROUP => opkg M4 => /openpkg/bin/m4 TEST_PHP_SRCDIR => /openpkg/RPM/TMP/php-5.3.9 OPENPKG_PKGUSER => opkg SHELL => /openpkg/lib/openpkg/bash TERM => vt220 MAKEFLAGS => OPENPKG_DOWNLOAD_CURL_FILTER => grep 'class="file"' | sed -e 's!.*td valign!!;s!img .*!!;s!.*href!!;s!.*"\(.*\)".*!\1!' SSH_CLIENT => deleted TMPDIR => /tmp OPENPKG_SOURCE_URI_SUFFIX => -${OPENPKG_TAG}.src.rpm SSH_TTY => deleted OPENPKG_ROOT => /openpkg USER => opkg LD_LIBRARY_PATH => /openpkg/lib:/openpkg/local/lib::/lib:/usr/lib SSH_AUTH_SOCK => deleted OPENPKG_TAG => ${OPENPKG_REL}.${OPENPKG_SUBREL} MAKELEVEL => 1 OPENPKG_REL => 2.5 MFLAGS => PATH => /openpkg/bin:/openpkg/sbin:/openpkg/local/bin:/openpkg/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ucb _ => /openpkg/RPM/TMP/php-5.3.9/sapi/cli/php LC_COLLATE => C BLOCKSIZE => 1024 OPENPKG_PLATFORM => ix86-rhel4 PWD => /openpkg/RPM/TMP/php-5.3.9 TEST_PHP_EXECUTABLE => /openpkg/RPM/TMP/php-5.3.9/sapi/cli/php OPENPKG_DOWNLOAD_URL_PREFIX => http://download.openpkg.org HOME => /openpkg SHLVL => 3 OPENPKG_SUBREL => 1 LOGNAME => opkg SSH_CONNECTION => deleted OPENPKG_DOWNLOAD_CURL_USER_PW => -u 804941a8-0525-11df-8345-000e0c4e71a6:anypw INFOPATH => /openpkg/info:/openpkg/local/info::/usr/share/info DISPLAY => localhost:10.0 CC => /openpkg/bin/gcc OPENPKG_SOURCE_URI_PREFIX => http://download.openpkg.org/packages/current/source/ setpermlike => () { local FACILITY='setpermlike'; local USAGE="${FACILITY} Permissions_Source_Filespec Permissions_Destination_Filespec"; local permsource_file="${1}"; local permdest_file="${2}"; set +f; if [ "${permsource_file}" = '' -o "${permdest_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; set -f; ls -ald ${permsource_file} | head -1 | nawk -v filename=${permdest_file} ' { #mod_dir=substr($1,1,1) mod_owner=substr($1,2,3) mod_group=substr($1,5,3) mod_other=substr($1,8,3) #gsub("-", "", mod_dir) gsub("-", "", mod_owner) gsub("-", "", mod_group) gsub("-", "", mod_other) owner_id=$3 group_id=$4 chmod_cmd="chmod u=" mod_owner ",g=" mod_group ",o=" mod_other " " filename chown_cmd="chown " $3 ":" $4 " " filename #print chmod_cmd system(chmod_cmd) #print chown_cmd system(chown_cmd) } '; set +f; return } tarcopy => () { local sourcedir="${1}"; local destdir="${2}"; local dirorfile="${3}"; if [ "${sourcedir}" = '' ]; then echo "sourcedir not specified: ${sourcedir}"; return 1; fi; if [ "${destdir}" = '' ]; then echo "destdir not specified: ${destdir}"; return 1; fi; if [ "${dirorfile}" = '' ]; then echo "dirorfile not specified"; return 1; fi; if [ "${sourcedir}" = "${destdir}" ]; then echo "destdir must not be same as sourcedir"; return 1; fi; if [ -d ${sourcedir} ]; then :; else echo "sourcedir does not exist: ${sourcedir}"; return 1; fi; if [ -d ${destdir} ]; then :; else echo "destdir does not exist: ${destdir}"; return 1; fi; if [ -e ${sourcedir}/${dirorfile} ]; then :; else echo "sourcedir/dirorfile does not exist: ${sourcedir}/${dirorfile}"; return 1; fi; ( cd ${sourcedir} && tar -cf - ${dirorfile} ) | ( cd ${destdir} && tar -xf - ) } shswopnew => () { local FACILITY='shswopnew'; local USAGE="${FACILITY} [-adfloruv]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local tempfile2="/tmp/${FACILITY}_${$}_2.tmp"; local tracefile1; local tracefile2; local joinoutput; local OPT_a=0; local OPT_d=0; local OPT_f=0; local OPT_l=0; local OPT_o=0; local OPT_r=0; local OPT_u=0; local OPT_v=0; OPTIND=1; while getopts ":adfloruv" OPTFLAG; do case ${OPTFLAG} in a) OPT_a='1' ;; d) OPT_d='1' ;; f) OPT_f='1' ;; l) OPT_l='1' ;; o) OPT_o='1' ;; r) OPT_r='1' ;; u) OPT_u='1' ;; v) OPT_v='1' ;; \?) echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1 ;; esac; done; shift $((${OPTIND} - 1)); tjmop -f no_package 2>/dev/null; shswop | sort -u | sed -e 's;-\([0-9]\);\t\1;' >${tempfile1}; cat /tmp/tjmop_cache?.tmp | grep -Ev '^openpkg-[0-9].*\.src\.sh$' | sed -e 's/\.src\.rpm$//' | sort -u | sed -e 's;-\([0-9]\);\t\1;' | grep -v -f /home/openpkg_customizations/tjm_openpkg/tjmop_swinstall_openpkg_excludes.dat >${tempfile2}; join -j 1 -o 1.1,2.1,1.2,2.2 -e "*No_Match*" -a 1 ${tempfile1} ${tempfile2} | while read pkgID1 pkgID2 pkgver1 pkgver2; do if [ "${pkgver1}" = "${pkgver2}" ]; then return_status=0; else tjmcompare_versions "${pkgver1}" "${pkgver2}"; return_status=${?}; if [ "${OPT_o}" = '1' ]; then if [ "${return_status}" = '2' ]; then :; else return_status=0; fi; else if [ "${return_status}" = '1' ]; then :; else return_status=0; fi; fi; fi; pkgver_norel1="${pkgver1%-*}"; pkgver_norel2="${pkgver2%-*}"; if [ "${OPT_a}" = '1' -a "${pkgID2}" != '*No_Match*' ]; then return_status=0; else if [ "${OPT_u}" = '1' -a "${pkgID2}" = '*No_Match*' ]; then return_status=0; else if [ "${OPT_r}" = '1' ]; then if [ "${pkgver_norel1}" != "${pkgver_norel2}" -o "${pkgID2}" = '*No_Match*' ]; then return_status=0; fi; else if [ "${OPT_v}" = '1' ]; then if [ "${pkgver_norel1}" = "${pkgver_norel2}" -o "${pkgID2}" = '*No_Match*' ]; then return_status=0; fi; fi; fi; fi; fi; if [ "${return_status}" != '0' ]; then if [ "${OPT_f}" = '1' ]; then echo "tjmop -fr ${pkgID1} # Upgrade from ${pkgver1} to ${pkgver2}"; else if [ "${OPT_d}" = '1' -o "${OPT_l}" = '1' ]; then echo "${pkgID1}"; else echo "${pkgID1} ${pkgver1} ${pkgver2} ${return_status}"; fi; fi; fi; done | if [ "${OPT_d}" = '1' ]; then tr '\n' '|' | sed -e 's@|$@\n@'; else if [ "${OPT_f}" = '1' -o "${OPT_l}" = '1' ]; then cat; else nawk ' BEGIN { printf "%17-s %21-s %21-s %20-s\n\n","Package","Installed","Available","Only Release Differs" } { pkgID=$1 #if(pkgID == "*No_Match*") pkgID=$2 #pkgver1=$3 #pkgver2=$4 #vercompare=$5 pkgver1=$2 pkgver2=$3 vercompare=$4 pkgver1max=split(pkgver1,pkgver1array,"-") pkgver2max=split(pkgver2,pkgver2array,"-") if(pkgver1array[1] == pkgver2array[1]) { only_release_differs="*New_Release_Only**" } else { only_release_differs="" } #if(pkgver1 != pkgver2) printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs # TJM 04/21/10 Do not list when installed version is newer than available version. #if(vercompare == 1) printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs # } '; fi; fi; rm ${tempfile1}; rm ${tempfile2}; return } tjmgethighseq => () { local FACILITY='tjmgethighseq'; local USAGE="${FACILITY} desired_name"; local desired_name="${1}"; local seq_num; if [ "${desired_name}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; seq_num=$(ls -d ${desired_name}* 2>/dev/null | sed -ne "s;^${desired_name}\(_[0-9]\+\|\)$;0\1;p" | sed -e 's;^0_;;' | sort -nr | head -1); echo "${seq_num}" } tjmoprediff_rpmnew => () { local FACILITY='tjmoprediff_rpmnew'; local USAGE="${FACILITY} full_path_to_openpkg_file"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local dir_name; local base_name; local openpkg_file; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ -f ${openpkg_file}.rpmnew ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.rpmnew"; return 1; fi; if [ -f ${openpkg_file}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.orig.save"; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_file}.orig.save ${openpkg_file} ${openpkg_file}.rpmnew ${tempfile1}; if [ -e ${tempfile1} ]; then backup_filename="$(tjmgetudfn ${openpkg_file}${backup_extension})"; mv -i ${openpkg_file} ${backup_filename}; mv -i ${openpkg_file}.rpmnew ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; fi } tjmopkdiff3_merge => () { local FACILITY='tjmopkdiff3_merge'; local USAGE="${FACILITY} base_original_vendor_file locally_customized_original_file vendor_changed_file [merged_output_file]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local base_original_vendor_file="${1}"; local locally_customized_original_file="${2}"; local vendor_changed_file="${3}"; local merged_output_file="${4}"; if [ "${base_original_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${base_original_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${base_original_vendor_file}"; return 1; fi; if [ "${locally_customized_original_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${locally_customized_original_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${locally_customized_original_file}"; return 1; fi; if [ "${vendor_changed_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${vendor_changed_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${vendor_changed_file}"; return 1; fi; if [ "${merged_output_file}" = '' ]; then merged_output_file="${vendor_changed_file}"; fi; rm -f ${tempfile1}; kdiff3 -m ${base_original_vendor_file} ${locally_customized_original_file} ${vendor_changed_file} -o ${tempfile1}; if [ -e ${tempfile1} ]; then if [ -f ${merged_output_file} ]; then setpermlike ${merged_output_file} ${tempfile1}; else setpermlike ${vendor_changed_file} ${tempfile1}; fi; mv -i ${tempfile1} ${merged_output_file}; else echo "No kdiff3 save detected--no changes made."; return 1; fi } tjmcustomize => () { local FACILITY='tjmcustomize'; local USAGE="${FACILITY} sourcedir destdir [filename]"; local sourcedir="${1%/}"; local destdir="${2%/}"; local filename="${3}"; local orig_save_extension='.orig.save'; local tempdir1="/tmp/${FACILITY}_${$}_1"; local highest_status; local return_status; set +f; if [ "${sourcedir}" = '' -o "${destdir}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -d ${sourcedir} ]; then :; else echo "${FACILITY}-E-NOEXISTS, directory does not exist: ${sourcedir}" 1>&2; return 1; fi; if [ -d ${destdir} ]; then :; else echo "${FACILITY}-E-NOEXISTS, directory does not exist: ${destdir}" 1>&2; return 1; fi; if [ "${filename}" = '' ]; then highest_status='0'; for filename in $(cd ${sourcedir} && find . | egrep -v '(\.orig$|tjmop_.*\.log|_TJMOLD|_NOINSTALL$|\.orig\.bak(_[0-9]+)*$)'); do if [ "${filename}" = "." ]; then :; else filename="${filename#./}"; tjmcustomizefile "${sourcedir}" "${destdir}" "${filename}"; return_status=${?}; if [ "${return_status}" -gt "${highest_status}" ]; then highest_status="${return_status}"; fi; fi; done; printf '\nChecking for *.rpm(new|orig|save) files in ${OPENPKG_ROOT}/etc... If any exist, please process them to avoid warning emails to root:\n'; ( cd ${OPENPKG_ROOT}/etc; find . -name '*.rpm*' ) | sed -e 's;^;\t;'; if [ "${highest_status}" != '0' ]; then return ${highest_status}; fi; else tjmcustomizefile "${sourcedir}" "${destdir}" "${filename}"; fi } tjmopsvncust => () { local FACILITY='tjmopsvncust'; local USAGE="${FACILITY} relative_cust_path su_user svn_user svn_pw svncms_wc_filesystems_host_user_path"; local relative_cust_path="${1%/}"; local su_user="${2}"; local svn_user="${3}"; local svn_pw="${4}"; local svncms_wc_filesystems_host_user_path="${5}"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local reconcile_only_trigger_filename=reconcile.only; local SVNCMS_ORIG_DIRNAME='orig'; local SVNCMS_CUST_DIRNAME='cust'; local return_status; set +f; if [ "${relative_cust_path}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ "${relative_cust_path}" = 'rootdir/home/openpkg' ]; then echo "Checking for *.rpm(new|orig|save) files in ${OPENPKG_ROOT}/etc... They must be processed promptly to avoid warning emails to root."; ( highest_status='0'; cd ${OPENPKG_ROOT} && { find etc -name '*.rpm*'; find .* -prune -name '.*.rpm*' } | sed -e 's!^./!!' | while read cur_file; do echo "${FACILITY}-I-PROCESSING, processing file: ${cur_file}" 1>&2; fname="${cur_file%.*}"; ftype="${cur_file##*.}"; case "${ftype}" in rpmsave) if [ -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname}" ]; then diff ${cur_file} ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname} >/dev/null 2>&1; if [ ${?} = 0 ]; then echo "${FACILITY}-I-RPMSAVE_DELETED, rpmsave deleted because it matches customized file: ${cur_file} " 1>&2; rm ${cur_file}; return_status=${?}; else echo "${FACILITY}-W-RPMSAVE_CUSTOM_DIFF, rpmsave and customized file are different. MANUALLY UPDATE SVNCMS'S CUSTOMIZED FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi; else echo "${FACILITY}-W-RPMSAVE_WITH_NO_CUSTOM, rpmsave with no associated customized file. MANUALLY ADD SVNCMS'S CUSTOMIZED FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi ;; rpmnew) if [ -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_ORIG_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname}" ]; then diff ${cur_file} ${svncms_wc_filesystems_host_user_path}/${SVNCMS_ORIG_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname} >/dev/null 2>&1; if [ ${?} = 0 ]; then echo "${FACILITY}-I-RPMNEW_DELETED, rpmnew deleted because it matches original: ${cur_file} " 1>&2; rm ${cur_file}; return_status=${?}; else echo "${FACILITY}-W-RPMNEW_ORIGINAL_DIFF, rpmnew and original are different. MANUALLY UPDATE SVNCMS'S ORIGINAL, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi; else echo "${FACILITY}-W-RPMNEW_WITH_NO_ORIGINAL, rpmnew with no associated original file. MANUALLY ADD SVNCMS'S ORIGINAL FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi ;; *) echo "${FACILITY}-E-UNKNOWN_RPM_FTYPE, unknown .rpm* file type: ${cur_file} " 1>&2; return_status=1 ;; esac; if [ "${return_status}" -gt "${highest_status}" ]; then highest_status="${return_status}"; fi; done; exit ${highest_status} ); return_status=${?}; if [ "${return_status}" != '0' ]; then return ${return_status}; fi; fi; ( if [ ! -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path}" ]; then echo "${FACILITY}-I-NO_CUSTS, no customizations--svncms ${SVNCMS_CUST_DIRNAME} directory does not exist: ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path}" 1>&2; else cd ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path} || exit ${?}; if [ -e "${reconcile_only_trigger_filename}" ]; then echo "${FACILITY}-W-RECONCILE_SKIP_ON_ACTIVE, reconcile is already active on path--skipping: path=${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path} info='$(cat ${reconcile_only_trigger_filename})'" 1>&2; else echo "Reconciling customizations with svncms for directory ${relative_cust_path}..."; echo "$(date +%EY%m%d%H%M%S) reconcile started by user $(whoami) pid ${$}" >${reconcile_only_trigger_filename}; svn add -q ${reconcile_only_trigger_filename}; svn commit --no-auth-cache --non-interactive --username "${svn_user}" --password "${svn_pw}" -m 'RECONCILE ONLY' ${reconcile_only_trigger_filename} >/dev/null 2>${tempfile1}; return_status=${?}; if [ "${return_status}" = '0' ]; then echo "${FACILITY}-E-BAD_RTN_STATUS, svn commit for RECONCILE returned 0 instead of 1--unexpected result." 1>&2; return_status=1; else return_status_precommit=$(sed -ne 's@^.*Commit blocked by pre-commit hook (exit code \([0-9]\+\)) with output:$@\1@p' < ${tempfile1} ); case "${return_status_precommit}" in 100) return_status=0 ;; 101) grep -vE '^(svn: Commit failed .details follow.:|svn: Commit blocked by pre-commit hook .* with output:|%.*, returning status [0-9]+)$' ${tempfile1} 1>&2; return_status=0 ;; 102) grep -vE '^(svn: Commit failed .details follow.:|svn: Commit blocked by pre-commit hook .* with output:|%.*, returning status [0-9]+)$' ${tempfile1} 1>&2; return_status=${return_status_precommit} ;; *) cat ${tempfile1} 1>&2; return_status=999 ;; esac; fi; svn revert -q ${reconcile_only_trigger_filename}; rm -f ${reconcile_only_trigger_filename}; exit ${return_status}; fi; fi ); return_status=${?}; rm -f ${tempfile1}; return ${return_status} } tjmoprediff_rpmsave => () { local FACILITY='tjmoprediff_rpmsave'; local USAGE="${FACILITY} full_path_to_openpkg_file"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local dir_name; local base_name; local openpkg_file; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ -f ${openpkg_file}.rpmsave ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.rpmsave"; return 1; fi; if [ -f ${openpkg_file}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.orig.save"; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_file}.orig.save ${openpkg_file}.rpmsave ${openpkg_file} ${tempfile1}; if [ -e ${tempfile1} ]; then backup_filename="$(tjmgetudfn ${openpkg_file}${backup_extension})"; mv -i ${openpkg_file}.rpmsave ${backup_filename}; mv -i ${openpkg_file} ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; fi } tjmop => () { local FACILITY='tjmop'; local USAGE="${FACILITY} [-xfpctmblsdauvrzRkCeEV] [\"-U [URI_Prefix URI_Suffix]\"] [\"--{with|without}_xxx [yes|no]\"]... [--{any openpkg --switch}]... {package_id}"; local OPT_x=0; local OPT_f=0; local OPT_p=0; local OPT_c=0; local OPT_t=0; local OPT_m=0; local OPT_b=0; local OPT_s=0; local OPT_a=0; local OPT_v=0; local OPT_u=0; local OPT_r=0; local OPT_R=0; local OPT_k=0; local OPT_z=0; local OPT_d=0; local OPT_U=0; local OPT_l=0; local OPT_C=0; local OPT_e=0; local OPT_E=0; local OPT_V=0; local rpm_debug_sw=''; local ARG_dash=''; local ARG_force=''; local ARG_U=''; local PKGOPTCNT=0; local package_id; local swname; local specfile; local swname_filter; local platform_filter; local pkg_filter; local pkg_build_dir; local pkg_bin_file; local curfilename; local filenames_count; local tempfile_prefix="/tmp/${FACILITY}_${$}_"; local cachefile_prefix="/tmp/${FACILITY}_"; local tjmop_all_status; local tjmop_fetch_status=''; local tjmop_recustomize_src_status=''; local tjmop_recustomize_all_status=''; local tjmop_prepare_status=''; local tjmop_compile_status=''; local tjmop_test_status=''; local tjmop_makeinstall_status=''; local tjmop_binarypkg_status=''; local tjmop_listbinpkg_status=''; local tjmop_sourcepkg_status=''; local tjmop_delpkg_status=''; local tjmop_addpkg_status=''; local tjmop_updpkg_status=''; local tjmop_verpkg_status=''; local tjmop_highest_build_phase_status='0'; set +f; OPTIND=1; while getopts ":xfpctmblsdauvrzRk-:U:CeEV" OPTFLAG; do case ${OPTFLAG} in x) OPT_x='1'; rpm_debug_sw=" -vv" ;; C) OPT_C='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; e) OPT_e='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; E) OPT_E='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; V) OPT_V='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; f) OPT_f='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; p) OPT_p='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; c) OPT_c='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; t) OPT_t='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; m) OPT_m='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; b) OPT_b='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; l) OPT_l='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; s) OPT_s='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; a) OPT_a='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; u) OPT_u='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; r) OPT_r='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; z) OPT_z='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; R) OPT_R='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; k) OPT_k='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; d) OPT_d='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; U) OPT_U='1'; ARG_U="${OPTARG}" ;; v) OPT_v='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; -) case ${OPTARG} in with*) ARG_dash="${ARG_dash} -D \"${OPTARG}\"" ;; force) ARG_force=" --${OPTARG}" ;; *) ARG_dash="${ARG_dash} --${OPTARG}" ;; esac ;; \?) echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1 ;; esac; done; shift $((${OPTIND} - 1)); if [ "${PKGOPTCNT}" != '0' ]; then if [ ${#} != '1' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; else if [ "${OPT_U}" != '1' ]; then echo "${FACILITY}-E-NOPKGACTION, no package action options specified: ${USAGE}" 1>&2; return 1; fi; fi; if [ "${OPT_x}" = '1' ]; then set -xv; else set +xv; fi; package_id="${1}"; swname="${package_id%%-[0-9]*}"; if [ "${OPT_U}" = '1' ]; then if [ "${ARG_U}" = '' ]; then echo "${FACILITY}-I-INFO, OpenPKG source location is set to ${OPENPKG_SOURCE_URI_PREFIX}<my package>${OPENPKG_SOURCE_URI_SUFFIX}" 1>&2; else set -- ${ARG_U}; if [ ${#} != '2' ]; then echo "${FACILITY}-E-INVURI, invalid URI syntax: ${USAGE}" 1>&2; tjmop_finalize; return 1; else export OPENPKG_SOURCE_URI_PREFIX="${1}"; export OPENPKG_SOURCE_URI_SUFFIX="${2}"; fi; fi; fi; tjmop_build_phase f fetch || { tjmop_finalize; return ${?} }; specfile=''; for curfilename in ${OPENPKG_ROOT}/RPM/SRC/${swname}/${swname}*.spec; do if [ -f ${curfilename} ]; then if [ "${specfile}" = '' ]; then specfile="${curfilename}"; else echo "${FACILITY}-E-MULTSPEC, multiple spec files detected--cannot determine which one to use: " ${OPENPKG_ROOT}/RPM/SRC/${swname}/*.spec 1>&2; tjmop_finalize; return 1; fi; fi; done; case ${swname} in config) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; esvn) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; ipfilter) pkg_filter="(ipfilter-|ip_fil)[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gcc3) pkg_filter="(gcc3|gcc)-[3][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gcc42) pkg_filter="(gcc42|gcc)-[4][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; glib) pkg_filter="glib-[1][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; glib2) pkg_filter="(glib2|glib)-[2][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gtk) pkg_filter="(gtk[+]|gtk)-[1][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gtk2) pkg_filter="(gtk[+]|gtk2)-[2][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; mm_mod_auth_ldap) pkg_filter="mm_mod_auth_ldap-*[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; mussh) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; perl-[a-z]*) pkg_filter="${package_id}-[0-9][0-9\.\-]*" ;; php4) pkg_filter="(php|php4)-[4][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; php5) pkg_filter="(php|php5)-[5][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; php-jpgraph) pkg_filter="(php-jpgraph|jpgraph)-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; xz) pkg_filter="(xz)-[0-9][0-9\.\-]*.*" ;; "${package_id}") case ${swname} in apache) swname_filter="(${swname}|httpd)" ;; gcrypt) swname_filter="(${swname}|libgcrypt)" ;; gpg-error) swname_filter="(${swname}|libgpg-error)" ;; libpixman) swname_filter="(${swname}|pixman)" ;; libxml) swname_filter="(${swname}|libxml2)" ;; pkgconfig) swname_filter="(${swname}|pkg-config)" ;; png) swname_filter="(${swname}|libpng)" ;; python-setup) swname_filter="(${swname}|setuptools)" ;; pysvn-workbench) swname_filter="(${swname}|WorkBench)" ;; qt) swname_filter="(${swname}|qt-x11-free)" ;; qt4) swname_filter="(${swname}|qt-(x11|everywhere)-opensource-src)" ;; sasl) swname_filter="(${swname}|cyrus-sasl)" ;; snmp) swname_filter="(${swname}|net-snmp)" ;; tcpwrappers) swname_filter="(${swname}|socket_wrappers)" ;; tetex) swname_filter="(${swname}|tetex-src)" ;; xft) swname_filter="(${swname}|libXft)" ;; wx) swname_filter="(${swname}|wxGTK|wxWidgets)" ;; wxpython) swname_filter="(${swname}|wxPython-src)" ;; *) swname_filter="${swname}" ;; esac; pkg_filter="${swname_filter}-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; *) pkg_filter="${package_id}.*" ;; esac; tjmop_build_phase r recustomize_src || { tjmop_finalize; return ${?} }; tjmop_build_phase p prepare || { tjmop_finalize; return ${?} }; tjmop_build_phase c compile || { tjmop_finalize; return ${?} }; tjmop_build_phase t test || { tjmop_finalize; return ${?} }; tjmop_build_phase m makeinstall || { tjmop_finalize; return ${?} }; platform_filter="$(echo ${OPENPKG_PLATFORM} | sed -e 's;\.;\\.;g')"; pkg_bin_file=$(cd ${OPENPKG_ROOT}/RPM/PKG/ && find * -prune -type f 2>/dev/null | egrep "^${pkg_filter}\.${platform_filter}-openpkg\.rpm$"); filenames_count=$(echo "${pkg_bin_file}" | wc -w); if [ ${filenames_count} -gt 1 ]; then echo "${FACILITY}-E-DUPDIR, multiple binary files for specified package in directory ${OPENPKG_ROOT}/RPM/PKG--must select only one: ${pkg_bin_file}" 1>&2; tjmop_finalize; return 1; fi; tjmop_build_phase b binarypkg || { tjmop_finalize; return ${?} }; pkg_bin_file=$(cd ${OPENPKG_ROOT}/RPM/PKG/ && find * -prune -type f 2>/dev/null | egrep "^${pkg_filter}\.${platform_filter}-openpkg\.rpm$"); filenames_count=$(echo "${pkg_bin_file}" | wc -w); if [ ${filenames_count} -gt 1 ]; then echo "${FACILITY}-E-DUPDIR, multiple binary files for specified package in directory ${OPENPKG_ROOT}/RPM/PKG--must select only one: ${pkg_bin_file}" 1>&2; tjmop_finalize; return 1; fi; tjmop_build_phase l listbinpkg || { tjmop_finalize; return ${?} }; tjmop_build_phase s sourcepkg || { tjmop_finalize; return ${?} }; tjmop_build_phase d delpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase a addpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase u updpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase v verpkg || { tjmop_finalize; return ${?} }; tjmop_build_phase z zap || { tjmop_finalize; return ${?} }; tjmop_build_phase R recustomize_all || { tjmop_finalize; return ${?} }; tjmop_build_phase k compare_src || { tjmop_finalize; return ${?} }; if [ "${OPT_V}" = '1' ]; then printf "Verify parsing: "; printf "swname=%-17s" "${swname}"; printf "package_id=%-17s" "${package_id}"; printf "pkg_build_dir=%-25s" "${pkg_build_dir}"; printf "pkg_bin_file=%-s" "${pkg_bin_file}"; printf "\n"; fi; tjmop_all_status=0; if [ "${OPT_e}" = '1' ]; then if [ "${tjmop_fetch_status}" '>' '0' -o "${tjmop_recustomize_src_status}" '>' '0' -o "${tjmop_prepare_status}" '>' '0' -o "${tjmop_compile_status}" '>' '0' -o "${tjmop_makeinstall_status}" '>' '0' -o "${tjmop_binarypkg_status}" '>' '0' -o "${tjmop_listbinpkg_status}" '>' '0' -o "${tjmop_sourcepkg_status}" '>' '0' -o "${tjmop_delpkg_status}" '>' '0' -o "${tjmop_addpkg_status}" '>' '0' -o "${tjmop_updpkg_status}" '>' '0' -o "${tjmop_recustomize_all_status}" '>' '0' -o '0' '>' '0' ]; then tjmop_all_status=1; fi; fi; if [ "${OPT_E}" = '1' ]; then tjmop_all_status=1; fi; if [ "${tjmop_all_status}" = '1' ]; then printf "Exit status: "; printf "%-17s" "${swname}"; printf " fetch=%-1s" "${tjmop_fetch_status}"; printf " recustomize_src=%-1s" "${tjmop_recustomize_src_status}"; printf " prepare=%-1s" "${tjmop_prepare_status}"; printf " compile=%-1s" "${tjmop_compile_status}"; printf " test=%-1s" "${tjmop_test_status}"; printf " makeinstall=%-1s" "${tjmop_makeinstall_status}"; printf " binarypkg=%-1s" "${tjmop_binarypkg_status}"; printf " listbinpkg=%-1s" "${tjmop_listbinpkg_status}"; printf " sourcepkg=%-1s" "${tjmop_sourcepkg_status}"; printf " delpkg=%-1s" "${tjmop_delpkg_status}"; printf " addpkg=%-1s" "${tjmop_addpkg_status}"; printf " updpkg=%-1s" "${tjmop_updpkg_status}"; printf " verpkg=%-1s" "${tjmop_verpkg_status}"; printf " recustomize_all=%-1s" "${tjmop_recustomize_all_status}"; printf "\n"; fi; tjmop_finalize; find ${tempfile_prefix}cache*.tmp -prune -type f -mtime +1 -exec rm {} \; 2>/dev/null; return 0 } tjmopapplytjmsavecust => () { local FACILITY='tjmopapplytjmsavecust'; local USAGE="${FACILITY} full_path_to_customized_openpkg_file [customization_directory]"; local openpkg_customized_file="${1}"; local openpkg_cust_dir="${2}"; local prior_to_cust_suffix="_tjmsave"; local dir_name; local base_name; local openpkg_file; local openpkg_file_prior_to_cust; local openpkg_cust_root_def="/home/openpkg_customizations"; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_customized_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_customized_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_customized_file}"; return 1; fi; dir_name=$(dirname ${openpkg_customized_file}); base_name=$(basename ${openpkg_customized_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); openpkg_file_prior_to_cust="${openpkg_file}${prior_to_cust_suffix}"; if [ -f ${openpkg_file_prior_to_cust} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file_prior_to_cust}"; return 1; fi; if [ "${openpkg_cust_dir}" = '' ]; then openpkg_cust_dir="${openpkg_cust_root_def}${dir_name}"; fi; openpkg_cust_dir="${openpkg_cust_dir%/}"; if [ -d ${openpkg_cust_dir} ]; then :; else echo "${FACILITY}-F-NOEXISTS, customization directory does not exist: ${openpkg_cust_dir}"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}"; return 1; fi; diff ${openpkg_file_prior_to_cust} ${openpkg_cust_dir}/${base_name} >/dev/null 2>&1; if [ ${?} != 0 ]; then echo "${FACILITY}-F-DIFFERENT, file prior to customization and file in the customization directory differ--changes shown here:" 1>&2; diff ${openpkg_file_prior_to_cust} ${openpkg_cust_dir}/${base_name} | sed -e "$(echo -e 's;^;\t;')"; return 1; fi; backup_filename="$(tjmgetudfn ${openpkg_cust_dir}/${base_name}${backup_extension})" && mv ${openpkg_cust_dir}/${base_name} ${backup_filename} && mv ${openpkg_file} ${openpkg_cust_dir}/${base_name} && mv ${openpkg_file_prior_to_cust} ${openpkg_file} && echo -e "${FACILITY}-I-CUSTAPPLIED, applied customized file ${openpkg_file} to ${openpkg_cust_dir}/${base_name}, previous version saved. These changes were applied:" 1>&2 && diff ${openpkg_cust_dir}/${base_name} ${backup_filename} | sed -e "$(echo -e 's;^;\t;')" } diffpermfile => () { local sourcedir="${1}"; local destdir="${2}"; local dirorfile="${3}"; local difflist; local perm; local owner_id; local group_id; local perm2; local owner_id2; local group_id2; find ${sourcedir}/${dirorfile} ${FIND_LS} -prune | sed -e 's;^ *[^ ]* *[^ ]* \(..........\) *[^ ]* \(.........\)\(.........\) *[^ ]* [A-Z].. .. ....[0-9] \([^ ]*\)\( -> .*\)*$;\1 \2 \3;' | while read perm owner_id group_id; do if [ -e ${destdir}/${dirorfile} ]; then find ${destdir}/${dirorfile} ${FIND_LS} -prune | sed -e 's;^ *[^ ]* *[^ ]* \(..........\) *[^ ]* \(.........\)\(.........\) *[^ ]* [A-Z].. .. ....[0-9] \([^ ]*\)\( -> .*\)*$;\1 \2 \3;' | while read perm2 owner_id2 group_id2; do perm_formatted=$(echo "${perm}" | nawk ' { mod_owner=substr($1,2,3) mod_group=substr($1,5,3) mod_other=substr($1,8,3) gsub("-", "", mod_owner) gsub("-", "", mod_group) gsub("-", "", mod_other) print "u=" mod_owner ",g=" mod_group ",o=" mod_other } ' ); difflist=""; if [ "${perm}" != "${perm2}" ]; then difflist="${difflist}P"; fi; if [ "${owner_id}" != "${owner_id2}" ]; then difflist="${difflist}O"; fi; if [ "${group_id}" != "${group_id2}" ]; then difflist="${difflist}G"; fi; if [ "${difflist}" != '' -a "${perm}" = "${perm##l*}" -a "${perm2}" = "${perm2##l*}" ]; then printf "\n"; printf "Permissions differ (%s). Execute the commands below to correct:\n" $difflist; printf "%-10s %-9s %-9s %-10s %-9s %-9s " ${perm} ${owner_id} ${group_id} ${perm2} ${owner_id2} ${group_id2}; printf "f=%-70s; chmod %s \$f; chown %s:%s \$f" ${destdir}/$dirorfile ${perm_formatted} ${owner_id} ${group_id}; printf "\n"; printf "\n"; fi; done; fi; done } tjmopdo => () { local FACILITY='tjmopdo'; local USAGE="${FACILITY} swlist_file swname_RSE tjmop_switches tjmop_package_options"; local swlist_file; local swname_RSE; local tjmop_switches; local tjmop_options; local swname; local reverse_cmd; local return_status; set +f; swlist_file="${1}"; shift; swname_RSE="${1}"; shift; tjmop_switches="${1}"; shift; tjmop_options="${*}"; if [ -f ${swlist_file} ]; then :; else echo "${FACILITY}-E-FNF, file not found: ${swlist_file}" 1>&2; return 1; fi; if [ "${tjmop_switches}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ "${tjmop_switches}" = "-d" -o "${tjmop_switches}" = "-dC" -o "${tjmop_switches}" = "-Cd" -o "${tjmop_switches}" = "-dCS" ]; then reverse_cmd="revlines"; else reverse_cmd="cat"; fi; grep -E "^${swname_RSE}([[:space:]]|$)" ${swlist_file} | eval "${reverse_cmd}" | while read package_id package_options; do if [ "${package_id###*}" = '' ]; then :; else swname="${package_id%%-[0-9]*}"; printf "Doing %-17s %-25s %s\n" "${swname}" "${package_id}" "${package_options}" 1>&2; eval "tjmop ${tjmop_switches} ${tjmop_options} ${package_options} ${swname}" </dev/null; return_status=${?}; if [ "${return_status}" = "130" -o "${build_phase_cur_status}" = "999" ]; then echo "${FACILITY}-F-STOP, stopping due to previous error" 1>&2; return ${return_status}; fi; fi; done } tjmgetudfn => () { local FACILITY='tjmgetudfn'; local USAGE="${FACILITY} desired_name"; local desired_name="${1}"; local unique_name; local seq_num; if [ "${desired_name}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; seq_num=$(tjmgethighseq "${desired_name}"); if [ "${seq_num}" = '' ]; then unique_name="${desired_name}"; else unique_name="${desired_name}_$((${seq_num} + 1))"; fi; echo "${unique_name}" } tjmoprediff => () { local FACILITY='tjmoprediff'; local USAGE="${FACILITY} full_path_to_openpkg_file [customization_directory]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local openpkg_cust_dir="${2}"; local dir_name; local base_name; local openpkg_file; local openpkg_cust_root_def="/home/openpkg_customizations"; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ "${openpkg_cust_dir}" = '' ]; then openpkg_cust_dir="${openpkg_cust_root_def}${dir_name}"; fi; openpkg_cust_dir="${openpkg_cust_dir%/}"; if [ -d ${openpkg_cust_dir} ]; then :; else echo "${FACILITY}-F-NOEXISTS, customization directory does not exist: ${openpkg_cust_dir}"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}.orig.save"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}"; return 1; fi; if [ -e ${openpkg_file}.rpmsave ]; then diff ${openpkg_cust_dir}/${base_name} ${openpkg_file}.rpmsave >/dev/null 2>&1; if [ ${?} = 0 ]; then rm ${openpkg_file}.rpmsave; else echo -e "${openpkg_file}.rpmsave exists. Use tjmoprediff_rpmsave to retain customizations."; return 1; fi; fi; if [ -e ${openpkg_file}.rpmnew ]; then echo -e "${openpkg_file}.rpmnew exists. Use tjmoprediff_rpmnew to retain customizations."; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_cust_dir}/${base_name}.orig.save ${openpkg_cust_dir}/${base_name} ${openpkg_file} ${tempfile1}; if [ -e ${tempfile1} ]; then mv -i ${openpkg_file} ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; cp -ip ${openpkg_file}.orig.save ${openpkg_cust_dir}/${base_name}.orig.save; cp -ip ${openpkg_file} ${openpkg_cust_dir}/${base_name}; fi } PHP Variables Variable => Value _SERVER["MANPATH"] => /openpkg/man:/openpkg/local/man::/usr/share/man _SERVER["OPENPKG_PKGGROUP"] => opkg _SERVER["M4"] => /openpkg/bin/m4 _SERVER["TEST_PHP_SRCDIR"] => /openpkg/RPM/TMP/php-5.3.9 _SERVER["OPENPKG_PKGUSER"] => opkg _SERVER["SHELL"] => /openpkg/lib/openpkg/bash _SERVER["TERM"] => vt220 _SERVER["MAKEFLAGS"] => _SERVER["OPENPKG_DOWNLOAD_CURL_FILTER"] => grep 'class="file"' | sed -e 's!.*td valign!!;s!img .*!!;s!.*href!!;s!.*"\(.*\)".*!\1!' _SERVER["SSH_CLIENT"] => deleted _SERVER["TMPDIR"] => /tmp _SERVER["OPENPKG_SOURCE_URI_SUFFIX"] => -${OPENPKG_TAG}.src.rpm _SERVER["SSH_TTY"] => deleted _SERVER["OPENPKG_ROOT"] => /openpkg _SERVER["USER"] => opkg _SERVER["LD_LIBRARY_PATH"] => /openpkg/lib:/openpkg/local/lib::/lib:/usr/lib _SERVER["SSH_AUTH_SOCK"] => deleted _SERVER["OPENPKG_TAG"] => ${OPENPKG_REL}.${OPENPKG_SUBREL} _SERVER["MAKELEVEL"] => 1 _SERVER["OPENPKG_REL"] => 2.5 _SERVER["MFLAGS"] => _SERVER["PATH"] => /openpkg/bin:/openpkg/sbin:/openpkg/local/bin:/openpkg/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ucb _SERVER["_"] => /openpkg/RPM/TMP/php-5.3.9/sapi/cli/php _SERVER["LC_COLLATE"] => C _SERVER["BLOCKSIZE"] => 1024 _SERVER["OPENPKG_PLATFORM"] => ix86-rhel4 _SERVER["PWD"] => /openpkg/RPM/TMP/php-5.3.9 _SERVER["TEST_PHP_EXECUTABLE"] => /openpkg/RPM/TMP/php-5.3.9/sapi/cli/php _SERVER["OPENPKG_DOWNLOAD_URL_PREFIX"] => http://download.openpkg.org _SERVER["HOME"] => /openpkg _SERVER["SHLVL"] => 3 _SERVER["OPENPKG_SUBREL"] => 1 _SERVER["LOGNAME"] => opkg _SERVER["SSH_CONNECTION"] => deleted _SERVER["OPENPKG_DOWNLOAD_CURL_USER_PW"] => -u 804941a8-0525-11df-8345-000e0c4e71a6:anypw _SERVER["INFOPATH"] => /openpkg/info:/openpkg/local/info::/usr/share/info _SERVER["DISPLAY"] => localhost:10.0 _SERVER["CC"] => /openpkg/bin/gcc _SERVER["OPENPKG_SOURCE_URI_PREFIX"] => http://download.openpkg.org/packages/current/source/ _SERVER["setpermlike"] => () { local FACILITY='setpermlike'; local USAGE="${FACILITY} Permissions_Source_Filespec Permissions_Destination_Filespec"; local permsource_file="${1}"; local permdest_file="${2}"; set +f; if [ "${permsource_file}" = '' -o "${permdest_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; set -f; ls -ald ${permsource_file} | head -1 | nawk -v filename=${permdest_file} ' { #mod_dir=substr($1,1,1) mod_owner=substr($1,2,3) mod_group=substr($1,5,3) mod_other=substr($1,8,3) #gsub("-", "", mod_dir) gsub("-", "", mod_owner) gsub("-", "", mod_group) gsub("-", "", mod_other) owner_id=$3 group_id=$4 chmod_cmd="chmod u=" mod_owner ",g=" mod_group ",o=" mod_other " " filename chown_cmd="chown " $3 ":" $4 " " filename #print chmod_cmd system(chmod_cmd) #print chown_cmd system(chown_cmd) } '; set +f; return } _SERVER["tarcopy"] => () { local sourcedir="${1}"; local destdir="${2}"; local dirorfile="${3}"; if [ "${sourcedir}" = '' ]; then echo "sourcedir not specified: ${sourcedir}"; return 1; fi; if [ "${destdir}" = '' ]; then echo "destdir not specified: ${destdir}"; return 1; fi; if [ "${dirorfile}" = '' ]; then echo "dirorfile not specified"; return 1; fi; if [ "${sourcedir}" = "${destdir}" ]; then echo "destdir must not be same as sourcedir"; return 1; fi; if [ -d ${sourcedir} ]; then :; else echo "sourcedir does not exist: ${sourcedir}"; return 1; fi; if [ -d ${destdir} ]; then :; else echo "destdir does not exist: ${destdir}"; return 1; fi; if [ -e ${sourcedir}/${dirorfile} ]; then :; else echo "sourcedir/dirorfile does not exist: ${sourcedir}/${dirorfile}"; return 1; fi; ( cd ${sourcedir} && tar -cf - ${dirorfile} ) | ( cd ${destdir} && tar -xf - ) } _SERVER["shswopnew"] => () { local FACILITY='shswopnew'; local USAGE="${FACILITY} [-adfloruv]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local tempfile2="/tmp/${FACILITY}_${$}_2.tmp"; local tracefile1; local tracefile2; local joinoutput; local OPT_a=0; local OPT_d=0; local OPT_f=0; local OPT_l=0; local OPT_o=0; local OPT_r=0; local OPT_u=0; local OPT_v=0; OPTIND=1; while getopts ":adfloruv" OPTFLAG; do case ${OPTFLAG} in a) OPT_a='1' ;; d) OPT_d='1' ;; f) OPT_f='1' ;; l) OPT_l='1' ;; o) OPT_o='1' ;; r) OPT_r='1' ;; u) OPT_u='1' ;; v) OPT_v='1' ;; \?) echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1 ;; esac; done; shift $((${OPTIND} - 1)); tjmop -f no_package 2>/dev/null; shswop | sort -u | sed -e 's;-\([0-9]\);\t\1;' >${tempfile1}; cat /tmp/tjmop_cache?.tmp | grep -Ev '^openpkg-[0-9].*\.src\.sh$' | sed -e 's/\.src\.rpm$//' | sort -u | sed -e 's;-\([0-9]\);\t\1;' | grep -v -f /home/openpkg_customizations/tjm_openpkg/tjmop_swinstall_openpkg_excludes.dat >${tempfile2}; join -j 1 -o 1.1,2.1,1.2,2.2 -e "*No_Match*" -a 1 ${tempfile1} ${tempfile2} | while read pkgID1 pkgID2 pkgver1 pkgver2; do if [ "${pkgver1}" = "${pkgver2}" ]; then return_status=0; else tjmcompare_versions "${pkgver1}" "${pkgver2}"; return_status=${?}; if [ "${OPT_o}" = '1' ]; then if [ "${return_status}" = '2' ]; then :; else return_status=0; fi; else if [ "${return_status}" = '1' ]; then :; else return_status=0; fi; fi; fi; pkgver_norel1="${pkgver1%-*}"; pkgver_norel2="${pkgver2%-*}"; if [ "${OPT_a}" = '1' -a "${pkgID2}" != '*No_Match*' ]; then return_status=0; else if [ "${OPT_u}" = '1' -a "${pkgID2}" = '*No_Match*' ]; then return_status=0; else if [ "${OPT_r}" = '1' ]; then if [ "${pkgver_norel1}" != "${pkgver_norel2}" -o "${pkgID2}" = '*No_Match*' ]; then return_status=0; fi; else if [ "${OPT_v}" = '1' ]; then if [ "${pkgver_norel1}" = "${pkgver_norel2}" -o "${pkgID2}" = '*No_Match*' ]; then return_status=0; fi; fi; fi; fi; fi; if [ "${return_status}" != '0' ]; then if [ "${OPT_f}" = '1' ]; then echo "tjmop -fr ${pkgID1} # Upgrade from ${pkgver1} to ${pkgver2}"; else if [ "${OPT_d}" = '1' -o "${OPT_l}" = '1' ]; then echo "${pkgID1}"; else echo "${pkgID1} ${pkgver1} ${pkgver2} ${return_status}"; fi; fi; fi; done | if [ "${OPT_d}" = '1' ]; then tr '\n' '|' | sed -e 's@|$@\n@'; else if [ "${OPT_f}" = '1' -o "${OPT_l}" = '1' ]; then cat; else nawk ' BEGIN { printf "%17-s %21-s %21-s %20-s\n\n","Package","Installed","Available","Only Release Differs" } { pkgID=$1 #if(pkgID == "*No_Match*") pkgID=$2 #pkgver1=$3 #pkgver2=$4 #vercompare=$5 pkgver1=$2 pkgver2=$3 vercompare=$4 pkgver1max=split(pkgver1,pkgver1array,"-") pkgver2max=split(pkgver2,pkgver2array,"-") if(pkgver1array[1] == pkgver2array[1]) { only_release_differs="*New_Release_Only**" } else { only_release_differs="" } #if(pkgver1 != pkgver2) printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs # TJM 04/21/10 Do not list when installed version is newer than available version. #if(vercompare == 1) printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs # } '; fi; fi; rm ${tempfile1}; rm ${tempfile2}; return } _SERVER["tjmgethighseq"] => () { local FACILITY='tjmgethighseq'; local USAGE="${FACILITY} desired_name"; local desired_name="${1}"; local seq_num; if [ "${desired_name}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; seq_num=$(ls -d ${desired_name}* 2>/dev/null | sed -ne "s;^${desired_name}\(_[0-9]\+\|\)$;0\1;p" | sed -e 's;^0_;;' | sort -nr | head -1); echo "${seq_num}" } _SERVER["tjmoprediff_rpmnew"] => () { local FACILITY='tjmoprediff_rpmnew'; local USAGE="${FACILITY} full_path_to_openpkg_file"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local dir_name; local base_name; local openpkg_file; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ -f ${openpkg_file}.rpmnew ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.rpmnew"; return 1; fi; if [ -f ${openpkg_file}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.orig.save"; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_file}.orig.save ${openpkg_file} ${openpkg_file}.rpmnew ${tempfile1}; if [ -e ${tempfile1} ]; then backup_filename="$(tjmgetudfn ${openpkg_file}${backup_extension})"; mv -i ${openpkg_file} ${backup_filename}; mv -i ${openpkg_file}.rpmnew ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; fi } _SERVER["tjmopkdiff3_merge"] => () { local FACILITY='tjmopkdiff3_merge'; local USAGE="${FACILITY} base_original_vendor_file locally_customized_original_file vendor_changed_file [merged_output_file]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local base_original_vendor_file="${1}"; local locally_customized_original_file="${2}"; local vendor_changed_file="${3}"; local merged_output_file="${4}"; if [ "${base_original_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${base_original_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${base_original_vendor_file}"; return 1; fi; if [ "${locally_customized_original_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${locally_customized_original_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${locally_customized_original_file}"; return 1; fi; if [ "${vendor_changed_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${vendor_changed_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${vendor_changed_file}"; return 1; fi; if [ "${merged_output_file}" = '' ]; then merged_output_file="${vendor_changed_file}"; fi; rm -f ${tempfile1}; kdiff3 -m ${base_original_vendor_file} ${locally_customized_original_file} ${vendor_changed_file} -o ${tempfile1}; if [ -e ${tempfile1} ]; then if [ -f ${merged_output_file} ]; then setpermlike ${merged_output_file} ${tempfile1}; else setpermlike ${vendor_changed_file} ${tempfile1}; fi; mv -i ${tempfile1} ${merged_output_file}; else echo "No kdiff3 save detected--no changes made."; return 1; fi } _SERVER["tjmcustomize"] => () { local FACILITY='tjmcustomize'; local USAGE="${FACILITY} sourcedir destdir [filename]"; local sourcedir="${1%/}"; local destdir="${2%/}"; local filename="${3}"; local orig_save_extension='.orig.save'; local tempdir1="/tmp/${FACILITY}_${$}_1"; local highest_status; local return_status; set +f; if [ "${sourcedir}" = '' -o "${destdir}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -d ${sourcedir} ]; then :; else echo "${FACILITY}-E-NOEXISTS, directory does not exist: ${sourcedir}" 1>&2; return 1; fi; if [ -d ${destdir} ]; then :; else echo "${FACILITY}-E-NOEXISTS, directory does not exist: ${destdir}" 1>&2; return 1; fi; if [ "${filename}" = '' ]; then highest_status='0'; for filename in $(cd ${sourcedir} && find . | egrep -v '(\.orig$|tjmop_.*\.log|_TJMOLD|_NOINSTALL$|\.orig\.bak(_[0-9]+)*$)'); do if [ "${filename}" = "." ]; then :; else filename="${filename#./}"; tjmcustomizefile "${sourcedir}" "${destdir}" "${filename}"; return_status=${?}; if [ "${return_status}" -gt "${highest_status}" ]; then highest_status="${return_status}"; fi; fi; done; printf '\nChecking for *.rpm(new|orig|save) files in ${OPENPKG_ROOT}/etc... If any exist, please process them to avoid warning emails to root:\n'; ( cd ${OPENPKG_ROOT}/etc; find . -name '*.rpm*' ) | sed -e 's;^;\t;'; if [ "${highest_status}" != '0' ]; then return ${highest_status}; fi; else tjmcustomizefile "${sourcedir}" "${destdir}" "${filename}"; fi } _SERVER["tjmopsvncust"] => () { local FACILITY='tjmopsvncust'; local USAGE="${FACILITY} relative_cust_path su_user svn_user svn_pw svncms_wc_filesystems_host_user_path"; local relative_cust_path="${1%/}"; local su_user="${2}"; local svn_user="${3}"; local svn_pw="${4}"; local svncms_wc_filesystems_host_user_path="${5}"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local reconcile_only_trigger_filename=reconcile.only; local SVNCMS_ORIG_DIRNAME='orig'; local SVNCMS_CUST_DIRNAME='cust'; local return_status; set +f; if [ "${relative_cust_path}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ "${relative_cust_path}" = 'rootdir/home/openpkg' ]; then echo "Checking for *.rpm(new|orig|save) files in ${OPENPKG_ROOT}/etc... They must be processed promptly to avoid warning emails to root."; ( highest_status='0'; cd ${OPENPKG_ROOT} && { find etc -name '*.rpm*'; find .* -prune -name '.*.rpm*' } | sed -e 's!^./!!' | while read cur_file; do echo "${FACILITY}-I-PROCESSING, processing file: ${cur_file}" 1>&2; fname="${cur_file%.*}"; ftype="${cur_file##*.}"; case "${ftype}" in rpmsave) if [ -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname}" ]; then diff ${cur_file} ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname} >/dev/null 2>&1; if [ ${?} = 0 ]; then echo "${FACILITY}-I-RPMSAVE_DELETED, rpmsave deleted because it matches customized file: ${cur_file} " 1>&2; rm ${cur_file}; return_status=${?}; else echo "${FACILITY}-W-RPMSAVE_CUSTOM_DIFF, rpmsave and customized file are different. MANUALLY UPDATE SVNCMS'S CUSTOMIZED FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi; else echo "${FACILITY}-W-RPMSAVE_WITH_NO_CUSTOM, rpmsave with no associated customized file. MANUALLY ADD SVNCMS'S CUSTOMIZED FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi ;; rpmnew) if [ -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_ORIG_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname}" ]; then diff ${cur_file} ${svncms_wc_filesystems_host_user_path}/${SVNCMS_ORIG_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname} >/dev/null 2>&1; if [ ${?} = 0 ]; then echo "${FACILITY}-I-RPMNEW_DELETED, rpmnew deleted because it matches original: ${cur_file} " 1>&2; rm ${cur_file}; return_status=${?}; else echo "${FACILITY}-W-RPMNEW_ORIGINAL_DIFF, rpmnew and original are different. MANUALLY UPDATE SVNCMS'S ORIGINAL, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi; else echo "${FACILITY}-W-RPMNEW_WITH_NO_ORIGINAL, rpmnew with no associated original file. MANUALLY ADD SVNCMS'S ORIGINAL FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi ;; *) echo "${FACILITY}-E-UNKNOWN_RPM_FTYPE, unknown .rpm* file type: ${cur_file} " 1>&2; return_status=1 ;; esac; if [ "${return_status}" -gt "${highest_status}" ]; then highest_status="${return_status}"; fi; done; exit ${highest_status} ); return_status=${?}; if [ "${return_status}" != '0' ]; then return ${return_status}; fi; fi; ( if [ ! -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path}" ]; then echo "${FACILITY}-I-NO_CUSTS, no customizations--svncms ${SVNCMS_CUST_DIRNAME} directory does not exist: ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path}" 1>&2; else cd ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path} || exit ${?}; if [ -e "${reconcile_only_trigger_filename}" ]; then echo "${FACILITY}-W-RECONCILE_SKIP_ON_ACTIVE, reconcile is already active on path--skipping: path=${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path} info='$(cat ${reconcile_only_trigger_filename})'" 1>&2; else echo "Reconciling customizations with svncms for directory ${relative_cust_path}..."; echo "$(date +%EY%m%d%H%M%S) reconcile started by user $(whoami) pid ${$}" >${reconcile_only_trigger_filename}; svn add -q ${reconcile_only_trigger_filename}; svn commit --no-auth-cache --non-interactive --username "${svn_user}" --password "${svn_pw}" -m 'RECONCILE ONLY' ${reconcile_only_trigger_filename} >/dev/null 2>${tempfile1}; return_status=${?}; if [ "${return_status}" = '0' ]; then echo "${FACILITY}-E-BAD_RTN_STATUS, svn commit for RECONCILE returned 0 instead of 1--unexpected result." 1>&2; return_status=1; else return_status_precommit=$(sed -ne 's@^.*Commit blocked by pre-commit hook (exit code \([0-9]\+\)) with output:$@\1@p' < ${tempfile1} ); case "${return_status_precommit}" in 100) return_status=0 ;; 101) grep -vE '^(svn: Commit failed .details follow.:|svn: Commit blocked by pre-commit hook .* with output:|%.*, returning status [0-9]+)$' ${tempfile1} 1>&2; return_status=0 ;; 102) grep -vE '^(svn: Commit failed .details follow.:|svn: Commit blocked by pre-commit hook .* with output:|%.*, returning status [0-9]+)$' ${tempfile1} 1>&2; return_status=${return_status_precommit} ;; *) cat ${tempfile1} 1>&2; return_status=999 ;; esac; fi; svn revert -q ${reconcile_only_trigger_filename}; rm -f ${reconcile_only_trigger_filename}; exit ${return_status}; fi; fi ); return_status=${?}; rm -f ${tempfile1}; return ${return_status} } _SERVER["tjmoprediff_rpmsave"] => () { local FACILITY='tjmoprediff_rpmsave'; local USAGE="${FACILITY} full_path_to_openpkg_file"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local dir_name; local base_name; local openpkg_file; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ -f ${openpkg_file}.rpmsave ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.rpmsave"; return 1; fi; if [ -f ${openpkg_file}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.orig.save"; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_file}.orig.save ${openpkg_file}.rpmsave ${openpkg_file} ${tempfile1}; if [ -e ${tempfile1} ]; then backup_filename="$(tjmgetudfn ${openpkg_file}${backup_extension})"; mv -i ${openpkg_file}.rpmsave ${backup_filename}; mv -i ${openpkg_file} ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; fi } _SERVER["tjmop"] => () { local FACILITY='tjmop'; local USAGE="${FACILITY} [-xfpctmblsdauvrzRkCeEV] [\"-U [URI_Prefix URI_Suffix]\"] [\"--{with|without}_xxx [yes|no]\"]... [--{any openpkg --switch}]... {package_id}"; local OPT_x=0; local OPT_f=0; local OPT_p=0; local OPT_c=0; local OPT_t=0; local OPT_m=0; local OPT_b=0; local OPT_s=0; local OPT_a=0; local OPT_v=0; local OPT_u=0; local OPT_r=0; local OPT_R=0; local OPT_k=0; local OPT_z=0; local OPT_d=0; local OPT_U=0; local OPT_l=0; local OPT_C=0; local OPT_e=0; local OPT_E=0; local OPT_V=0; local rpm_debug_sw=''; local ARG_dash=''; local ARG_force=''; local ARG_U=''; local PKGOPTCNT=0; local package_id; local swname; local specfile; local swname_filter; local platform_filter; local pkg_filter; local pkg_build_dir; local pkg_bin_file; local curfilename; local filenames_count; local tempfile_prefix="/tmp/${FACILITY}_${$}_"; local cachefile_prefix="/tmp/${FACILITY}_"; local tjmop_all_status; local tjmop_fetch_status=''; local tjmop_recustomize_src_status=''; local tjmop_recustomize_all_status=''; local tjmop_prepare_status=''; local tjmop_compile_status=''; local tjmop_test_status=''; local tjmop_makeinstall_status=''; local tjmop_binarypkg_status=''; local tjmop_listbinpkg_status=''; local tjmop_sourcepkg_status=''; local tjmop_delpkg_status=''; local tjmop_addpkg_status=''; local tjmop_updpkg_status=''; local tjmop_verpkg_status=''; local tjmop_highest_build_phase_status='0'; set +f; OPTIND=1; while getopts ":xfpctmblsdauvrzRk-:U:CeEV" OPTFLAG; do case ${OPTFLAG} in x) OPT_x='1'; rpm_debug_sw=" -vv" ;; C) OPT_C='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; e) OPT_e='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; E) OPT_E='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; V) OPT_V='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; f) OPT_f='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; p) OPT_p='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; c) OPT_c='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; t) OPT_t='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; m) OPT_m='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; b) OPT_b='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; l) OPT_l='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; s) OPT_s='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; a) OPT_a='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; u) OPT_u='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; r) OPT_r='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; z) OPT_z='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; R) OPT_R='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; k) OPT_k='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; d) OPT_d='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; U) OPT_U='1'; ARG_U="${OPTARG}" ;; v) OPT_v='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; -) case ${OPTARG} in with*) ARG_dash="${ARG_dash} -D \"${OPTARG}\"" ;; force) ARG_force=" --${OPTARG}" ;; *) ARG_dash="${ARG_dash} --${OPTARG}" ;; esac ;; \?) echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1 ;; esac; done; shift $((${OPTIND} - 1)); if [ "${PKGOPTCNT}" != '0' ]; then if [ ${#} != '1' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; else if [ "${OPT_U}" != '1' ]; then echo "${FACILITY}-E-NOPKGACTION, no package action options specified: ${USAGE}" 1>&2; return 1; fi; fi; if [ "${OPT_x}" = '1' ]; then set -xv; else set +xv; fi; package_id="${1}"; swname="${package_id%%-[0-9]*}"; if [ "${OPT_U}" = '1' ]; then if [ "${ARG_U}" = '' ]; then echo "${FACILITY}-I-INFO, OpenPKG source location is set to ${OPENPKG_SOURCE_URI_PREFIX}<my package>${OPENPKG_SOURCE_URI_SUFFIX}" 1>&2; else set -- ${ARG_U}; if [ ${#} != '2' ]; then echo "${FACILITY}-E-INVURI, invalid URI syntax: ${USAGE}" 1>&2; tjmop_finalize; return 1; else export OPENPKG_SOURCE_URI_PREFIX="${1}"; export OPENPKG_SOURCE_URI_SUFFIX="${2}"; fi; fi; fi; tjmop_build_phase f fetch || { tjmop_finalize; return ${?} }; specfile=''; for curfilename in ${OPENPKG_ROOT}/RPM/SRC/${swname}/${swname}*.spec; do if [ -f ${curfilename} ]; then if [ "${specfile}" = '' ]; then specfile="${curfilename}"; else echo "${FACILITY}-E-MULTSPEC, multiple spec files detected--cannot determine which one to use: " ${OPENPKG_ROOT}/RPM/SRC/${swname}/*.spec 1>&2; tjmop_finalize; return 1; fi; fi; done; case ${swname} in config) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; esvn) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; ipfilter) pkg_filter="(ipfilter-|ip_fil)[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gcc3) pkg_filter="(gcc3|gcc)-[3][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gcc42) pkg_filter="(gcc42|gcc)-[4][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; glib) pkg_filter="glib-[1][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; glib2) pkg_filter="(glib2|glib)-[2][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gtk) pkg_filter="(gtk[+]|gtk)-[1][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gtk2) pkg_filter="(gtk[+]|gtk2)-[2][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; mm_mod_auth_ldap) pkg_filter="mm_mod_auth_ldap-*[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; mussh) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; perl-[a-z]*) pkg_filter="${package_id}-[0-9][0-9\.\-]*" ;; php4) pkg_filter="(php|php4)-[4][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; php5) pkg_filter="(php|php5)-[5][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; php-jpgraph) pkg_filter="(php-jpgraph|jpgraph)-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; xz) pkg_filter="(xz)-[0-9][0-9\.\-]*.*" ;; "${package_id}") case ${swname} in apache) swname_filter="(${swname}|httpd)" ;; gcrypt) swname_filter="(${swname}|libgcrypt)" ;; gpg-error) swname_filter="(${swname}|libgpg-error)" ;; libpixman) swname_filter="(${swname}|pixman)" ;; libxml) swname_filter="(${swname}|libxml2)" ;; pkgconfig) swname_filter="(${swname}|pkg-config)" ;; png) swname_filter="(${swname}|libpng)" ;; python-setup) swname_filter="(${swname}|setuptools)" ;; pysvn-workbench) swname_filter="(${swname}|WorkBench)" ;; qt) swname_filter="(${swname}|qt-x11-free)" ;; qt4) swname_filter="(${swname}|qt-(x11|everywhere)-opensource-src)" ;; sasl) swname_filter="(${swname}|cyrus-sasl)" ;; snmp) swname_filter="(${swname}|net-snmp)" ;; tcpwrappers) swname_filter="(${swname}|socket_wrappers)" ;; tetex) swname_filter="(${swname}|tetex-src)" ;; xft) swname_filter="(${swname}|libXft)" ;; wx) swname_filter="(${swname}|wxGTK|wxWidgets)" ;; wxpython) swname_filter="(${swname}|wxPython-src)" ;; *) swname_filter="${swname}" ;; esac; pkg_filter="${swname_filter}-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; *) pkg_filter="${package_id}.*" ;; esac; tjmop_build_phase r recustomize_src || { tjmop_finalize; return ${?} }; tjmop_build_phase p prepare || { tjmop_finalize; return ${?} }; tjmop_build_phase c compile || { tjmop_finalize; return ${?} }; tjmop_build_phase t test || { tjmop_finalize; return ${?} }; tjmop_build_phase m makeinstall || { tjmop_finalize; return ${?} }; platform_filter="$(echo ${OPENPKG_PLATFORM} | sed -e 's;\.;\\.;g')"; pkg_bin_file=$(cd ${OPENPKG_ROOT}/RPM/PKG/ && find * -prune -type f 2>/dev/null | egrep "^${pkg_filter}\.${platform_filter}-openpkg\.rpm$"); filenames_count=$(echo "${pkg_bin_file}" | wc -w); if [ ${filenames_count} -gt 1 ]; then echo "${FACILITY}-E-DUPDIR, multiple binary files for specified package in directory ${OPENPKG_ROOT}/RPM/PKG--must select only one: ${pkg_bin_file}" 1>&2; tjmop_finalize; return 1; fi; tjmop_build_phase b binarypkg || { tjmop_finalize; return ${?} }; pkg_bin_file=$(cd ${OPENPKG_ROOT}/RPM/PKG/ && find * -prune -type f 2>/dev/null | egrep "^${pkg_filter}\.${platform_filter}-openpkg\.rpm$"); filenames_count=$(echo "${pkg_bin_file}" | wc -w); if [ ${filenames_count} -gt 1 ]; then echo "${FACILITY}-E-DUPDIR, multiple binary files for specified package in directory ${OPENPKG_ROOT}/RPM/PKG--must select only one: ${pkg_bin_file}" 1>&2; tjmop_finalize; return 1; fi; tjmop_build_phase l listbinpkg || { tjmop_finalize; return ${?} }; tjmop_build_phase s sourcepkg || { tjmop_finalize; return ${?} }; tjmop_build_phase d delpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase a addpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase u updpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase v verpkg || { tjmop_finalize; return ${?} }; tjmop_build_phase z zap || { tjmop_finalize; return ${?} }; tjmop_build_phase R recustomize_all || { tjmop_finalize; return ${?} }; tjmop_build_phase k compare_src || { tjmop_finalize; return ${?} }; if [ "${OPT_V}" = '1' ]; then printf "Verify parsing: "; printf "swname=%-17s" "${swname}"; printf "package_id=%-17s" "${package_id}"; printf "pkg_build_dir=%-25s" "${pkg_build_dir}"; printf "pkg_bin_file=%-s" "${pkg_bin_file}"; printf "\n"; fi; tjmop_all_status=0; if [ "${OPT_e}" = '1' ]; then if [ "${tjmop_fetch_status}" '>' '0' -o "${tjmop_recustomize_src_status}" '>' '0' -o "${tjmop_prepare_status}" '>' '0' -o "${tjmop_compile_status}" '>' '0' -o "${tjmop_makeinstall_status}" '>' '0' -o "${tjmop_binarypkg_status}" '>' '0' -o "${tjmop_listbinpkg_status}" '>' '0' -o "${tjmop_sourcepkg_status}" '>' '0' -o "${tjmop_delpkg_status}" '>' '0' -o "${tjmop_addpkg_status}" '>' '0' -o "${tjmop_updpkg_status}" '>' '0' -o "${tjmop_recustomize_all_status}" '>' '0' -o '0' '>' '0' ]; then tjmop_all_status=1; fi; fi; if [ "${OPT_E}" = '1' ]; then tjmop_all_status=1; fi; if [ "${tjmop_all_status}" = '1' ]; then printf "Exit status: "; printf "%-17s" "${swname}"; printf " fetch=%-1s" "${tjmop_fetch_status}"; printf " recustomize_src=%-1s" "${tjmop_recustomize_src_status}"; printf " prepare=%-1s" "${tjmop_prepare_status}"; printf " compile=%-1s" "${tjmop_compile_status}"; printf " test=%-1s" "${tjmop_test_status}"; printf " makeinstall=%-1s" "${tjmop_makeinstall_status}"; printf " binarypkg=%-1s" "${tjmop_binarypkg_status}"; printf " listbinpkg=%-1s" "${tjmop_listbinpkg_status}"; printf " sourcepkg=%-1s" "${tjmop_sourcepkg_status}"; printf " delpkg=%-1s" "${tjmop_delpkg_status}"; printf " addpkg=%-1s" "${tjmop_addpkg_status}"; printf " updpkg=%-1s" "${tjmop_updpkg_status}"; printf " verpkg=%-1s" "${tjmop_verpkg_status}"; printf " recustomize_all=%-1s" "${tjmop_recustomize_all_status}"; printf "\n"; fi; tjmop_finalize; find ${tempfile_prefix}cache*.tmp -prune -type f -mtime +1 -exec rm {} \; 2>/dev/null; return 0 } _SERVER["tjmopapplytjmsavecust"] => () { local FACILITY='tjmopapplytjmsavecust'; local USAGE="${FACILITY} full_path_to_customized_openpkg_file [customization_directory]"; local openpkg_customized_file="${1}"; local openpkg_cust_dir="${2}"; local prior_to_cust_suffix="_tjmsave"; local dir_name; local base_name; local openpkg_file; local openpkg_file_prior_to_cust; local openpkg_cust_root_def="/home/openpkg_customizations"; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_customized_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_customized_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_customized_file}"; return 1; fi; dir_name=$(dirname ${openpkg_customized_file}); base_name=$(basename ${openpkg_customized_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); openpkg_file_prior_to_cust="${openpkg_file}${prior_to_cust_suffix}"; if [ -f ${openpkg_file_prior_to_cust} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file_prior_to_cust}"; return 1; fi; if [ "${openpkg_cust_dir}" = '' ]; then openpkg_cust_dir="${openpkg_cust_root_def}${dir_name}"; fi; openpkg_cust_dir="${openpkg_cust_dir%/}"; if [ -d ${openpkg_cust_dir} ]; then :; else echo "${FACILITY}-F-NOEXISTS, customization directory does not exist: ${openpkg_cust_dir}"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}"; return 1; fi; diff ${openpkg_file_prior_to_cust} ${openpkg_cust_dir}/${base_name} >/dev/null 2>&1; if [ ${?} != 0 ]; then echo "${FACILITY}-F-DIFFERENT, file prior to customization and file in the customization directory differ--changes shown here:" 1>&2; diff ${openpkg_file_prior_to_cust} ${openpkg_cust_dir}/${base_name} | sed -e "$(echo -e 's;^;\t;')"; return 1; fi; backup_filename="$(tjmgetudfn ${openpkg_cust_dir}/${base_name}${backup_extension})" && mv ${openpkg_cust_dir}/${base_name} ${backup_filename} && mv ${openpkg_file} ${openpkg_cust_dir}/${base_name} && mv ${openpkg_file_prior_to_cust} ${openpkg_file} && echo -e "${FACILITY}-I-CUSTAPPLIED, applied customized file ${openpkg_file} to ${openpkg_cust_dir}/${base_name}, previous version saved. These changes were applied:" 1>&2 && diff ${openpkg_cust_dir}/${base_name} ${backup_filename} | sed -e "$(echo -e 's;^;\t;')" } _SERVER["diffpermfile"] => () { local sourcedir="${1}"; local destdir="${2}"; local dirorfile="${3}"; local difflist; local perm; local owner_id; local group_id; local perm2; local owner_id2; local group_id2; find ${sourcedir}/${dirorfile} ${FIND_LS} -prune | sed -e 's;^ *[^ ]* *[^ ]* \(..........\) *[^ ]* \(.........\)\(.........\) *[^ ]* [A-Z].. .. ....[0-9] \([^ ]*\)\( -> .*\)*$;\1 \2 \3;' | while read perm owner_id group_id; do if [ -e ${destdir}/${dirorfile} ]; then find ${destdir}/${dirorfile} ${FIND_LS} -prune | sed -e 's;^ *[^ ]* *[^ ]* \(..........\) *[^ ]* \(.........\)\(.........\) *[^ ]* [A-Z].. .. ....[0-9] \([^ ]*\)\( -> .*\)*$;\1 \2 \3;' | while read perm2 owner_id2 group_id2; do perm_formatted=$(echo "${perm}" | nawk ' { mod_owner=substr($1,2,3) mod_group=substr($1,5,3) mod_other=substr($1,8,3) gsub("-", "", mod_owner) gsub("-", "", mod_group) gsub("-", "", mod_other) print "u=" mod_owner ",g=" mod_group ",o=" mod_other } ' ); difflist=""; if [ "${perm}" != "${perm2}" ]; then difflist="${difflist}P"; fi; if [ "${owner_id}" != "${owner_id2}" ]; then difflist="${difflist}O"; fi; if [ "${group_id}" != "${group_id2}" ]; then difflist="${difflist}G"; fi; if [ "${difflist}" != '' -a "${perm}" = "${perm##l*}" -a "${perm2}" = "${perm2##l*}" ]; then printf "\n"; printf "Permissions differ (%s). Execute the commands below to correct:\n" $difflist; printf "%-10s %-9s %-9s %-10s %-9s %-9s " ${perm} ${owner_id} ${group_id} ${perm2} ${owner_id2} ${group_id2}; printf "f=%-70s; chmod %s \$f; chown %s:%s \$f" ${destdir}/$dirorfile ${perm_formatted} ${owner_id} ${group_id}; printf "\n"; printf "\n"; fi; done; fi; done } _SERVER["tjmopdo"] => () { local FACILITY='tjmopdo'; local USAGE="${FACILITY} swlist_file swname_RSE tjmop_switches tjmop_package_options"; local swlist_file; local swname_RSE; local tjmop_switches; local tjmop_options; local swname; local reverse_cmd; local return_status; set +f; swlist_file="${1}"; shift; swname_RSE="${1}"; shift; tjmop_switches="${1}"; shift; tjmop_options="${*}"; if [ -f ${swlist_file} ]; then :; else echo "${FACILITY}-E-FNF, file not found: ${swlist_file}" 1>&2; return 1; fi; if [ "${tjmop_switches}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ "${tjmop_switches}" = "-d" -o "${tjmop_switches}" = "-dC" -o "${tjmop_switches}" = "-Cd" -o "${tjmop_switches}" = "-dCS" ]; then reverse_cmd="revlines"; else reverse_cmd="cat"; fi; grep -E "^${swname_RSE}([[:space:]]|$)" ${swlist_file} | eval "${reverse_cmd}" | while read package_id package_options; do if [ "${package_id###*}" = '' ]; then :; else swname="${package_id%%-[0-9]*}"; printf "Doing %-17s %-25s %s\n" "${swname}" "${package_id}" "${package_options}" 1>&2; eval "tjmop ${tjmop_switches} ${tjmop_options} ${package_options} ${swname}" </dev/null; return_status=${?}; if [ "${return_status}" = "130" -o "${build_phase_cur_status}" = "999" ]; then echo "${FACILITY}-F-STOP, stopping due to previous error" 1>&2; return ${return_status}; fi; fi; done } _SERVER["tjmgetudfn"] => () { local FACILITY='tjmgetudfn'; local USAGE="${FACILITY} desired_name"; local desired_name="${1}"; local unique_name; local seq_num; if [ "${desired_name}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; seq_num=$(tjmgethighseq "${desired_name}"); if [ "${seq_num}" = '' ]; then unique_name="${desired_name}"; else unique_name="${desired_name}_$((${seq_num} + 1))"; fi; echo "${unique_name}" } _SERVER["tjmoprediff"] => () { local FACILITY='tjmoprediff'; local USAGE="${FACILITY} full_path_to_openpkg_file [customization_directory]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local openpkg_cust_dir="${2}"; local dir_name; local base_name; local openpkg_file; local openpkg_cust_root_def="/home/openpkg_customizations"; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ "${openpkg_cust_dir}" = '' ]; then openpkg_cust_dir="${openpkg_cust_root_def}${dir_name}"; fi; openpkg_cust_dir="${openpkg_cust_dir%/}"; if [ -d ${openpkg_cust_dir} ]; then :; else echo "${FACILITY}-F-NOEXISTS, customization directory does not exist: ${openpkg_cust_dir}"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}.orig.save"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}"; return 1; fi; if [ -e ${openpkg_file}.rpmsave ]; then diff ${openpkg_cust_dir}/${base_name} ${openpkg_file}.rpmsave >/dev/null 2>&1; if [ ${?} = 0 ]; then rm ${openpkg_file}.rpmsave; else echo -e "${openpkg_file}.rpmsave exists. Use tjmoprediff_rpmsave to retain customizations."; return 1; fi; fi; if [ -e ${openpkg_file}.rpmnew ]; then echo -e "${openpkg_file}.rpmnew exists. Use tjmoprediff_rpmnew to retain customizations."; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_cust_dir}/${base_name}.orig.save ${openpkg_cust_dir}/${base_name} ${openpkg_file} ${tempfile1}; if [ -e ${tempfile1} ]; then mv -i ${openpkg_file} ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; cp -ip ${openpkg_file}.orig.save ${openpkg_cust_dir}/${base_name}.orig.save; cp -ip ${openpkg_file} ${openpkg_cust_dir}/${base_name}; fi } _SERVER["PHP_SELF"] => _SERVER["SCRIPT_NAME"] => _SERVER["SCRIPT_FILENAME"] => _SERVER["PATH_TRANSLATED"] => _SERVER["DOCUMENT_ROOT"] => _SERVER["REQUEST_TIME"] => 1326817038 _SERVER["argv"] => Array ( ) _SERVER["argc"] => 0 _ENV["MANPATH"] => /openpkg/man:/openpkg/local/man::/usr/share/man _ENV["OPENPKG_PKGGROUP"] => opkg _ENV["M4"] => /openpkg/bin/m4 _ENV["TEST_PHP_SRCDIR"] => /openpkg/RPM/TMP/php-5.3.9 _ENV["OPENPKG_PKGUSER"] => opkg _ENV["SHELL"] => /openpkg/lib/openpkg/bash _ENV["TERM"] => vt220 _ENV["MAKEFLAGS"] => _ENV["OPENPKG_DOWNLOAD_CURL_FILTER"] => grep 'class="file"' | sed -e 's!.*td valign!!;s!img .*!!;s!.*href!!;s!.*"\(.*\)".*!\1!' _ENV["SSH_CLIENT"] => deleted _ENV["TMPDIR"] => /tmp _ENV["OPENPKG_SOURCE_URI_SUFFIX"] => -${OPENPKG_TAG}.src.rpm _ENV["SSH_TTY"] => deleted _ENV["OPENPKG_ROOT"] => /openpkg _ENV["USER"] => opkg _ENV["LD_LIBRARY_PATH"] => /openpkg/lib:/openpkg/local/lib::/lib:/usr/lib _ENV["SSH_AUTH_SOCK"] => deleted _ENV["OPENPKG_TAG"] => ${OPENPKG_REL}.${OPENPKG_SUBREL} _ENV["MAKELEVEL"] => 1 _ENV["OPENPKG_REL"] => 2.5 _ENV["MFLAGS"] => _ENV["PATH"] => /openpkg/bin:/openpkg/sbin:/openpkg/local/bin:/openpkg/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/ucb _ENV["_"] => /openpkg/RPM/TMP/php-5.3.9/sapi/cli/php _ENV["LC_COLLATE"] => C _ENV["BLOCKSIZE"] => 1024 _ENV["OPENPKG_PLATFORM"] => ix86-rhel4 _ENV["PWD"] => /openpkg/RPM/TMP/php-5.3.9 _ENV["TEST_PHP_EXECUTABLE"] => /openpkg/RPM/TMP/php-5.3.9/sapi/cli/php _ENV["OPENPKG_DOWNLOAD_URL_PREFIX"] => http://download.openpkg.org _ENV["HOME"] => /openpkg _ENV["SHLVL"] => 3 _ENV["OPENPKG_SUBREL"] => 1 _ENV["LOGNAME"] => opkg _ENV["SSH_CONNECTION"] => deleted _ENV["OPENPKG_DOWNLOAD_CURL_USER_PW"] => -u 804941a8-0525-11df-8345-000e0c4e71a6:anypw _ENV["INFOPATH"] => /openpkg/info:/openpkg/local/info::/usr/share/info _ENV["DISPLAY"] => localhost:10.0 _ENV["CC"] => /openpkg/bin/gcc _ENV["OPENPKG_SOURCE_URI_PREFIX"] => http://download.openpkg.org/packages/current/source/ _ENV["setpermlike"] => () { local FACILITY='setpermlike'; local USAGE="${FACILITY} Permissions_Source_Filespec Permissions_Destination_Filespec"; local permsource_file="${1}"; local permdest_file="${2}"; set +f; if [ "${permsource_file}" = '' -o "${permdest_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; set -f; ls -ald ${permsource_file} | head -1 | nawk -v filename=${permdest_file} ' { #mod_dir=substr($1,1,1) mod_owner=substr($1,2,3) mod_group=substr($1,5,3) mod_other=substr($1,8,3) #gsub("-", "", mod_dir) gsub("-", "", mod_owner) gsub("-", "", mod_group) gsub("-", "", mod_other) owner_id=$3 group_id=$4 chmod_cmd="chmod u=" mod_owner ",g=" mod_group ",o=" mod_other " " filename chown_cmd="chown " $3 ":" $4 " " filename #print chmod_cmd system(chmod_cmd) #print chown_cmd system(chown_cmd) } '; set +f; return } _ENV["tarcopy"] => () { local sourcedir="${1}"; local destdir="${2}"; local dirorfile="${3}"; if [ "${sourcedir}" = '' ]; then echo "sourcedir not specified: ${sourcedir}"; return 1; fi; if [ "${destdir}" = '' ]; then echo "destdir not specified: ${destdir}"; return 1; fi; if [ "${dirorfile}" = '' ]; then echo "dirorfile not specified"; return 1; fi; if [ "${sourcedir}" = "${destdir}" ]; then echo "destdir must not be same as sourcedir"; return 1; fi; if [ -d ${sourcedir} ]; then :; else echo "sourcedir does not exist: ${sourcedir}"; return 1; fi; if [ -d ${destdir} ]; then :; else echo "destdir does not exist: ${destdir}"; return 1; fi; if [ -e ${sourcedir}/${dirorfile} ]; then :; else echo "sourcedir/dirorfile does not exist: ${sourcedir}/${dirorfile}"; return 1; fi; ( cd ${sourcedir} && tar -cf - ${dirorfile} ) | ( cd ${destdir} && tar -xf - ) } _ENV["shswopnew"] => () { local FACILITY='shswopnew'; local USAGE="${FACILITY} [-adfloruv]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local tempfile2="/tmp/${FACILITY}_${$}_2.tmp"; local tracefile1; local tracefile2; local joinoutput; local OPT_a=0; local OPT_d=0; local OPT_f=0; local OPT_l=0; local OPT_o=0; local OPT_r=0; local OPT_u=0; local OPT_v=0; OPTIND=1; while getopts ":adfloruv" OPTFLAG; do case ${OPTFLAG} in a) OPT_a='1' ;; d) OPT_d='1' ;; f) OPT_f='1' ;; l) OPT_l='1' ;; o) OPT_o='1' ;; r) OPT_r='1' ;; u) OPT_u='1' ;; v) OPT_v='1' ;; \?) echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1 ;; esac; done; shift $((${OPTIND} - 1)); tjmop -f no_package 2>/dev/null; shswop | sort -u | sed -e 's;-\([0-9]\);\t\1;' >${tempfile1}; cat /tmp/tjmop_cache?.tmp | grep -Ev '^openpkg-[0-9].*\.src\.sh$' | sed -e 's/\.src\.rpm$//' | sort -u | sed -e 's;-\([0-9]\);\t\1;' | grep -v -f /home/openpkg_customizations/tjm_openpkg/tjmop_swinstall_openpkg_excludes.dat >${tempfile2}; join -j 1 -o 1.1,2.1,1.2,2.2 -e "*No_Match*" -a 1 ${tempfile1} ${tempfile2} | while read pkgID1 pkgID2 pkgver1 pkgver2; do if [ "${pkgver1}" = "${pkgver2}" ]; then return_status=0; else tjmcompare_versions "${pkgver1}" "${pkgver2}"; return_status=${?}; if [ "${OPT_o}" = '1' ]; then if [ "${return_status}" = '2' ]; then :; else return_status=0; fi; else if [ "${return_status}" = '1' ]; then :; else return_status=0; fi; fi; fi; pkgver_norel1="${pkgver1%-*}"; pkgver_norel2="${pkgver2%-*}"; if [ "${OPT_a}" = '1' -a "${pkgID2}" != '*No_Match*' ]; then return_status=0; else if [ "${OPT_u}" = '1' -a "${pkgID2}" = '*No_Match*' ]; then return_status=0; else if [ "${OPT_r}" = '1' ]; then if [ "${pkgver_norel1}" != "${pkgver_norel2}" -o "${pkgID2}" = '*No_Match*' ]; then return_status=0; fi; else if [ "${OPT_v}" = '1' ]; then if [ "${pkgver_norel1}" = "${pkgver_norel2}" -o "${pkgID2}" = '*No_Match*' ]; then return_status=0; fi; fi; fi; fi; fi; if [ "${return_status}" != '0' ]; then if [ "${OPT_f}" = '1' ]; then echo "tjmop -fr ${pkgID1} # Upgrade from ${pkgver1} to ${pkgver2}"; else if [ "${OPT_d}" = '1' -o "${OPT_l}" = '1' ]; then echo "${pkgID1}"; else echo "${pkgID1} ${pkgver1} ${pkgver2} ${return_status}"; fi; fi; fi; done | if [ "${OPT_d}" = '1' ]; then tr '\n' '|' | sed -e 's@|$@\n@'; else if [ "${OPT_f}" = '1' -o "${OPT_l}" = '1' ]; then cat; else nawk ' BEGIN { printf "%17-s %21-s %21-s %20-s\n\n","Package","Installed","Available","Only Release Differs" } { pkgID=$1 #if(pkgID == "*No_Match*") pkgID=$2 #pkgver1=$3 #pkgver2=$4 #vercompare=$5 pkgver1=$2 pkgver2=$3 vercompare=$4 pkgver1max=split(pkgver1,pkgver1array,"-") pkgver2max=split(pkgver2,pkgver2array,"-") if(pkgver1array[1] == pkgver2array[1]) { only_release_differs="*New_Release_Only**" } else { only_release_differs="" } #if(pkgver1 != pkgver2) printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs # TJM 04/21/10 Do not list when installed version is newer than available version. #if(vercompare == 1) printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs printf "%17-s %21-s %21-s %20-s\n",pkgID,pkgver1,pkgver2,only_release_differs # } '; fi; fi; rm ${tempfile1}; rm ${tempfile2}; return } _ENV["tjmgethighseq"] => () { local FACILITY='tjmgethighseq'; local USAGE="${FACILITY} desired_name"; local desired_name="${1}"; local seq_num; if [ "${desired_name}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; seq_num=$(ls -d ${desired_name}* 2>/dev/null | sed -ne "s;^${desired_name}\(_[0-9]\+\|\)$;0\1;p" | sed -e 's;^0_;;' | sort -nr | head -1); echo "${seq_num}" } _ENV["tjmoprediff_rpmnew"] => () { local FACILITY='tjmoprediff_rpmnew'; local USAGE="${FACILITY} full_path_to_openpkg_file"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local dir_name; local base_name; local openpkg_file; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ -f ${openpkg_file}.rpmnew ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.rpmnew"; return 1; fi; if [ -f ${openpkg_file}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.orig.save"; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_file}.orig.save ${openpkg_file} ${openpkg_file}.rpmnew ${tempfile1}; if [ -e ${tempfile1} ]; then backup_filename="$(tjmgetudfn ${openpkg_file}${backup_extension})"; mv -i ${openpkg_file} ${backup_filename}; mv -i ${openpkg_file}.rpmnew ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; fi } _ENV["tjmopkdiff3_merge"] => () { local FACILITY='tjmopkdiff3_merge'; local USAGE="${FACILITY} base_original_vendor_file locally_customized_original_file vendor_changed_file [merged_output_file]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local base_original_vendor_file="${1}"; local locally_customized_original_file="${2}"; local vendor_changed_file="${3}"; local merged_output_file="${4}"; if [ "${base_original_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${base_original_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${base_original_vendor_file}"; return 1; fi; if [ "${locally_customized_original_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${locally_customized_original_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${locally_customized_original_file}"; return 1; fi; if [ "${vendor_changed_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${vendor_changed_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${vendor_changed_file}"; return 1; fi; if [ "${merged_output_file}" = '' ]; then merged_output_file="${vendor_changed_file}"; fi; rm -f ${tempfile1}; kdiff3 -m ${base_original_vendor_file} ${locally_customized_original_file} ${vendor_changed_file} -o ${tempfile1}; if [ -e ${tempfile1} ]; then if [ -f ${merged_output_file} ]; then setpermlike ${merged_output_file} ${tempfile1}; else setpermlike ${vendor_changed_file} ${tempfile1}; fi; mv -i ${tempfile1} ${merged_output_file}; else echo "No kdiff3 save detected--no changes made."; return 1; fi } _ENV["tjmcustomize"] => () { local FACILITY='tjmcustomize'; local USAGE="${FACILITY} sourcedir destdir [filename]"; local sourcedir="${1%/}"; local destdir="${2%/}"; local filename="${3}"; local orig_save_extension='.orig.save'; local tempdir1="/tmp/${FACILITY}_${$}_1"; local highest_status; local return_status; set +f; if [ "${sourcedir}" = '' -o "${destdir}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -d ${sourcedir} ]; then :; else echo "${FACILITY}-E-NOEXISTS, directory does not exist: ${sourcedir}" 1>&2; return 1; fi; if [ -d ${destdir} ]; then :; else echo "${FACILITY}-E-NOEXISTS, directory does not exist: ${destdir}" 1>&2; return 1; fi; if [ "${filename}" = '' ]; then highest_status='0'; for filename in $(cd ${sourcedir} && find . | egrep -v '(\.orig$|tjmop_.*\.log|_TJMOLD|_NOINSTALL$|\.orig\.bak(_[0-9]+)*$)'); do if [ "${filename}" = "." ]; then :; else filename="${filename#./}"; tjmcustomizefile "${sourcedir}" "${destdir}" "${filename}"; return_status=${?}; if [ "${return_status}" -gt "${highest_status}" ]; then highest_status="${return_status}"; fi; fi; done; printf '\nChecking for *.rpm(new|orig|save) files in ${OPENPKG_ROOT}/etc... If any exist, please process them to avoid warning emails to root:\n'; ( cd ${OPENPKG_ROOT}/etc; find . -name '*.rpm*' ) | sed -e 's;^;\t;'; if [ "${highest_status}" != '0' ]; then return ${highest_status}; fi; else tjmcustomizefile "${sourcedir}" "${destdir}" "${filename}"; fi } _ENV["tjmopsvncust"] => () { local FACILITY='tjmopsvncust'; local USAGE="${FACILITY} relative_cust_path su_user svn_user svn_pw svncms_wc_filesystems_host_user_path"; local relative_cust_path="${1%/}"; local su_user="${2}"; local svn_user="${3}"; local svn_pw="${4}"; local svncms_wc_filesystems_host_user_path="${5}"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local reconcile_only_trigger_filename=reconcile.only; local SVNCMS_ORIG_DIRNAME='orig'; local SVNCMS_CUST_DIRNAME='cust'; local return_status; set +f; if [ "${relative_cust_path}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ "${relative_cust_path}" = 'rootdir/home/openpkg' ]; then echo "Checking for *.rpm(new|orig|save) files in ${OPENPKG_ROOT}/etc... They must be processed promptly to avoid warning emails to root."; ( highest_status='0'; cd ${OPENPKG_ROOT} && { find etc -name '*.rpm*'; find .* -prune -name '.*.rpm*' } | sed -e 's!^./!!' | while read cur_file; do echo "${FACILITY}-I-PROCESSING, processing file: ${cur_file}" 1>&2; fname="${cur_file%.*}"; ftype="${cur_file##*.}"; case "${ftype}" in rpmsave) if [ -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname}" ]; then diff ${cur_file} ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname} >/dev/null 2>&1; if [ ${?} = 0 ]; then echo "${FACILITY}-I-RPMSAVE_DELETED, rpmsave deleted because it matches customized file: ${cur_file} " 1>&2; rm ${cur_file}; return_status=${?}; else echo "${FACILITY}-W-RPMSAVE_CUSTOM_DIFF, rpmsave and customized file are different. MANUALLY UPDATE SVNCMS'S CUSTOMIZED FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi; else echo "${FACILITY}-W-RPMSAVE_WITH_NO_CUSTOM, rpmsave with no associated customized file. MANUALLY ADD SVNCMS'S CUSTOMIZED FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi ;; rpmnew) if [ -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_ORIG_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname}" ]; then diff ${cur_file} ${svncms_wc_filesystems_host_user_path}/${SVNCMS_ORIG_DIRNAME}/rootdir/home${OPENPKG_ROOT}/${fname} >/dev/null 2>&1; if [ ${?} = 0 ]; then echo "${FACILITY}-I-RPMNEW_DELETED, rpmnew deleted because it matches original: ${cur_file} " 1>&2; rm ${cur_file}; return_status=${?}; else echo "${FACILITY}-W-RPMNEW_ORIGINAL_DIFF, rpmnew and original are different. MANUALLY UPDATE SVNCMS'S ORIGINAL, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi; else echo "${FACILITY}-W-RPMNEW_WITH_NO_ORIGINAL, rpmnew with no associated original file. MANUALLY ADD SVNCMS'S ORIGINAL FILE, IF APPROPRIATE, AND DELETE THIS FILE: ${cur_file} " 1>&2; return_status=1; fi ;; *) echo "${FACILITY}-E-UNKNOWN_RPM_FTYPE, unknown .rpm* file type: ${cur_file} " 1>&2; return_status=1 ;; esac; if [ "${return_status}" -gt "${highest_status}" ]; then highest_status="${return_status}"; fi; done; exit ${highest_status} ); return_status=${?}; if [ "${return_status}" != '0' ]; then return ${return_status}; fi; fi; ( if [ ! -e "${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path}" ]; then echo "${FACILITY}-I-NO_CUSTS, no customizations--svncms ${SVNCMS_CUST_DIRNAME} directory does not exist: ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path}" 1>&2; else cd ${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path} || exit ${?}; if [ -e "${reconcile_only_trigger_filename}" ]; then echo "${FACILITY}-W-RECONCILE_SKIP_ON_ACTIVE, reconcile is already active on path--skipping: path=${svncms_wc_filesystems_host_user_path}/${SVNCMS_CUST_DIRNAME}/${relative_cust_path} info='$(cat ${reconcile_only_trigger_filename})'" 1>&2; else echo "Reconciling customizations with svncms for directory ${relative_cust_path}..."; echo "$(date +%EY%m%d%H%M%S) reconcile started by user $(whoami) pid ${$}" >${reconcile_only_trigger_filename}; svn add -q ${reconcile_only_trigger_filename}; svn commit --no-auth-cache --non-interactive --username "${svn_user}" --password "${svn_pw}" -m 'RECONCILE ONLY' ${reconcile_only_trigger_filename} >/dev/null 2>${tempfile1}; return_status=${?}; if [ "${return_status}" = '0' ]; then echo "${FACILITY}-E-BAD_RTN_STATUS, svn commit for RECONCILE returned 0 instead of 1--unexpected result." 1>&2; return_status=1; else return_status_precommit=$(sed -ne 's@^.*Commit blocked by pre-commit hook (exit code \([0-9]\+\)) with output:$@\1@p' < ${tempfile1} ); case "${return_status_precommit}" in 100) return_status=0 ;; 101) grep -vE '^(svn: Commit failed .details follow.:|svn: Commit blocked by pre-commit hook .* with output:|%.*, returning status [0-9]+)$' ${tempfile1} 1>&2; return_status=0 ;; 102) grep -vE '^(svn: Commit failed .details follow.:|svn: Commit blocked by pre-commit hook .* with output:|%.*, returning status [0-9]+)$' ${tempfile1} 1>&2; return_status=${return_status_precommit} ;; *) cat ${tempfile1} 1>&2; return_status=999 ;; esac; fi; svn revert -q ${reconcile_only_trigger_filename}; rm -f ${reconcile_only_trigger_filename}; exit ${return_status}; fi; fi ); return_status=${?}; rm -f ${tempfile1}; return ${return_status} } _ENV["tjmoprediff_rpmsave"] => () { local FACILITY='tjmoprediff_rpmsave'; local USAGE="${FACILITY} full_path_to_openpkg_file"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local dir_name; local base_name; local openpkg_file; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ -f ${openpkg_file}.rpmsave ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.rpmsave"; return 1; fi; if [ -f ${openpkg_file}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file}.orig.save"; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_file}.orig.save ${openpkg_file}.rpmsave ${openpkg_file} ${tempfile1}; if [ -e ${tempfile1} ]; then backup_filename="$(tjmgetudfn ${openpkg_file}${backup_extension})"; mv -i ${openpkg_file}.rpmsave ${backup_filename}; mv -i ${openpkg_file} ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; fi } _ENV["tjmop"] => () { local FACILITY='tjmop'; local USAGE="${FACILITY} [-xfpctmblsdauvrzRkCeEV] [\"-U [URI_Prefix URI_Suffix]\"] [\"--{with|without}_xxx [yes|no]\"]... [--{any openpkg --switch}]... {package_id}"; local OPT_x=0; local OPT_f=0; local OPT_p=0; local OPT_c=0; local OPT_t=0; local OPT_m=0; local OPT_b=0; local OPT_s=0; local OPT_a=0; local OPT_v=0; local OPT_u=0; local OPT_r=0; local OPT_R=0; local OPT_k=0; local OPT_z=0; local OPT_d=0; local OPT_U=0; local OPT_l=0; local OPT_C=0; local OPT_e=0; local OPT_E=0; local OPT_V=0; local rpm_debug_sw=''; local ARG_dash=''; local ARG_force=''; local ARG_U=''; local PKGOPTCNT=0; local package_id; local swname; local specfile; local swname_filter; local platform_filter; local pkg_filter; local pkg_build_dir; local pkg_bin_file; local curfilename; local filenames_count; local tempfile_prefix="/tmp/${FACILITY}_${$}_"; local cachefile_prefix="/tmp/${FACILITY}_"; local tjmop_all_status; local tjmop_fetch_status=''; local tjmop_recustomize_src_status=''; local tjmop_recustomize_all_status=''; local tjmop_prepare_status=''; local tjmop_compile_status=''; local tjmop_test_status=''; local tjmop_makeinstall_status=''; local tjmop_binarypkg_status=''; local tjmop_listbinpkg_status=''; local tjmop_sourcepkg_status=''; local tjmop_delpkg_status=''; local tjmop_addpkg_status=''; local tjmop_updpkg_status=''; local tjmop_verpkg_status=''; local tjmop_highest_build_phase_status='0'; set +f; OPTIND=1; while getopts ":xfpctmblsdauvrzRk-:U:CeEV" OPTFLAG; do case ${OPTFLAG} in x) OPT_x='1'; rpm_debug_sw=" -vv" ;; C) OPT_C='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; e) OPT_e='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; E) OPT_E='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; V) OPT_V='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; f) OPT_f='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; p) OPT_p='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; c) OPT_c='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; t) OPT_t='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; m) OPT_m='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; b) OPT_b='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; l) OPT_l='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; s) OPT_s='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; a) OPT_a='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; u) OPT_u='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; r) OPT_r='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; z) OPT_z='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; R) OPT_R='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; k) OPT_k='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; d) OPT_d='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; U) OPT_U='1'; ARG_U="${OPTARG}" ;; v) OPT_v='1'; PKGOPTCNT=$((${PKGOPTCNT} + 1)) ;; -) case ${OPTARG} in with*) ARG_dash="${ARG_dash} -D \"${OPTARG}\"" ;; force) ARG_force=" --${OPTARG}" ;; *) ARG_dash="${ARG_dash} --${OPTARG}" ;; esac ;; \?) echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1 ;; esac; done; shift $((${OPTIND} - 1)); if [ "${PKGOPTCNT}" != '0' ]; then if [ ${#} != '1' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; else if [ "${OPT_U}" != '1' ]; then echo "${FACILITY}-E-NOPKGACTION, no package action options specified: ${USAGE}" 1>&2; return 1; fi; fi; if [ "${OPT_x}" = '1' ]; then set -xv; else set +xv; fi; package_id="${1}"; swname="${package_id%%-[0-9]*}"; if [ "${OPT_U}" = '1' ]; then if [ "${ARG_U}" = '' ]; then echo "${FACILITY}-I-INFO, OpenPKG source location is set to ${OPENPKG_SOURCE_URI_PREFIX}<my package>${OPENPKG_SOURCE_URI_SUFFIX}" 1>&2; else set -- ${ARG_U}; if [ ${#} != '2' ]; then echo "${FACILITY}-E-INVURI, invalid URI syntax: ${USAGE}" 1>&2; tjmop_finalize; return 1; else export OPENPKG_SOURCE_URI_PREFIX="${1}"; export OPENPKG_SOURCE_URI_SUFFIX="${2}"; fi; fi; fi; tjmop_build_phase f fetch || { tjmop_finalize; return ${?} }; specfile=''; for curfilename in ${OPENPKG_ROOT}/RPM/SRC/${swname}/${swname}*.spec; do if [ -f ${curfilename} ]; then if [ "${specfile}" = '' ]; then specfile="${curfilename}"; else echo "${FACILITY}-E-MULTSPEC, multiple spec files detected--cannot determine which one to use: " ${OPENPKG_ROOT}/RPM/SRC/${swname}/*.spec 1>&2; tjmop_finalize; return 1; fi; fi; done; case ${swname} in config) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; esvn) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; ipfilter) pkg_filter="(ipfilter-|ip_fil)[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gcc3) pkg_filter="(gcc3|gcc)-[3][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gcc42) pkg_filter="(gcc42|gcc)-[4][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; glib) pkg_filter="glib-[1][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; glib2) pkg_filter="(glib2|glib)-[2][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gtk) pkg_filter="(gtk[+]|gtk)-[1][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; gtk2) pkg_filter="(gtk[+]|gtk2)-[2][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; mm_mod_auth_ldap) pkg_filter="mm_mod_auth_ldap-*[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; mussh) pkg_filter="${package_id}(-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*)?" ;; perl-[a-z]*) pkg_filter="${package_id}-[0-9][0-9\.\-]*" ;; php4) pkg_filter="(php|php4)-[4][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; php5) pkg_filter="(php|php5)-[5][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; php-jpgraph) pkg_filter="(php-jpgraph|jpgraph)-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; xz) pkg_filter="(xz)-[0-9][0-9\.\-]*.*" ;; "${package_id}") case ${swname} in apache) swname_filter="(${swname}|httpd)" ;; gcrypt) swname_filter="(${swname}|libgcrypt)" ;; gpg-error) swname_filter="(${swname}|libgpg-error)" ;; libpixman) swname_filter="(${swname}|pixman)" ;; libxml) swname_filter="(${swname}|libxml2)" ;; pkgconfig) swname_filter="(${swname}|pkg-config)" ;; png) swname_filter="(${swname}|libpng)" ;; python-setup) swname_filter="(${swname}|setuptools)" ;; pysvn-workbench) swname_filter="(${swname}|WorkBench)" ;; qt) swname_filter="(${swname}|qt-x11-free)" ;; qt4) swname_filter="(${swname}|qt-(x11|everywhere)-opensource-src)" ;; sasl) swname_filter="(${swname}|cyrus-sasl)" ;; snmp) swname_filter="(${swname}|net-snmp)" ;; tcpwrappers) swname_filter="(${swname}|socket_wrappers)" ;; tetex) swname_filter="(${swname}|tetex-src)" ;; xft) swname_filter="(${swname}|libXft)" ;; wx) swname_filter="(${swname}|wxGTK|wxWidgets)" ;; wxpython) swname_filter="(${swname}|wxPython-src)" ;; *) swname_filter="${swname}" ;; esac; pkg_filter="${swname_filter}-[0-9][0-9\.\-]*[a-z]*[0-9\.\-]*" ;; *) pkg_filter="${package_id}.*" ;; esac; tjmop_build_phase r recustomize_src || { tjmop_finalize; return ${?} }; tjmop_build_phase p prepare || { tjmop_finalize; return ${?} }; tjmop_build_phase c compile || { tjmop_finalize; return ${?} }; tjmop_build_phase t test || { tjmop_finalize; return ${?} }; tjmop_build_phase m makeinstall || { tjmop_finalize; return ${?} }; platform_filter="$(echo ${OPENPKG_PLATFORM} | sed -e 's;\.;\\.;g')"; pkg_bin_file=$(cd ${OPENPKG_ROOT}/RPM/PKG/ && find * -prune -type f 2>/dev/null | egrep "^${pkg_filter}\.${platform_filter}-openpkg\.rpm$"); filenames_count=$(echo "${pkg_bin_file}" | wc -w); if [ ${filenames_count} -gt 1 ]; then echo "${FACILITY}-E-DUPDIR, multiple binary files for specified package in directory ${OPENPKG_ROOT}/RPM/PKG--must select only one: ${pkg_bin_file}" 1>&2; tjmop_finalize; return 1; fi; tjmop_build_phase b binarypkg || { tjmop_finalize; return ${?} }; pkg_bin_file=$(cd ${OPENPKG_ROOT}/RPM/PKG/ && find * -prune -type f 2>/dev/null | egrep "^${pkg_filter}\.${platform_filter}-openpkg\.rpm$"); filenames_count=$(echo "${pkg_bin_file}" | wc -w); if [ ${filenames_count} -gt 1 ]; then echo "${FACILITY}-E-DUPDIR, multiple binary files for specified package in directory ${OPENPKG_ROOT}/RPM/PKG--must select only one: ${pkg_bin_file}" 1>&2; tjmop_finalize; return 1; fi; tjmop_build_phase l listbinpkg || { tjmop_finalize; return ${?} }; tjmop_build_phase s sourcepkg || { tjmop_finalize; return ${?} }; tjmop_build_phase d delpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase a addpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase u updpkg || { tjmop_finalize; return ${?} }; hash -r; tjmop_build_phase v verpkg || { tjmop_finalize; return ${?} }; tjmop_build_phase z zap || { tjmop_finalize; return ${?} }; tjmop_build_phase R recustomize_all || { tjmop_finalize; return ${?} }; tjmop_build_phase k compare_src || { tjmop_finalize; return ${?} }; if [ "${OPT_V}" = '1' ]; then printf "Verify parsing: "; printf "swname=%-17s" "${swname}"; printf "package_id=%-17s" "${package_id}"; printf "pkg_build_dir=%-25s" "${pkg_build_dir}"; printf "pkg_bin_file=%-s" "${pkg_bin_file}"; printf "\n"; fi; tjmop_all_status=0; if [ "${OPT_e}" = '1' ]; then if [ "${tjmop_fetch_status}" '>' '0' -o "${tjmop_recustomize_src_status}" '>' '0' -o "${tjmop_prepare_status}" '>' '0' -o "${tjmop_compile_status}" '>' '0' -o "${tjmop_makeinstall_status}" '>' '0' -o "${tjmop_binarypkg_status}" '>' '0' -o "${tjmop_listbinpkg_status}" '>' '0' -o "${tjmop_sourcepkg_status}" '>' '0' -o "${tjmop_delpkg_status}" '>' '0' -o "${tjmop_addpkg_status}" '>' '0' -o "${tjmop_updpkg_status}" '>' '0' -o "${tjmop_recustomize_all_status}" '>' '0' -o '0' '>' '0' ]; then tjmop_all_status=1; fi; fi; if [ "${OPT_E}" = '1' ]; then tjmop_all_status=1; fi; if [ "${tjmop_all_status}" = '1' ]; then printf "Exit status: "; printf "%-17s" "${swname}"; printf " fetch=%-1s" "${tjmop_fetch_status}"; printf " recustomize_src=%-1s" "${tjmop_recustomize_src_status}"; printf " prepare=%-1s" "${tjmop_prepare_status}"; printf " compile=%-1s" "${tjmop_compile_status}"; printf " test=%-1s" "${tjmop_test_status}"; printf " makeinstall=%-1s" "${tjmop_makeinstall_status}"; printf " binarypkg=%-1s" "${tjmop_binarypkg_status}"; printf " listbinpkg=%-1s" "${tjmop_listbinpkg_status}"; printf " sourcepkg=%-1s" "${tjmop_sourcepkg_status}"; printf " delpkg=%-1s" "${tjmop_delpkg_status}"; printf " addpkg=%-1s" "${tjmop_addpkg_status}"; printf " updpkg=%-1s" "${tjmop_updpkg_status}"; printf " verpkg=%-1s" "${tjmop_verpkg_status}"; printf " recustomize_all=%-1s" "${tjmop_recustomize_all_status}"; printf "\n"; fi; tjmop_finalize; find ${tempfile_prefix}cache*.tmp -prune -type f -mtime +1 -exec rm {} \; 2>/dev/null; return 0 } _ENV["tjmopapplytjmsavecust"] => () { local FACILITY='tjmopapplytjmsavecust'; local USAGE="${FACILITY} full_path_to_customized_openpkg_file [customization_directory]"; local openpkg_customized_file="${1}"; local openpkg_cust_dir="${2}"; local prior_to_cust_suffix="_tjmsave"; local dir_name; local base_name; local openpkg_file; local openpkg_file_prior_to_cust; local openpkg_cust_root_def="/home/openpkg_customizations"; local backup_extension='.orig.bak'; local backup_filename; if [ "${openpkg_customized_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_customized_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_customized_file}"; return 1; fi; dir_name=$(dirname ${openpkg_customized_file}); base_name=$(basename ${openpkg_customized_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); openpkg_file_prior_to_cust="${openpkg_file}${prior_to_cust_suffix}"; if [ -f ${openpkg_file_prior_to_cust} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_file_prior_to_cust}"; return 1; fi; if [ "${openpkg_cust_dir}" = '' ]; then openpkg_cust_dir="${openpkg_cust_root_def}${dir_name}"; fi; openpkg_cust_dir="${openpkg_cust_dir%/}"; if [ -d ${openpkg_cust_dir} ]; then :; else echo "${FACILITY}-F-NOEXISTS, customization directory does not exist: ${openpkg_cust_dir}"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}"; return 1; fi; diff ${openpkg_file_prior_to_cust} ${openpkg_cust_dir}/${base_name} >/dev/null 2>&1; if [ ${?} != 0 ]; then echo "${FACILITY}-F-DIFFERENT, file prior to customization and file in the customization directory differ--changes shown here:" 1>&2; diff ${openpkg_file_prior_to_cust} ${openpkg_cust_dir}/${base_name} | sed -e "$(echo -e 's;^;\t;')"; return 1; fi; backup_filename="$(tjmgetudfn ${openpkg_cust_dir}/${base_name}${backup_extension})" && mv ${openpkg_cust_dir}/${base_name} ${backup_filename} && mv ${openpkg_file} ${openpkg_cust_dir}/${base_name} && mv ${openpkg_file_prior_to_cust} ${openpkg_file} && echo -e "${FACILITY}-I-CUSTAPPLIED, applied customized file ${openpkg_file} to ${openpkg_cust_dir}/${base_name}, previous version saved. These changes were applied:" 1>&2 && diff ${openpkg_cust_dir}/${base_name} ${backup_filename} | sed -e "$(echo -e 's;^;\t;')" } _ENV["diffpermfile"] => () { local sourcedir="${1}"; local destdir="${2}"; local dirorfile="${3}"; local difflist; local perm; local owner_id; local group_id; local perm2; local owner_id2; local group_id2; find ${sourcedir}/${dirorfile} ${FIND_LS} -prune | sed -e 's;^ *[^ ]* *[^ ]* \(..........\) *[^ ]* \(.........\)\(.........\) *[^ ]* [A-Z].. .. ....[0-9] \([^ ]*\)\( -> .*\)*$;\1 \2 \3;' | while read perm owner_id group_id; do if [ -e ${destdir}/${dirorfile} ]; then find ${destdir}/${dirorfile} ${FIND_LS} -prune | sed -e 's;^ *[^ ]* *[^ ]* \(..........\) *[^ ]* \(.........\)\(.........\) *[^ ]* [A-Z].. .. ....[0-9] \([^ ]*\)\( -> .*\)*$;\1 \2 \3;' | while read perm2 owner_id2 group_id2; do perm_formatted=$(echo "${perm}" | nawk ' { mod_owner=substr($1,2,3) mod_group=substr($1,5,3) mod_other=substr($1,8,3) gsub("-", "", mod_owner) gsub("-", "", mod_group) gsub("-", "", mod_other) print "u=" mod_owner ",g=" mod_group ",o=" mod_other } ' ); difflist=""; if [ "${perm}" != "${perm2}" ]; then difflist="${difflist}P"; fi; if [ "${owner_id}" != "${owner_id2}" ]; then difflist="${difflist}O"; fi; if [ "${group_id}" != "${group_id2}" ]; then difflist="${difflist}G"; fi; if [ "${difflist}" != '' -a "${perm}" = "${perm##l*}" -a "${perm2}" = "${perm2##l*}" ]; then printf "\n"; printf "Permissions differ (%s). Execute the commands below to correct:\n" $difflist; printf "%-10s %-9s %-9s %-10s %-9s %-9s " ${perm} ${owner_id} ${group_id} ${perm2} ${owner_id2} ${group_id2}; printf "f=%-70s; chmod %s \$f; chown %s:%s \$f" ${destdir}/$dirorfile ${perm_formatted} ${owner_id} ${group_id}; printf "\n"; printf "\n"; fi; done; fi; done } _ENV["tjmopdo"] => () { local FACILITY='tjmopdo'; local USAGE="${FACILITY} swlist_file swname_RSE tjmop_switches tjmop_package_options"; local swlist_file; local swname_RSE; local tjmop_switches; local tjmop_options; local swname; local reverse_cmd; local return_status; set +f; swlist_file="${1}"; shift; swname_RSE="${1}"; shift; tjmop_switches="${1}"; shift; tjmop_options="${*}"; if [ -f ${swlist_file} ]; then :; else echo "${FACILITY}-E-FNF, file not found: ${swlist_file}" 1>&2; return 1; fi; if [ "${tjmop_switches}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ "${tjmop_switches}" = "-d" -o "${tjmop_switches}" = "-dC" -o "${tjmop_switches}" = "-Cd" -o "${tjmop_switches}" = "-dCS" ]; then reverse_cmd="revlines"; else reverse_cmd="cat"; fi; grep -E "^${swname_RSE}([[:space:]]|$)" ${swlist_file} | eval "${reverse_cmd}" | while read package_id package_options; do if [ "${package_id###*}" = '' ]; then :; else swname="${package_id%%-[0-9]*}"; printf "Doing %-17s %-25s %s\n" "${swname}" "${package_id}" "${package_options}" 1>&2; eval "tjmop ${tjmop_switches} ${tjmop_options} ${package_options} ${swname}" </dev/null; return_status=${?}; if [ "${return_status}" = "130" -o "${build_phase_cur_status}" = "999" ]; then echo "${FACILITY}-F-STOP, stopping due to previous error" 1>&2; return ${return_status}; fi; fi; done } _ENV["tjmgetudfn"] => () { local FACILITY='tjmgetudfn'; local USAGE="${FACILITY} desired_name"; local desired_name="${1}"; local unique_name; local seq_num; if [ "${desired_name}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; seq_num=$(tjmgethighseq "${desired_name}"); if [ "${seq_num}" = '' ]; then unique_name="${desired_name}"; else unique_name="${desired_name}_$((${seq_num} + 1))"; fi; echo "${unique_name}" } _ENV["tjmoprediff"] => () { local FACILITY='tjmoprediff'; local USAGE="${FACILITY} full_path_to_openpkg_file [customization_directory]"; local tempfile1="/tmp/${FACILITY}_${$}_1.tmp"; local openpkg_vendor_file="${1}"; local openpkg_cust_dir="${2}"; local dir_name; local base_name; local openpkg_file; local openpkg_cust_root_def="/home/openpkg_customizations"; if [ "${openpkg_vendor_file}" = '' ]; then echo "${FACILITY}-E-SYNTAX, invalid syntax: ${USAGE}" 1>&2; return 1; fi; if [ -f ${openpkg_vendor_file} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_vendor_file}"; return 1; fi; dir_name=$(dirname ${openpkg_vendor_file}); base_name=$(basename ${openpkg_vendor_file}); openpkg_file=$(cd ${dir_name} && echo "${PWD}/${base_name}"); if [ "${openpkg_cust_dir}" = '' ]; then openpkg_cust_dir="${openpkg_cust_root_def}${dir_name}"; fi; openpkg_cust_dir="${openpkg_cust_dir%/}"; if [ -d ${openpkg_cust_dir} ]; then :; else echo "${FACILITY}-F-NOEXISTS, customization directory does not exist: ${openpkg_cust_dir}"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name}.orig.save ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}.orig.save"; return 1; fi; if [ -f ${openpkg_cust_dir}/${base_name} ]; then :; else echo "${FACILITY}-F-NOEXISTS, file does not exist: ${openpkg_cust_dir}/${base_name}"; return 1; fi; if [ -e ${openpkg_file}.rpmsave ]; then diff ${openpkg_cust_dir}/${base_name} ${openpkg_file}.rpmsave >/dev/null 2>&1; if [ ${?} = 0 ]; then rm ${openpkg_file}.rpmsave; else echo -e "${openpkg_file}.rpmsave exists. Use tjmoprediff_rpmsave to retain customizations."; return 1; fi; fi; if [ -e ${openpkg_file}.rpmnew ]; then echo -e "${openpkg_file}.rpmnew exists. Use tjmoprediff_rpmnew to retain customizations."; return 1; fi; rm -f ${tempfile1}; tjmopkdiff3_merge ${openpkg_cust_dir}/${base_name}.orig.save ${openpkg_cust_dir}/${base_name} ${openpkg_file} ${tempfile1}; if [ -e ${tempfile1} ]; then mv -i ${openpkg_file} ${openpkg_file}.orig.save; mv -i ${tempfile1} ${openpkg_file}; cp -ip ${openpkg_file}.orig.save ${openpkg_cust_dir}/${base_name}.orig.save; cp -ip ${openpkg_file} ${openpkg_cust_dir}/${base_name}; fi } PHP License This program is free software; you can redistribute it and/or modify it under the terms of the PHP License as published by the PHP Group and included in the distribution in the file: LICENSE This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. If you did not receive a copy of the PHP license, or have any questions about PHP licensing, please contact license@php.net.
Build environment
OS: Linux - Linux mee-v3 2.6.9-101.ELsmp #1 SMP Fri May 27 18:57:30 EDT 2011 i686 Autoconf: autoconf (GNU Autoconf) 2.68 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+/Autoconf: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by David J. MacKenzie and Akim Demaille. Bundled Libtool: ltmain.sh (GNU libtool) 1.5.26 (1.1220.2.492 2008/01/30 06:40:56) Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. System Libtool: libtool (GNU libtool) 2.4.2 Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Compiler: Using built-in specs. COLLECT_GCC=/openpkg/bin/gcc COLLECT_LTO_WRAPPER=/home/openpkg/bin/../libexec/gcc/gcc/i686-pc-linux-gnu/4.6.2/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../configure --with-bugurl=http://openpkg.org/ --with-pkgversion=OpenPKG-CURRENT --cache-file=./config.cache --srcdir=/openpkg/RPM/TMP/gcc-4.6.2/obj/.. --prefix=/openpkg --exec-prefix=/openpkg --mandir=/openpkg/man --infodir=/openpkg/info --includedir=/openpkg/include/gcc --libexecdir=/openpkg/libexec/gcc --with-gxx-include-dir=/openpkg/include/g++ --with-local-prefix=/openpkg/lib/gcc --enable-languages=c,c++,f95 --enable-threads=posix --disable-maintainer-mode --disable-shared --disable-nls --disable-multilib --with-libiconv-prefix=/openpkg --with-gmp=/openpkg --with-mpfr=/openpkg --with-mpc=/openpkg --with-ld=/openpkg/bin/ld --with-as=/openpkg/bin/as --with-gnu-ld --with-gnu-as Thread model: posix gcc version 4.6.2 (OpenPKG-CURRENT) Bison: bison (GNU Bison) 2.5 Written by Robert Corbett and Richard Stallman. Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Libraries: libcrypt.so.1 => /lib/libcrypt.so.1 (0x05a17000) libresolv.so.2 => /lib/libresolv.so.2 (0x004f8000) librt.so.1 => /lib/tls/librt.so.1 (0x00bc9000) libdl.so.2 => /lib/libdl.so.2 (0x00391000) libnsl.so.1 => /lib/libnsl.so.1 (0x007a8000) libm.so.6 => /lib/tls/libm.so.6 (0x00397000) libpthread.so.0 => /lib/tls/libpthread.so.0 (0x004ad000) libc.so.6 => /lib/tls/libc.so.6 (0x0025f000) /lib/ld-linux.so.2 (0x00245000) User's E-mail: