mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] acl and attr: make install.sh script accept spaces in user and group names
Date: Tue, 27 Mar 2018 09:31:31 +0200	[thread overview]
Message-ID: <20180327073131.ao2xoajpzmds5yvr@pengutronix.de> (raw)
In-Reply-To: <1522068878-3964-1-git-send-email-jens.breitenstein@wago.com>

On Mon, Mar 26, 2018 at 12:54:59PM +0000, Jens.Breitenstein@wago.com wrote:
> ---
>  ...-sh-accept-spaces-in-user-and-group-names.patch | 108 +++++++++++++++++++++
>  patches/acl-2.2.52/series                          |   1 +
>  ...-sh-accept-spaces-in-user-and-group-names.patch | 108 +++++++++++++++++++++
>  patches/attr-2.4.47/series                         |   1 +
>  4 files changed, 218 insertions(+)
>  create mode 100644 patches/acl-2.2.52/0004-make-install-sh-accept-spaces-in-user-and-group-names.patch
>  create mode 100644 patches/attr-2.4.47/0003-make-install-sh-accept-spaces-in-user-and-group-names.patch
> 

There is a new attr-2.4.48 release. 'install-sh' is removed in this release
and replaced by the usual libtool files. That should fix this problem too.
Unfortunately, there is no tarball for this release :-/. You need to switch
to the git URL[1] and add a autogen.sh. Take a look at the Makefile and
patch directory for libepoxy. That's a good example on how to do this.

There is a similar upstream fix for acl but no release yet. But that patch
is far to invasive to use here. So we'll stick to your patch. But you need
to add header with a commit message to your patch. The best way to do this
is with git. Take a look at the documentation[2] on how to do this.

Michael

[1] http://git.savannah.nongnu.org/cgit/attr.git/snapshot/attr-2.4.48.tar.gz
[2] https://www.ptxdist.org/doc/dev_manual.html#creating-a-patch-series-for-a-package


> diff --git a/patches/acl-2.2.52/0004-make-install-sh-accept-spaces-in-user-and-group-names.patch b/patches/acl-2.2.52/0004-make-install-sh-accept-spaces-in-user-and-group-names.patch
> new file mode 100644
> index 0000000..183a353
> --- /dev/null
> +++ b/patches/acl-2.2.52/0004-make-install-sh-accept-spaces-in-user-and-group-names.patch
> @@ -0,0 +1,108 @@
> +Index: acl-2.2.52/include/install-sh
> +===================================================================
> +--- acl-2.2.52.orig/include/install-sh
> ++++ acl-2.2.52/include/install-sh
> +@@ -56,7 +56,7 @@ _chown ()
> + {
> +     _st=255
> +     if [ $# -eq 3 ] ; then
> +-      chown $1:$2 $3
> ++      chown "$1":"$2" $3
> +       _st=$?
> +       if [ $_st -ne 0 ] ; then
> +           if [ $REAL_UID != '0' ] ; then
> +@@ -93,7 +93,7 @@ DIRMODE=755
> + FILEMODE=644
> + OWNER=`id -u`
> + GROUP=`id -g`
> +-REAL_UID=$OWNER
> ++REAL_UID="$OWNER"
> +
> + # default is to install and don't append manifest
> + INSTALL=true
> +@@ -115,7 +115,7 @@ fi
> +
> + [ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true
> +
> +-while getopts "Dcm:d:S:o:g:T:" c $*
> ++while getopts "Dcm:d:S:o:g:T:" c "$@"
> + do
> +    case $c in
> +    c)
> +@@ -168,10 +168,10 @@ then
> +     fi
> +     if [ $status -eq 0 ]
> +     then
> +-      $CHOWN $OWNER $GROUP $dir
> ++      $CHOWN "$OWNER" "$GROUP" $dir
> +       status=$?
> +     fi
> +-    $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT}
> ++    $MANIFEST d $DIRMODE "$OWNER" "$GROUP" ${dir#$DIST_ROOT}
> + elif $Sflag
> + then
> +     #
> +@@ -217,7 +217,7 @@ then
> +                       install_name=$target/$solib
> +                       $CP $solib $install_name
> +                       status=$?
> +-                      $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT}
> ++                      $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$solib ${install_name#$DIST_ROOT}
> +                       break
> +               fi
> +       done
> +@@ -268,7 +268,7 @@ then
> +       install_name=$target/$old_library
> +       $CP $old_library $install_name
> +       status=$?
> +-      $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT}
> ++      $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$old_library ${install_name#$DIST_ROOT}
> +       ;;
> +     *)
> +       echo "$prog: -T $lt_install invalid"
> +@@ -281,7 +281,7 @@ then
> +       if [ $status -eq 0 ]
> +       then
> +               $CHMOD $FILEMODE $install_name
> +-              $CHOWN $OWNER $GROUP $install_name
> ++              $CHOWN "$OWNER" "$GROUP" $install_name
> +       fi
> +       ;;
> +     esac
> +@@ -310,19 +310,19 @@ else
> +               status=$?
> +               if [ $status -eq 0 ]
> +               then
> +-                  $CHOWN $OWNER $GROUP $dir/$f
> ++                  $CHOWN "$OWNER" "$GROUP" $dir/$f
> +                   status=$?
> +               fi
> +-              $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
> ++              $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$f ${dir#$DIST_ROOT}/$f
> +           else
> +               $CHMOD $FILEMODE $dir
> +               status=$?
> +               if [ $status -eq 0 ]
> +               then
> +-                  $CHOWN $OWNER $GROUP $dir
> ++                  $CHOWN "$OWNER" "$GROUP" $dir
> +                   status=$?
> +               fi
> +-              $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT}
> ++              $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$dir ${dir#$DIST_ROOT}
> +           fi
> +       fi
> +     else
> +@@ -352,10 +352,10 @@ else
> +               status=$?
> +               if [ $status -eq 0 ]
> +               then
> +-                  $CHOWN $OWNER $GROUP $dir/$f
> ++                  $CHOWN "$OWNER" "$GROUP" $dir/$f
> +                   status=$?
> +               fi
> +-              $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
> ++              $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$f ${dir#$DIST_ROOT}/$f
> +           fi
> +           [ $status -ne 0 ] && break
> +       done
> diff --git a/patches/acl-2.2.52/series b/patches/acl-2.2.52/series
> index d073142..519a1b4 100644
> --- a/patches/acl-2.2.52/series
> +++ b/patches/acl-2.2.52/series
> @@ -4,3 +4,4 @@
>  0002-buildmacros-add-tag-CC-to-libtool-invocation.patch
>  0003-buildmacros-fix-install-with-user-domain.patch
>  # 7f7779678dde859863b19dcae5e93fb1  - git-ptx-patches magic
> +0004-make-install-sh-accept-spaces-in-user-and-group-names.patch
> diff --git a/patches/attr-2.4.47/0003-make-install-sh-accept-spaces-in-user-and-group-names.patch b/patches/attr-2.4.47/0003-make-install-sh-accept-spaces-in-user-and-group-names.patch
> new file mode 100644
> index 0000000..f9591c9
> --- /dev/null
> +++ b/patches/attr-2.4.47/0003-make-install-sh-accept-spaces-in-user-and-group-names.patch
> @@ -0,0 +1,108 @@
> +Index: attr-2.4.47/include/install-sh
> +===================================================================
> +--- attr-2.4.47.orig/include/install-sh
> ++++ attr-2.4.47/include/install-sh
> +@@ -56,7 +56,7 @@ _chown ()
> + {
> +     _st=255
> +     if [ $# -eq 3 ] ; then
> +-      chown $1:$2 $3
> ++      chown "$1":"$2" $3
> +       _st=$?
> +       if [ $_st -ne 0 ] ; then
> +           if [ $REAL_UID != '0' ] ; then
> +@@ -93,7 +93,7 @@ DIRMODE=755
> + FILEMODE=644
> + OWNER=`id -u`
> + GROUP=`id -g`
> +-REAL_UID=$OWNER
> ++REAL_UID="$OWNER"
> +
> + # default is to install and don't append manifest
> + INSTALL=true
> +@@ -115,7 +115,7 @@ fi
> +
> + [ -n "$DIST_ROOT" -a $REAL_UID -ne 0 ] && CHOWN=true
> +
> +-while getopts "Dcm:d:S:o:g:T:" c $*
> ++while getopts "Dcm:d:S:o:g:T:" c "$@"
> + do
> +    case $c in
> +    c)
> +@@ -168,10 +168,10 @@ then
> +     fi
> +     if [ $status -eq 0 ]
> +     then
> +-      $CHOWN $OWNER $GROUP $dir
> ++      $CHOWN "$OWNER" "$GROUP" $dir
> +       status=$?
> +     fi
> +-    $MANIFEST d $DIRMODE $OWNER $GROUP ${dir#$DIST_ROOT}
> ++    $MANIFEST d $DIRMODE "$OWNER" "$GROUP" ${dir#$DIST_ROOT}
> + elif $Sflag
> + then
> +     #
> +@@ -217,7 +217,7 @@ then
> +                       install_name=$target/$solib
> +                       $CP $solib $install_name
> +                       status=$?
> +-                      $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$solib ${install_name#$DIST_ROOT}
> ++                      $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$solib ${install_name#$DIST_ROOT}
> +                       break
> +               fi
> +       done
> +@@ -268,7 +268,7 @@ then
> +       install_name=$target/$old_library
> +       $CP $old_library $install_name
> +       status=$?
> +-      $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$old_library ${install_name#$DIST_ROOT}
> ++      $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$old_library ${install_name#$DIST_ROOT}
> +       ;;
> +     *)
> +       echo "$prog: -T $lt_install invalid"
> +@@ -281,7 +281,7 @@ then
> +       if [ $status -eq 0 ]
> +       then
> +               $CHMOD $FILEMODE $install_name
> +-              $CHOWN $OWNER $GROUP $install_name
> ++              $CHOWN "$OWNER" "$GROUP" $install_name
> +       fi
> +       ;;
> +     esac
> +@@ -310,19 +310,19 @@ else
> +               status=$?
> +               if [ $status -eq 0 ]
> +               then
> +-                  $CHOWN $OWNER $GROUP $dir/$f
> ++                  $CHOWN "$OWNER" "$GROUP" $dir/$f
> +                   status=$?
> +               fi
> +-              $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
> ++              $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$f ${dir#$DIST_ROOT}/$f
> +           else
> +               $CHMOD $FILEMODE $dir
> +               status=$?
> +               if [ $status -eq 0 ]
> +               then
> +-                  $CHOWN $OWNER $GROUP $dir
> ++                  $CHOWN "$OWNER" "$GROUP" $dir
> +                   status=$?
> +               fi
> +-              $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$dir ${dir#$DIST_ROOT}
> ++              $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$dir ${dir#$DIST_ROOT}
> +           fi
> +       fi
> +     else
> +@@ -352,10 +352,10 @@ else
> +               status=$?
> +               if [ $status -eq 0 ]
> +               then
> +-                  $CHOWN $OWNER $GROUP $dir/$f
> ++                  $CHOWN "$OWNER" "$GROUP" $dir/$f
> +                   status=$?
> +               fi
> +-              $MANIFEST f $FILEMODE $OWNER $GROUP $HERE/$f ${dir#$DIST_ROOT}/$f
> ++              $MANIFEST f $FILEMODE "$OWNER" "$GROUP" $HERE/$f ${dir#$DIST_ROOT}/$f
> +           fi
> +           [ $status -ne 0 ] && break
> +       done
> diff --git a/patches/attr-2.4.47/series b/patches/attr-2.4.47/series
> index 883e463..c043be4 100644
> --- a/patches/attr-2.4.47/series
> +++ b/patches/attr-2.4.47/series
> @@ -1,2 +1,3 @@
>  0001-fix-install-with-domain-user.patch
>  0002-build-translations-only-if-gettext-is-enabled.patch
> +0003-make-install-sh-accept-spaces-in-user-and-group-names.patch
> --
> 2.7.4
> 
> 
> 
> ________________________________________________________________________________________
> Diese E-Mail einschließlich ihrer Anhänge ist vertraulich und daher allein für den Gebrauch durch den vorgesehenen Empfänger bestimmt. Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail sowie jedwedes Vertrauen auf deren Inhalt untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzüglich vollständig zu löschen und uns eine Nachricht zukommen zu lassen.
> 
> This email may contain material that is confidential and/or privileged for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
> 
> WAGO Kontakttechnik GmbH (nach Schweizer Recht) & Co. KG; Rechtsform: Kommanditgesellschaft; Sitz: Minden; Registergericht: Bad Oeynhausen, HRA 6218; Persönlich haftender Gesellschafter: WAGO Kontakttechnik Beteiligungs GmbH; Sitz: Belmont-Broye (Schweiz); Handelsregisteramt CHE-112.342.525; Geschäftsführung: Dipl.-Wirtsch. Ing. (FH) Sven Michael Hohorst; Dipl. Betriebsw. Axel Christian Börner; Dipl.-Ing. (FH) Ulrich Bohling.
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
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
ptxdist@pengutronix.de

      reply	other threads:[~2018-03-27  7:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 12:54 Jens.Breitenstein
2018-03-27  7:31 ` Michael Olbrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180327073131.ao2xoajpzmds5yvr@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox