WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how does sce-update behaves if an sce was imported with -R?  (Read 4204 times)

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
how does sce-update behaves if an sce was imported with -R?
« on: March 19, 2016, 05:54:47 PM »
?
dCore user

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #1 on: March 20, 2016, 09:29:28 AM »
The same way as always, it is just a bigger SCE with more packages inside it.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #2 on: September 21, 2016, 01:40:37 AM »
Hi
Shouldn't the -R flag need to be stored in the sce?
dCore user

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #3 on: September 21, 2016, 02:39:23 AM »
hi friends,

the -R flag is not mentioned in the -h info.
as far as i remember the -R flag includes all recommended files?
are there more flags and options that are not in help -h?
perhaps you want to update the help file that it explains the -R flag.

thank you for your help.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #4 on: September 21, 2016, 02:56:23 AM »
In the latest RC I see it is mentioned:
Code: [Select]


sce-import -R PKG      Include recommended Debian packages, warning large SCE.
dCore user

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #5 on: September 21, 2016, 03:00:11 AM »
I will ponder a way for sce-update to recognize if an SCE was imported with the -R and/or -S option. 

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #6 on: September 21, 2016, 06:54:30 AM »
Hi netnomad. Last check all sce-import options are in --help, the -R option was added some time ago. The SCE scripts are in /usr/bin, let me know if you see a case option not listed in --help.

Just learning and having fun, if anything is inaccurate please forgive :)

Seems importupdatecheck is only aware whether Recommended or Suggested packages were installed, not whether the -RS flags were used [1].

Code: [Select]
## Determine if SCE exists in SCE dir, SCE/update dir, or is mounted and then mount.
if [ -f "$SCEDIR"/update/"$SCE".sce ]; then
   [ -d /tmp/sceupdatetest ] || mkdir /tmp/sceupdatetest
   sudo busybox mount "$SCEDIR"/update/"$SCE".sce /tmp/sceupdatetest
   DATADIR=/tmp/sceupdatetest/usr/local/sce/"$SCE"
   FILE=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE".md5sum
   FILEDATA=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
   RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
   SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
elif sudo busybox mount | grep "/tmp/tcloop/$SCE " > /dev/null 2>&1; then
   DATADIR=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"
   FILE=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"/"$SCE".md5sum
   FILEDATA=/tmp/tcloop/"$SCE"/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
   RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
   SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
elif [ -f "$SCEDIR"/"$SCE".sce ]; then
   DATADIR=/tmp/sceupdatetest/usr/local/sce/"$SCE"
   [ -d /tmp/sceupdatetest ] || mkdir /tmp/sceupdatetest
   sudo busybox mount "$SCEDIR"/"$SCE".sce /tmp/sceupdatetest
   FILE=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE".md5sum
   FILEDATA=/tmp/sceupdatetest/usr/local/sce/"$SCE"/"$SCE"-data.md5sum
   RECOMMENDS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/recommends
   SUGGESTS=/tmp/sceupdatetest/usr/local/sce/"$SCE"/suggests
fi

Adding this just before mksquashfs command towards the bottom of deb2sce:
Code: [Select]
else
touch ""$TARGET"/usr/local/tce.installed/"$TARGET"_import_data"
echo "====  "$TARGET"  ====" > "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
echo "Import date: `date`" >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
if [ -f /tmp/.recommends ]; then
echo "Imported with -R option." >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
fi
if [ -f /tmp/.suggests ]; then
echo "Imported with -S option." >> "$TARGET"/usr/local/tce.installed/"$TARGET"_import_data
fi
mksquashfs "$TARGET" "$TCEDIR"/sce/"$TARGET".sce -noappend

...and running sce-import -RS nano produces a usr/local/tce.installed/nano_import_data file:
Code: [Select]
====  nano  ====
Import date: Wed Sep 21 06:39:57 UTC 2016
Imported with -R option.
Imported with -S option.

Unsure whether /tce.installed/ is appropriate for such a file, probably superfluous anyway. Something like this or simpler could be used to read case options for an update re-import.

[1] Importing nano with -RS flags, there were no Recommended packages. So the SCE contains only a  /tmp/tcloop/usr/local/sce/$SCE/suggests file. The absent recommends file, therefore, misleads both the user and importupdatecheck into thinking the -R option was not used during the initial import, even though it was. Maybe future bug if Debian/Ubuntu add Suggested and Recommended packages between update checks, not sure they do that.

Offline netnomad

  • Hero Member
  • *****
  • Posts: 1026
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #7 on: September 21, 2016, 10:28:14 AM »
hi nitram,

it was my fault... i tried sce-update -h, and looked there for the -R option, although it makes not very much sense ;-)
... and i missed to look in the sce-import options.

thank you for your reply.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #8 on: September 21, 2016, 01:03:41 PM »
We can definitely make /usr/local/sce/"$SCE"/recommends and /usr/local/sce/"$SCE"/suggests get created by the use of the -R or -S flag rather than the existence of extra recommended or suggested packages, that does make sense.  I like to have a file name like recommends or a one word entry in a file that is easy to grep for in the scripted routines.  But we also could create a human readable file that has the information like in the $target_import_data example above, that can include the flags the SCE was imported with and date so the user can refer to it.  And then a command like "sce-info" to basically echo that file.

Offline nitram

  • Hero Member
  • *****
  • Posts: 1054
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #9 on: September 22, 2016, 03:49:05 PM »
We can definitely make /usr/local/sce/"$SCE"/recommends and /usr/local/sce/"$SCE"/suggests get created by the use of the -R or -S flag rather than the existence of extra recommended or suggested packages, that does make sense.
Yes please, may prevent future bugs.

I created a function to be used just before mksquashfs in deb2sce to create /tce.installed/SCE_import_data file like:
Code: [Select]
nano.sce
 
Thu Sep 22 16:40:03 UTC 2016
 
Dependency import using:
xorg-all
 
Used -R option, added:
0 packages
 
Used -S option, added:
spell
 
Total import 9 packages (19 - 10 dependency provided):
dictionaries-common
emacsen-common
iamerican
ienglish-common
ispell
libtext-iconv-perl
nano
perlapi-5.20.0
spell

Archives some useful information during import. Not sure if necessary or just bloat. May help with troubleshooting in some instances. Personally would not use an sce-info script. Most dCore users would know where to find this tce.installed data file or could be directed by forum members if it helps with import/update troubleshooting.

Just let me know what you all think and i can submit a script update...or not. Thanks.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: how does sce-update behaves if an sce was imported with -R?
« Reply #10 on: September 22, 2016, 04:22:36 PM »
Yes, please send an update.  I think it can be done with no noticeable performance loss as installed package names and such already exist in files in user/local/sce.