This module uses gbp and upstream git repository.

As of version 2.154, =pristine-tar= branch is no longer updated.

The instructions of this file assume that the branches are:
- master :: Debian work
- upstream :: upstream branch from github

To work on this package, please run:

#+begin_src shell
  git clone https://salsa.debian.org/perl-team/modules/packages/libconfig-model-perl.git
  git remote add github https://github.com/dod38fr/config-model.git
#+end_src

To update this package, first import the changes from upstream:
#+begin_src shell :dir .. :exports code :results verbatim
git fetch --all
#+end_src

#+RESULTS:
: Récupération de origin
: Récupération de github

Find the latest version:
#+NAME: version
#+begin_src shell :dir .. :exports code :results verbatim
VERSION=$(git describe --tags $(git rev-list '--tags=v*' --max-count=1) | sed 's/^v//')
echo -n $VERSION
#+end_src

#+RESULTS: version
: 2.159

Update upstream branch:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  git checkout upstream
  git merge v$VERSION
#+end_src

#+RESULTS:
#+begin_example
Votre branche est à jour avec 'origin/upstream'.
Mise à jour 5eb5b86d..332bcb4f
Fast-forward
 Changes                            | 14 ++++++++
 lib/Config/Model/Annotation.pm     |  1 -
 lib/Config/Model/Describe.pm       |  1 -
 lib/Config/Model/DumpAsData.pm     |  2 --
 lib/Config/Model/Dumper.pm         |  1 -
 lib/Config/Model/Instance.pm       |  7 ++--
 lib/Config/Model/Iterator.pm       |  1 -
 lib/Config/Model/Loader.pm         |  5 +--
 lib/Config/Model/ObjTreeScanner.pm | 69 ++++++++++++++------------------------
 lib/Config/Model/Report.pm         |  1 -
 lib/Config/Model/Value.pm          | 10 ++----
 lib/Config/Model/Value/Update.pm   |  2 +-
 t/obj_tree_scanner.t               |  9 ++---
 t/value.t                          |  2 +-
 14 files changed, 52 insertions(+), 73 deletions(-)
#+end_example

Update debian branch:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  git checkout master
  git merge upstream
#+end_src

#+RESULTS:
#+begin_example
Votre branche est à jour avec 'origin/master'.
Merge made by the 'ort' strategy.
 Changes                            | 14 ++++++++
 lib/Config/Model/Annotation.pm     |  1 -
 lib/Config/Model/Describe.pm       |  1 -
 lib/Config/Model/DumpAsData.pm     |  2 --
 lib/Config/Model/Dumper.pm         |  1 -
 lib/Config/Model/Instance.pm       |  7 ++--
 lib/Config/Model/Iterator.pm       |  1 -
 lib/Config/Model/Loader.pm         |  5 +--
 lib/Config/Model/ObjTreeScanner.pm | 69 ++++++++++++++------------------------
 lib/Config/Model/Report.pm         |  1 -
 lib/Config/Model/Value.pm          | 10 ++----
 lib/Config/Model/Value/Update.pm   |  2 +-
 t/obj_tree_scanner.t               |  9 ++---
 t/value.t                          |  2 +-
 14 files changed, 52 insertions(+), 73 deletions(-)
#+end_example

Update the debian/copyright file:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  cme update dpkg-copyright
#+end_src

#+RESULTS:
#+begin_example
Updating data...
Dpkg.Copyright.Grant.ByFile Dpkg::Copyright::Grant::ByFile::_warn The following paths are missing information:
- .github/workflows/perl-ci.yml
- CONTRIBUTING.md
- Changes
- MANIFEST.SKIP
- MODELS
- README.install.pod
- README.org
- build-from-git.org
- contrib/log4config-model
- debian/control
- debian/duck-overrides
- debian/gbp.conf
- debian/libconfig-model-perl.bash-completion
- debian/libconfig-model-perl.docs
- debian/patches/fix-debci
- debian/patches/fix-debci-load
- debian/patches/rm-git-from-dzil
- debian/rules
- debian/tests/pkg-perl/smoke-files
- debian/tests/pkg-perl/syntax-skip
- debian/tests/pkg-perl/use-name
- debian/upstream/metadata
- debian/watch
- lib/Config/Model.pm
- lib/Config/Model/Annotation.pm
- lib/Config/Model/AnyId.pm
- lib/Config/Model/AnyThing.pm
- lib/Config/Model/Backend/Any.pm
- lib/Config/Model/Backend/CdsFile.pm
- lib/Config/Model/Backend/Fstab.pm
- lib/Config/Model/Backend/IniFile.pm
- lib/Config/Model/Backend/Json.pm
- lib/Config/Model/Backend/PerlFile.pm
- lib/Config/Model/Backend/PlainFile.pm
- lib/Config/Model/Backend/ShellVar.pm
- lib/Config/Model/BackendMgr.pm
- lib/Config/Model/BackendTrackOrder.pm
- lib/Config/Model/CheckList.pm
- lib/Config/Model/Cookbook/CreateModelFromDoc.pod
- lib/Config/Model/Describe.pm
- lib/Config/Model/DumpAsData.pm
- lib/Config/Model/Dumper.pm
- lib/Config/Model/Exception.pm
- lib/Config/Model/FuseUI.pm
- lib/Config/Model/HashId.pm
- lib/Config/Model/IdElementReference.pm
- lib/Config/Model/Instance.pm
- lib/Config/Model/Iterator.pm
- lib/Config/Model/ListId.pm
- lib/Config/Model/Lister.pm
- lib/Config/Model/Loader.pm
- lib/Config/Model/Manual/ModelCreationAdvanced.pod
- lib/Config/Model/Manual/ModelCreationIntroduction.pod
- lib/Config/Model/Node.pm
- lib/Config/Model/ObjTreeScanner.pm
- lib/Config/Model/Report.pm
- lib/Config/Model/Role/ComputeFunction.pm
- lib/Config/Model/Role/Constants.pm
- lib/Config/Model/Role/FileHandler.pm
- lib/Config/Model/Role/Grab.pm
- lib/Config/Model/Role/HelpAsText.pm
- lib/Config/Model/Role/NodeLoader.pm
- lib/Config/Model/Role/Utils.pm
- lib/Config/Model/Role/WarpMaster.pm
- lib/Config/Model/SearchElement.pm
- lib/Config/Model/SimpleUI.pm
- lib/Config/Model/TermUI.pm
- lib/Config/Model/TreeSearcher.pm
- lib/Config/Model/TypeConstraints.pm
- lib/Config/Model/Utils/GenClassPod.pm
- lib/Config/Model/Value.pm
- lib/Config/Model/Value/LayeredInclude.pm
- lib/Config/Model/Value/Update.pm
- lib/Config/Model/Value/UpdateFromFile.pm
- lib/Config/Model/ValueComputer.pm
- lib/Config/Model/WarpedNode.pm
- lib/Config/Model/Warper.pm
- lib/Config/Model/log4perl.conf
- lib/Config/Model/models/Fstab.pl
- lib/Config/Model/models/Fstab.pod
- lib/Config/Model/models/Fstab/CommonOptions.pl
- lib/Config/Model/models/Fstab/Ext2FsOpt.pl
- lib/Config/Model/models/Fstab/Ext3FsOpt.pl
- lib/Config/Model/models/Fstab/Ext4FsOpt.pl
- lib/Config/Model/models/Fstab/FsLine.pl
- lib/Config/Model/models/Fstab/FsLine.pod
- lib/Config/Model/models/Fstab/Iso9660_Opt.pl
- lib/Config/Model/models/Fstab/NoneOptions.pl
- lib/Config/Model/models/Fstab/SwapOptions.pl
- lib/Config/Model/models/Fstab/UsbFsOptions.pl
- lib/Config/Model/models/PopCon.pl
- lib/Config/Model/models/PopCon.pod
- lib/Config/Model/system.d/fstab
- lib/Config/Model/system.d/popcon
- t/README.md
- t/accept.t
- t/annotation.t
- t/apply_fix.t
- t/array_id.t
- t/array_with_data_migration.t
- t/augment_class.t
- t/auto_load_model.t
- t/backend_ini.t
- t/backend_ini_with_section_map.t
- t/backend_mgr.t
- t/backend_plainfile.t
- t/check_list.t
- t/check_list_warp.t
- t/cme-force-load.t
- t/cme-function.t
- t/describe_node.t
- t/dump_as_data.t
- t/dump_tree.t
- t/fuse_ui.t
- t/gen-class-doc.t
- t/get_info.t
- t/grab.t
- t/hash_id_of_node.t
- t/hash_id_of_values.t
- t/hash_with_data_migration.t
- t/include.t
- t/instance-reset.t
- t/instance.t
- t/iterator.t
- t/lib/Config/Model/Backend/Mini.pm
- t/lib/Config/Model/models/Master.pl
- t/lib/DummyNode.pm
- t/lib/dump_load_model.pl
- t/lib/load-data.ini
- t/lib/load-data.json
- t/lib/load-data.yaml
- t/lib/test_ini_backend_model.pl
- t/load-model.t
- t/load.t
- t/load_model_snippets.t
- t/loader_logs.t
- t/log-init.t
- t/model.t
- t/model_tests.d/backend-cds-examples/basic
- t/model_tests.d/backend-cds-test-conf.pl
- t/model_tests.d/backend-ini-examples/complex
- t/model_tests.d/backend-ini-test-conf.pl
- t/model_tests.d/backend-json-examples/basic
- t/model_tests.d/backend-json-test-conf.pl
- t/model_tests.d/backend-key-value-examples/bts-control
- t/model_tests.d/backend-key-value-test-conf.pl
- t/model_tests.d/backend-perl-examples/basic
- t/model_tests.d/backend-perl-test-conf.pl
- t/model_tests.d/backend-plainfile-examples/with-index/debian/bar.install.list
- t/model_tests.d/backend-plainfile-examples/with-index/debian/bar.move.list
- t/model_tests.d/backend-plainfile-examples/with-index/debian/foo.install.list
- t/model_tests.d/backend-plainfile-test-conf.pl
- t/model_tests.d/backend-shellvar-examples/debian-719256
- t/model_tests.d/backend-shellvar-examples/keep-order
- t/model_tests.d/backend-shellvar-test-conf.pl
- t/model_tests.d/fstab-examples/t0
- t/model_tests.d/fstab-examples/t1
- t/model_tests.d/fstab-test-conf.pl
- t/model_tests.d/layer-examples/mini/etc/foo-config.pl
- t/model_tests.d/layer-examples/mini/home/joe/foo/config.pl
- t/model_tests.d/layer-test-conf.pl
- t/model_tests.d/multi-ini-examples/max-overflow/etc/bar.conf
- t/model_tests.d/multi-ini-test-conf.pl
- t/model_tests.d/popcon-examples/t0
- t/model_tests.d/popcon-test-conf.pl
- t/model_tests.t
- t/multi_warp_object.t
- t/multi_warp_value.t
- t/node-load.t
- t/node.t
- t/node_get_set.t
- t/obj_tree_scanner.t
- t/perl-critic.t
- t/perlcriticrc
- t/pod.t
- t/pod_generation.t
- t/recursive_warp_value.t
- t/report.t
- t/search_element.t
- t/search_in_tree.t
- t/simple_ui.t
- t/smooth_upgrade.t
- t/term_ui.t
- t/value.t
- t/value_compute.t
- t/value_refer_to.t
- t/value_simple_warp.t
- t/warped_id.t
- t/warped_node.t
- t/warped_node_collateral.t
- t/warped_value.t
- weaver.ini
You may want to add a line in debian/fill.copyright.blanks.yml

 (620) 
Removing dummy license text from license LGPL-2.1 for path *
Removing dummy license text from license LGPL-2.1+ for path debian/*
Removing dummy license text from license LGPL-2.1+ for path Build.PL
Update done
Please follow the instructions given in Config::Model::Dpkg::Copyright man page,
section "Tweak results" if some license and copyright entries are wrong.
Other information, like license text, can be added directly in debian/copyright file 
and will be merged correctly next time this command is run.
See also https://github.com/dod38fr/config-model/wiki/Updating-debian-copyright-file-with-cme
#+end_example

Then review the changes and commit the result.

See also https://github.com/dod38fr/config-model/wiki/Updating-debian-copyright-file-with-cme

Check patches (and cleanup if necessary):
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  quilt push --refresh -a && quilt pop -a
#+end_src

#+RESULTS:
#+begin_example
Application de rm-git-from-dzil
patching file dist.ini
Patch rm-git-from-dzil is unchanged

Application de fix-debci
patching file lib/Config/Model/Lister.pm
Patch fix-debci is unchanged

Application de fix-debci-load
patching file t/load.t
Patch fix-debci-load is unchanged

Le patch fix-debci-load est maintenant au sommet
Retrait de fix-debci-load
Restoring t/load.t

Retrait de fix-debci
Restoring lib/Config/Model/Lister.pm

Retrait de rm-git-from-dzil
Restoring dist.ini

Aucun patch n'est appliqué
#+end_example

Generate a temporary changelog:
#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  gbp dch --new-version=$VERSION-1 --snapshot --auto debian/
#+end_src

Commit =debian/changelog= (otherwise, =gbp buildpackage= tries to build the
old version):

#+begin_src shell :dir .. :exports code :results verbatim :var VERSION=version
  git commit -m"new upstream version" debian/changelog
#+end_src

You can build the package with the following command:

# this requires emacs ob-tmux
#+begin_src tmux :session build :results verbatim :exports code :var dir=repo_dir
  cd $dir
  gbp buildpackage --git-ignore-new
#+end_src

Note: only committed changes are used by =gbp buildpackage=

Update the changelog:

#+begin_src tmux :session build :results verbatim :exports code :var dir=repo_dir
  cd $dir
  gbp dch -Ra --commit
#+end_src

Build the package:

# this requires emacs ob-tmux
#+begin_src tmux :session build :results verbatim :exports code :var dir=repo_dir
  cd $dir
  gbp buildpackage
#+end_src

Once everything is fine, build a source package and tag:

#+begin_src tmux :session build :results verbatim :exports code :var dir=repo_dir
  cd $dir
  gbp buildpackage -S --git-tag
#+end_src

Push on salsa:

#+begin_src shell :dir ".." :results verbatim :exports code
  gbp push
#+end_src

For more details, see [[https://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.import.upstream-git.html#gbp.import.upstream.git.notarball][gbp import with git documentation]].

# this is a workaround for a bug in ob-tmux. No need to execute this
#+NAME: repo_dir
#+BEGIN_SRC shell :results verbatim :exports no
  cd ..
  echo -n $PWD
#+END_SRC

