Hi,

* Ivo De Decker [Sat Apr 22, 2017 at 01:38:27PM +0200]:
> On Fri, Apr 14, 2017 at 11:56:47PM +0200, Michael Prokop wrote:
> > asking for pre-approval of unblocking package jenkins-debian-glue.

> > In the current stretch version of jenkins-debian-glue (0.18.2) there
> > are two major bugs that should be fixed prior to release:

> > * dpkg-buildpackage might apply wrong defaults and then leaking the
> >   version control repository content (e.g. .git) through the
> >   generated tarball

> > * in binary only package builds the source package might get
> >   removed, which is neither expected nor wanted behavior
> >   (see https://github.com/mika/jenkins-debian-glue/issues/173)

> > Please let me know if this upload would be OK for you.

> The changes look acceptable.

Thanks.

> > unblock jenkins-debian-glue/0.18.2+deb9u1

> This version will go to unstable, just like other uploads, so the version
> number should probably be something like 0.18.2.1 or 0.18.3, not
> 0.18.2+deb9u1.

Thanks for mentioning that, I've adjusted it accordingly.

> Please go ahead with the upload and remove the moreinfo tag from this bug once
> the upload is in unstable.

Actually there was another regression noted, which is fixed by
simply replacing:

|   if ! grep -q 'tar-ignore' "debian/source/options" ; then
|   [...]
|   if ! egrep -qe '^(diff-ignore|extend-diff-ignore)' "debian/source/options" 
; then
|     echo "*** Enabling '-i' option as diff-ignore or extend-diff-ignore 
options not present in debian/source/options ***"

with:

|   if ! grep -q '^[[:space:]]*tar-ignore' "debian/source/options" ; then
|   [...]
|   # note: we shouldn't match on 'extend-diff-ignore'
|   if ! grep -q '^[[:space:]]*diff-ignore' "debian/source/options" ; then
|     echo "*** Enabling '-i' option as diff-ignore option not present in 
debian/source/options ***"
|     DBP_OPTS+=" -i"

The refreshed debdiff is attached to this mail and I've just
uploaded the package towards unstable and it's accepted there.
Removing the moreinfo tag accordingly.

Thanks for your review + work, Ivo.

regards,
-mika-

diff -Nru jenkins-debian-glue-0.18.2/debian/changelog 
jenkins-debian-glue-0.18.2.1/debian/changelog
--- jenkins-debian-glue-0.18.2/debian/changelog 2017-01-24 22:13:48.000000000 
+0100
+++ jenkins-debian-glue-0.18.2.1/debian/changelog       2017-04-27 
18:01:04.000000000 +0200
@@ -1,3 +1,17 @@
+jenkins-debian-glue (0.18.2.1) unstable; urgency=medium
+
+  * [9492a4f] Support SKIP_SOURCE_REMOVAL to not remove source package in
+    binary only package builds. Thanks to Antoine Delvaux
+    <antoine.delv...@gmail.com> for the bugreport + initial patch
+  * [56563d7] Fix regression from commit 8fe677820fae2 to apply safe dpkg-
+    buildpackage defaults. Thanks to Guillem Jover for feedback and code
+    review
+  * [3b79a73] Further regression fixes for commit 8fe677820fae2 WRT dpkg-
+    buildpackage options. Thanks to Guillem Jover for feedback and code
+    review
+
+ -- Michael Prokop <m...@debian.org>  Thu, 27 Apr 2017 18:01:04 +0200
+
 jenkins-debian-glue (0.18.2) unstable; urgency=medium
 
   [ Will DeBerry ]
diff -Nru jenkins-debian-glue-0.18.2/scripts/build-and-provide-package 
jenkins-debian-glue-0.18.2.1/scripts/build-and-provide-package
--- jenkins-debian-glue-0.18.2/scripts/build-and-provide-package        
2016-11-17 01:23:51.000000000 +0100
+++ jenkins-debian-glue-0.18.2.1/scripts/build-and-provide-package      
2017-04-27 17:59:39.000000000 +0200
@@ -451,6 +451,9 @@
 
     SKIP_ARCH_BUILD=false
     echo "*** Setting SKIP_ARCH_BUILD=$SKIP_ARCH_BUILD to skip further arch 
builds. ***"
+
+    SKIP_SOURCE_REMOVAL=true
+    echo "*** Setting SKIP_SOURCE_REMOVAL=$SKIP_SOURCE_REMOVAL to skip source 
removal in binary only build ***"
     return 0
   fi
 
@@ -474,6 +477,9 @@
       echo "*** Host architecture [${HOST_ARCH}] does not match \$architecture 
[${architecture:-}] ... ***"
       echo "*** ... setting binary only build and continuing with 
identify_build_type ***"
       DEBBUILDOPTS="-B"
+
+      SKIP_SOURCE_REMOVAL=true
+      echo "*** Setting SKIP_SOURCE_REMOVAL=$SKIP_SOURCE_REMOVAL to skip 
source removal in binary only build ***"
     fi
   else
     if [ "${MAIN_ARCHITECTURE:-}" = "${architecture:-}" ] ;then
@@ -483,6 +489,9 @@
     else
       echo "*** MAIN_ARCHITECTURE [${MAIN_ARCHITECTURE:-}] does not match 
\$architecture [${architecture:-}], setting binary only build and continuing 
with identify_build_type ***"
       DEBBUILDOPTS="-B"
+
+      SKIP_SOURCE_REMOVAL=true
+      echo "*** Setting SKIP_SOURCE_REMOVAL=$SKIP_SOURCE_REMOVAL to skip 
source removal in binary only build ***"
     fi
   fi
 
@@ -500,6 +509,9 @@
           echo "*** Package provides arch 'all' + 'any', enabling -B 
buildoption for this architecture. ***"
           # -B -> binary-only build, limited to architecture dependent packages
           DEBBUILDOPTS="-B"
+
+          SKIP_SOURCE_REMOVAL=true
+          echo "*** Setting SKIP_SOURCE_REMOVAL=$SKIP_SOURCE_REMOVAL to skip 
source removal in binary only build ***"
           break
         else
           # only "Architecture: all", so no arch specific packages since
@@ -776,8 +788,12 @@
     return 0
   fi
 
-  echo "*** Removing source package version from repository ***"
-  ${SUDO_CMD:-} ${REPREPRO_CMD} -A source -b "${REPOSITORY}" ${REPREPRO_OPTS} 
remove "${REPOS}" "${SOURCE_PACKAGE}"
+  if [ -n "${SKIP_SOURCE_REMOVAL:-}" ] ; then
+    echo "*** Skipping removal of existing source package as requested via 
SKIP_SOURCE_REMOVAL ***"
+  else
+    echo "*** Removing source package version from repository ***"
+    ${SUDO_CMD:-} ${REPREPRO_CMD} -A source -b "${REPOSITORY}" 
${REPREPRO_OPTS} remove "${REPOS}" "${SOURCE_PACKAGE}"
+  fi
 
   echo "*** Removing previous binary package versions from repository ***"
   for p in $(list_deb_files 
"${WORKSPACE}/binaries/"*"_${newest_version}_${arch}.changes") ; do
diff -Nru jenkins-debian-glue-0.18.2/scripts/generate-git-snapshot 
jenkins-debian-glue-0.18.2.1/scripts/generate-git-snapshot
--- jenkins-debian-glue-0.18.2/scripts/generate-git-snapshot    2016-12-02 
17:00:43.000000000 +0100
+++ jenkins-debian-glue-0.18.2.1/scripts/generate-git-snapshot  2017-04-27 
18:00:40.000000000 +0200
@@ -372,6 +372,32 @@
   rm -rf .pc
 }
 
+identify_source_build_opts() {
+  # unset by default
+  DBP_OPTS=""
+
+  if [ -r "debian/source/format" ] && ! grep -q '^1\.0' debian/source/format ; 
then
+    echo "*** Found dpkg source format != 1.0, nothing to do ****"
+    return 0
+  fi
+
+  if [ -r "debian/source/options" ] ; then
+    if ! grep -q '^[[:space:]]*tar-ignore' "debian/source/options" ; then
+      echo "*** Enabling '-I' option as tar-ignore option not present in 
debian/source/options ***"
+      DBP_OPTS+=" -I"
+    fi
+
+    # note: we shouldn't match on 'extend-diff-ignore'
+    if ! grep -q '^[[:space:]]*diff-ignore' "debian/source/options" ; then
+      echo "*** Enabling '-i' option as diff-ignore option not present in 
debian/source/options ***"
+      DBP_OPTS+=" -i"
+    fi
+  else
+    echo "*** Enabling '-i -I' options as building for dpkg source format 1.0 
***"
+    DBP_OPTS="-i -I"
+  fi
+}
+
 source_format_opts() {
   if ! [ -f "debian/source/format" ] ; then
     echo '*** WARNING: Source format is not specified in debian/source/format! 
***'
@@ -420,6 +446,7 @@
 
 git_cleanup
 source_format_opts
+identify_source_build_opts
 
 # Only if we are using git-buildpackage...
 if [ "${IGNORE_GIT_BUILDPACKAGE:-}" != "true" ] ; then
@@ -462,7 +489,7 @@
 
 # build source package, run before switching back to previous branch
 # to get the actual requested version
-dpkg-buildpackage -uc -us -nc -d -S ${DBP_EXTRA_OPTS:-}
+dpkg-buildpackage -uc -us -nc -d -S ${DBP_OPTS:-} ${DBP_EXTRA_OPTS:-}
 
 if [ -n "${KEY_ID:-}" ] ; then
   echo "*** Found environment variable KEY_ID, set to ${KEY_ID:-}, signing 
source package ***"

Attachment: signature.asc
Description: Digital signature

Reply via email to