binpkg.sh: do the files processing in 3 steps: 1- links, 2- files and 3- dirs.
--HG-- extra : convert_revision : d68324f39af442b089e71083316c16bc4690a4e2
This commit is contained in:
parent
323997af7e
commit
aefe26d30c
1 changed files with 22 additions and 5 deletions
|
@ -110,14 +110,29 @@ xbps_write_metadata_pkg_real()
|
|||
|
||||
write_metadata_flist_header $TMPFPLIST
|
||||
|
||||
# First add the regular files.
|
||||
for f in $(find -L $destdir -type f); do
|
||||
# Pass 1: add links.
|
||||
for f in $(find $destdir -type l); do
|
||||
j=$(echo $f|sed -e "$fpattern")
|
||||
[ "$j" = "" ] && continue
|
||||
printf "$j\n" >> $TMPFLIST
|
||||
printf "<dict>\n" >> $TMPFPLIST
|
||||
printf "<key>file</key>\n" >> $TMPFPLIST
|
||||
printf "<string>$j</string>\n" >> $TMPFPLIST
|
||||
printf "<key>type</key>\n" >> $TMPFPLIST
|
||||
printf "<string>link</string>\n" >> $TMPFPLIST
|
||||
printf "</dict>\n" >> $TMPFPLIST
|
||||
done
|
||||
|
||||
# Pass 2: add regular files.
|
||||
for f in $(find $destdir -type f); do
|
||||
j=$(echo $f|sed -e "$fpattern")
|
||||
[ "$j" = "" ] && continue
|
||||
printf "$j\n" >> $TMPFLIST
|
||||
printf "<dict>\n" >> $TMPFPLIST
|
||||
printf "<key>file</key>\n" >> $TMPFPLIST
|
||||
printf "<string>$j</string>\n" >> $TMPFPLIST
|
||||
printf "<key>type</key>\n" >> $TMPFPLIST
|
||||
printf "<string>file</string>\n" >> $TMPFPLIST
|
||||
printf "<key>sha256</key>\n" >> $TMPFPLIST
|
||||
printf "<string>$(xbps-digest $f)</string>\n" >> $TMPFPLIST
|
||||
for i in ${conf_files}; do
|
||||
|
@ -130,14 +145,16 @@ xbps_write_metadata_pkg_real()
|
|||
printf "</dict>\n" >> $TMPFPLIST
|
||||
done
|
||||
|
||||
# Add directories at the end.
|
||||
for f in $(find -L $destdir -type d|sort -ur); do
|
||||
# Pass 3: add directories.
|
||||
for f in $(find $destdir -type d|sort -ur); do
|
||||
j=$(echo $f|sed -e "$fpattern")
|
||||
[ "$j" = "" ] && continue
|
||||
printf "$j\n" >> $TMPFLIST
|
||||
printf "<dict>\n" >> $TMPFPLIST
|
||||
printf "<key>dir</key>\n" >> $TMPFPLIST
|
||||
printf "<key>file</key>\n" >> $TMPFPLIST
|
||||
printf "<string>$j</string>\n" >> $TMPFPLIST
|
||||
printf "<key>type</key>\n" >> $TMPFPLIST
|
||||
printf "<string>dir</string>\n" >> $TMPFPLIST
|
||||
for i in ${keep_dirs}; do
|
||||
if [ "$j" = "$i" ]; then
|
||||
printf "<key>keep</key>\n" >> $TMPFPLIST
|
||||
|
|
Loading…
Reference in a new issue