On Fri, Jul 29, 2016 at 01:12:04AM +0200, Ladislav Michl wrote:
> On Wed, Jul 27, 2016 at 12:59:39PM +0200, Michael Olbrich wrote:
> > On Mon, Jul 18, 2016 at 01:22:17PM +0200, Ladislav Michl wrote:
> > > Change separator to allow ':' in filenames.
> > 
> > I like it in general. But I think we should explicitly error out if we come
> > across an old command file (NF == 1). And tell the user to run "ptxdist
> > clean root" or something like that.
> [snip]
> 
> Do you mean something like this (untested):

I think it needs to be added to ptxd_dopermissions as well. I think the
stuff below is called first, but it's optional. Maybe some funtion:

ptxd_check_obsolete_perm() {
    if ! grep -q -P "\x1F" "${@}" ; then
        ptxd_bailout "obsolete perm file detected, please run 'ptxdist clean 
root'"
    fi
}

And call it from both. And note the '-P'. Otherwise the \x is not
interpreted.

Michael

> diff --git a/scripts/lib/ptxd_make_image_fix_permissions.sh 
> b/scripts/lib/ptxd_make_image_fix_permissions.sh
> index c1cfdba..d4bf6b0 100644
> --- a/scripts/lib/ptxd_make_image_fix_permissions.sh
> +++ b/scripts/lib/ptxd_make_image_fix_permissions.sh
> @@ -34,6 +34,11 @@ ptxd_make_image_fix_permissions_check() {
>      local ifs_orig="${IFS}"
>      IFS="\x1F"
>  
> +    # previous PTXdist versions used ":" as a separator
> +    if ! grep -q "${IFS}" "${ptxd_reply_perm_files[@]}"; then
> +       ptxd_bailout "obsolete perm file detected, please run 'ptxdist clean 
> root'"
> +    fi
> +
>      # just care about dev-nodes, for now
>      egrep -h "^[n]${IFS}" "${ptxd_reply_perm_files[@]}" |
>      while read kind file uid_should gid_should prm_should type major_should 
> minor_should; do
> 
> _______________________________________________
> ptxdist mailing list
> [email protected]

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to