[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-05-17 Thread Ponnuvel Palaniyappan
@Robie


1. From man page does allude to that.
"  -P foo, --package foo
  Don't follow dpkg-divert diversions by package foo when updating 
configuration files.
"

which implies ucf should (and does) respect/handle diversions.

2. Further: "ucf should respect dpkg-divert" (refer 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=43)
indicates it is a feature and has been supported since 3.0040 and has been 
accepted by the upstream maintainer.

3. Likewise the most recent change by the upstream maintainer is also 
addressing similar issue:
```
ucf (3.0043) unstable; urgency=high

  * The argument to dpkg-divert needs to be the actual file name, not the
fully escaped regexp safe one. 
  * Bug fix: "dpkg-divert error when upgrading grub with diverted config",
thanks to deb...@project-mindfuck.org.uk; (Closes: #962818).

 -- Manoj Srivastava   Mon, 15 Jun 2020 22:37:53 -0700
```

So I believe ucf is expected handle diversions even if this specific
patch wasn't acked by the upstream maintainer.

> If we do decide to go ahead, then there are a few things that need
fixing, please.

Updated the bug description as well as the changelog (re-uploaded).

FWIW, we do have NMU ucf in several Ubuntu releases in general:
```
 ucf | 3.0027+nmu1 | trusty   | source, all
 ucf | 3.0036  | xenial   | source, all
 ucf | 3.0038  | bionic   | source, all
 ucf | 3.0038+nmu1 | focal| source, all
 ucf | 3.0043  | jammy| source, all
 ucf | 3.0043+nmu1 | mantic   | source, all
 ucf | 3.0043+nmu1 | noble| source, all
 ucf | 3.0043+nmu1 | oracular | source, all

And specifically, the NMU versions on mantic, noble, and Oracular has _this 
patch_ already (which I am backporting here to Jammy). So I think it's 
reasonable to assume the backport is safe. 
Please let me know if there are further concerns.

** Description changed:

  [ Impact ]
  
  When a dpkg-diversion is used to setup a package diversion and ucf for 
managing
  the configuration files for chrony package, the postinst script of ucf fails
  when installing chrony.
  
  This issue isn't specific to chrony but can happen for any package whose
  config files are managed by ucf.
  
  This affects users on Jammy who use ucf. Newer versions of ucf have this bug
  fixed already.
  
+ "ucf should respect dpkg-divert" (refer https://bugs.debian.org/cgi-
+ bin/bugreport.cgi?bug=43) indicates it is a feature and has been
+ supported since 3.0040 and has been accepted by the upstream maintainer.
+ 
+ 
  [ Test Plan ]
  
+ Common case.
+ A1. Create a Jammy container or VM
+ A2. Install chrony: apt install chrony -y
+ A3. Confirm ucf works with no failures (including syntax errors)
+ B1. Modify the configuration: /etc/chrony/chrony.conf
+ B2. Remove chrony package and re-install
+ B3. Confirm it still works.
+ 
+ B. Case when a diversion is in place.
  1. Create a Jammy container or VM
  2. Setup a diversion for chrony.conf: dpkg-divert --package chrony --add 
--rename --divert /etc/chrony/chrony.conf.custom /etc/chrony/chrony.conf
  3. Install chrony: apt install chrony -y
  4. Notice the postinst script fail with syntax errors such as:
  ```
  Preparing to unpack .../chrony_4.2-2ubuntu2_amd64.deb ...
  Unpacking chrony (4.2-2ubuntu2) ...
  Setting up chrony (4.2-2ubuntu2) ...
  /usr/bin/ucf: 444: [: missing ]
  grep: ]: No such file or directory
  /usr/bin/ucf: 444: [: missing ]
  grep: ]: No such file or directory
  ```
  5. Install the package with the fix from the PPA: 
https://launchpad.net/~pponnuvel/+archive/ubuntu/ucf-jammy (to be replaced with 
the package from the -proposed pocket)
  6. Repeat the same from steps 1 to 4 and notice no failures at step4.
  
  [ Where problems could occur ]
  
  Can further introduce similar bugs if the patch contains similar syntax
  errors. Consequently local diversion may not take effect for packages
  using ucf to manage configuration files.
  
  [ Other Info ]
-  
+ 
  Upstream bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979354
  
  It's been fixed in version ucf/3.0043+nmu1. Lunar/Mantic/Noble all have the
  ucf version with this patch.
  
  Affects Jammy only and thus backported to only Jammy.

** Bug watch added: Debian Bug tracker #43
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=43

** Patch added: "lp2061825.debdiff"
   
https://bugs.launchpad.net/ubuntu/jammy/+source/ucf/+bug/2061825/+attachment/5779403/+files/lp2061825.debdiff

** Attachment removed: "debdiff_2061825_new.txt"
   
https://bugs.launchpad.net/ubuntu/jammy/+source/ucf/+bug/2061825/+attachment/5770060/+files/debdiff_2061825_new.txt

** Attachment removed: "debdiff.txt"
   
https://bugs.launchpad.net/ubuntu/jammy/+source/ucf/+bug/2061825/+attachment/5767388/+files/debdiff.txt

** Changed in: ucf (Ubuntu Jammy)
   Status: Incomplete => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-05-01 Thread Robie Basak
> * run update-maintainer script

FWIW, it's not necessary to mention this directly. It is correct to do
it, but convention is to skip mentioning it in the changelog because
otherwise we'd have to unnecessarily mention it on nearly every Ubuntu
upload.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-05-01 Thread Robie Basak
I wondered if ucf is expected to handle dpkg-divert -ed files in the
first place, since that seemed odd to me. It does seem like that's a
feature the code was intended to support, although it's unclear to me if
it ever worked, and it's not really documented anywhere I can find
except that is implied by the manpage. So it seems like it's debatable
as to whether this is a bugfix or a request to add a feature.

Looking at your description of "Impact", please could you expand on what
you're trying to achieve? Why are you using dpkg-divert to divert
configuration files installed by ucf? Did this method work in a previous
release? Why aren't you writing chrony.conf and then using
UCF_FORCE_CONFFOLD=1 instead, or just overwriting chrony.conf after
installation, given that ucf is intended to gracefully handle local
configuration file changes?

I ask because this seems like a risky change to make. ucf is widely
used, we don't have the means to test a broad set of uses, it ships with
no automated tests, and this particular "fix" was uploaded in a Debian
NMU that has yet to be acknowledged by the maintainer.

I'd like to understand the use case and why it is essential to fix this
in order to weigh up the risk please.

If we do decide to go ahead, then there are a few things that need
fixing, please.

The Test Plan must include the common case - that ucf continues to work
as expected when there is no diversion. Since there are no automated
tests whatsoever, please include exercise of the common cases that ucf
handles (installation, upgrade when packaging changes the configuration
file, with and without local user modification, package removal/purge,
etc).

Please fix the changelog description to explain what the actual user
story is that is being fixed, so that users can easily see if the fix is
relevant to them or not. For example: "Fix handling of configuration
files diverted with dpkg-divert (LP: #...)". Feel free to mention other
things like the syntax error if you wish, but just saying that you're
fixing a syntax error doesn't really convey anything useful to most
readers.


** Changed in: ucf (Ubuntu Jammy)
   Status: In Progress => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-30 Thread Heitor Alves de Siqueira
Thanks for the confirmation on Focal, @pponnuvel!

I've tested your debdiff, and it seems to work correctly. Patch is also
a straightforward cherry-pick from Debian.

Sponsored for Jammy, with the update-maintainer changes.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-24 Thread Ponnuvel Palaniyappan
Thanks, Heitor. I'll remember to run `update-maintainer` going forward!

Re. Focal: The syntax error and relevant code was introduced in 3.0040
whereas Focal is using older ucf. Thus Focal is unaffected. Likewise
Lunar/Mantic/Noble have the fixed version already. So this is a Jammy-
only backport.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-24 Thread Heitor Alves de Siqueira
Hi Pon,

thanks for the revised debdiff! This seems to be a non-quilt package, so
your approach of directly patching the ucf/ucfr scripts is correct. The
only thing missing is running the update-maintainer script, as the
ubuntu1 version requires having an ubuntu.com address on the maintainers
field. This is something a sponsor can run easily, so don't worry about
fixing it for now (but feel free to do it for future debdiffs!).

Before uploading this, I'd like to check about Focal; is that release
affected at all? If it is, any reason why we shouldn't patch it?

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-24 Thread Ponnuvel Palaniyappan
Thanks, Dariusz!

I've attached a new debdiff.

** Attachment added: "debdiff_2061825_new.txt"
   
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+attachment/5770060/+files/debdiff_2061825_new.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-24 Thread Dariusz Gadomski
Hey Pon, the debdiff contains changes to a bunch of files inside .pc
which should not be included.

Can you try generating the debdiff again wtihout these changes?

Once of the ways would be to drop in a patch to d/patches and add it
with quilt or apply it with the "patch" command and then run "dpkg-
source --commit" to generate the patch for you.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-18 Thread Ponnuvel Palaniyappan
Attaching the debdiff.

** Attachment added: "debdiff.txt"
   
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+attachment/5767388/+files/debdiff.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-17 Thread Ponnuvel Palaniyappan
** Tags added: sts

** Description changed:

- ucf doesn't work correctly when local diversions in place.
+ [ Impact ]
  
- This is due to a syntax error and has been fixed in Debian upstream:
+ When a dpkg-diversion is used to setup a package diversion and ucf for 
managing
+ the configuration files for chrony package, the postinst script of ucf fails
+ when installing chrony.
  
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979354
+ This issue isn't specific to chrony but can happen for any package whose
+ config files are managed by ucf.
  
- Mantic and Noble have the fixed version already. This bug doesn't exist
- Focal.
+ This affects users on Jammy who use ucf. Newer versions of ucf have this bug
+ fixed already.
  
+ [ Test Plan ]
  
- This will be a Jammy-only backport.
+ 1. Create a Jammy container or VM
+ 2. Setup a diversion for chrony.conf: dpkg-divert --package chrony --add 
--rename --divert /etc/chrony/chrony.conf.custom /etc/chrony/chrony.conf
+ 3. Install chrony: apt install chrony -y
+ 4. Notice the postinst script fail with syntax errors such as:
+ ```
+ Preparing to unpack .../chrony_4.2-2ubuntu2_amd64.deb ...
+ Unpacking chrony (4.2-2ubuntu2) ...
+ Setting up chrony (4.2-2ubuntu2) ...
+ /usr/bin/ucf: 444: [: missing ]
+ grep: ]: No such file or directory
+ /usr/bin/ucf: 444: [: missing ]
+ grep: ]: No such file or directory
+ ```
+ 5. Install the package with the fix from the PPA: 
https://launchpad.net/~pponnuvel/+archive/ubuntu/ucf-jammy (to be replaced with 
the package from the -proposed pocket)
+ 6. Repeat the same from steps 1 to 4 and notice no failures at step4.
+ 
+ [ Where problems could occur ]
+ 
+ Can further introduce similar bugs if the patch contains similar syntax
+ errors. Consequently local diversion may not take effect for packages
+ using ucf to manage configuration files.
+ 
+ [ Other Info ]
+  
+ Upstream bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979354
+ 
+ It's been fixed in version ucf/3.0043+nmu1. Lunar/Mantic/Noble all have the
+ ucf version with this patch.
+ 
+ Affects Jammy only and thus backported to only Jammy.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2061825] Re: [SRU] ucf fails to work for local diversions on Jammy

2024-04-17 Thread Ponnuvel Palaniyappan
** Summary changed:

- ucf fails to work for local diversions on Jammy
+ [SRU] ucf fails to work for local diversions on Jammy

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2061825

Title:
  [SRU] ucf fails to work for local diversions on Jammy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ucf/+bug/2061825/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs