Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore-new-distro seems to be broken since --exclude was added #4

Open
martinvonwittich opened this issue Apr 4, 2018 · 0 comments

Comments

@martinvonwittich
Copy link

martinvonwittich commented Apr 4, 2018

I'm trying to get restore-new-distro to work, but apt-clone wrote this into the /etc/apt/sources.list file:

deb http://ftp.de.debian.org/debian/ True main non-free contrib
deb http://ftp.de.debian.org/debian/ True-updates main non-free contrib
deb http://security.debian.org/ True main non-free contrib
deb https://update.iserv.eu/debian/ True main non-free contrib
deb https://update.iserv.eu/debian/ True main non-free
deb http://deb.avast.com/lin/repo True release

I believe that this bug was introduced by 567b2f1; the arguments of AptClone.restore_state were changed, but the elif args.command == "restore-new-distro" block wasn't updated to reflect this.

The following patch should fix it:

host ~ # diff -u =apt-clone apt-clone
--- /usr/bin/apt-clone  2015-11-13 21:11:38.000000000 +0100
+++ apt-clone   2018-04-04 15:36:45.810880259 +0200
@@ -79,6 +79,11 @@
     command.add_argument("new_distro_codename")
     command.add_argument("--destination", default="/")
     command.add_argument("--simulate", action="store_true", default=False)
+    command.add_argument(
+        "--rewrite-server",
+        help="rewrite all URIs in sources.list to the specified url")
+    command.add_argument("--exclude", nargs='*',
+                         help="exclude the listed package names from the restore")
     command.set_defaults(command="restore-new-distro")
     # show-diff
     command = subparser.add_parser(
@@ -141,8 +146,10 @@

         if args.simulate:
             miss = clone.simulate_restore_state(
-                args.source, args.new_distro_codename)
+                args.source, args.exclude, args.new_distro_codename)
             print("missing: %s" % ",".join(sorted(list(miss))))
         else:
             clone.restore_state(
-                args.source, args.destination, args.new_distro_codename, protect_installed)
+                args.source, args.destination, args.exclude,
+                args.new_distro_codename, protect_installed,
+                mirror=args.rewrite_server)
@martinvonwittich martinvonwittich changed the title --restore-new-distro seems to be broken since --exclude was added restore-new-distro seems to be broken since --exclude was added Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant