Diff

Differences From Artifact [09f445e94a]:

To Artifact [7f99548475]:


     1      1   #! /usr/bin/env bash
     2      2   
     3         -pkgsdir="$1"
            3  +if [ "$1" == '--cpio' ]; then
            4  +	mode='file'
            5  +
            6  +	pkgfile="$1"
            7  +else
            8  +	mode='dir'
            9  +
           10  +	pkgsdir="$1"
           11  +fi
     4     12   appfsdir="$2"
     5     13   
     6         -if [ -z  "${pkgsdir}" -o -z "${appfsdir}" ]; then
     7         -	echo 'Usage: appfs-mk <pkgsdir> <appfsdir>' >&2
           14  +if [ -z "${pkgsdir}" -a -z "${pkgfile}" ] || [ -z "${appfsdir}" ]; then
           15  +	echo 'Usage: appfs-mk {--cpio <pkgfile>|<pkgsdir>} <appfsdir>' >&2
     8     16   
     9     17   	exit 1
    10     18   fi
    11     19   
    12     20   appfsdir="$(cd "${appfsdir}" && pwd)"
    13     21   if [ -z "${appfsdir}" ]; then
    14     22   	echo "Unable to find appfs directory." >&2
................................................................................
    83     91   			echo "${type},${stat_data},${filename}"
    84     92   		else
    85     93   			echo "${type},${stat_data},${extra_data},${filename}"
    86     94   		fi
    87     95   	done
    88     96   }
    89     97   
    90         -cd "${pkgsdir}" || exit 1
           98  +case "${mode}" in
           99  +	dir)
          100  +		cd "${pkgsdir}" || exit 1
          101  +		;;
          102  +	file)
          103  +		echo 'Unsupported' >&2
          104  +		exit 1
          105  +		;;
          106  +esac
    91    107   
    92    108   packagelistfile="${appfsdir}/sha1/${RANDOM}${RANDOM}${RANDOM}${RANDOM}${RANDOM}.tmp"
    93    109   for package in *; do
    94    110   	(
    95    111   		cd "${package}" || exit 1
    96    112   
    97    113   		for os_cpuArch in *; do